4

I need to apply HMAC SHA1 on some scatterlists in a C program. I have a sample code written for kernel 2.4 hmac crypto api, that uses this function:

void crypto_hmac(struct crypto_tfm *tfm, u8 *key, unsigned int *keylen, struct scatterlist *sg, unsigned int nsg, u8 *out)

but the crypto API in kernel 3.13 and after is SO MUCH DIFFERENT than 2.4!

I looked everywhere to find any example of using new strange minimalized function

static int hmac_create(struct crypto_template *tmpl, struct rtattr **tb)

provided in hmac.c (source/crypto), but I cannot find any topic or examples that uses kernel crypto api specificly hmac transform.

Any body has any experience using Linux Crypto API HMAC in C? Using this procedure will not be more than a few line of C codes.

Steve
  • 41
  • 3
  • Hi there did you solve this? On Windows and Mac there are built in APIs for crypto which handle hmac_sha1, I was now trying to do same on *nix. – Noitidart Dec 13 '16 at 22:17

0 Answers0