4 #include <linux/crypto.h>
7 /* This is the maximum truncated ICV length that we know of. */
8 #define MAX_AH_AUTH_LEN 12
18 void (*icv)(struct ah_data*,
19 struct sk_buff *skb, u8 *icv);
21 struct crypto_tfm *tfm;
25 ah_hmac_digest(struct ah_data *ahp, struct sk_buff *skb, u8 *auth_data)
27 struct crypto_tfm *tfm = ahp->tfm;
29 memset(auth_data, 0, ahp->icv_trunc_len);
30 crypto_hmac_init(tfm, ahp->key, &ahp->key_len);
31 skb_icv_walk(skb, tfm, 0, skb->len, crypto_hmac_update);
32 crypto_hmac_final(tfm, ahp->key, &ahp->key_len, ahp->work_icv);
33 memcpy(auth_data, ahp->work_icv, ahp->icv_trunc_len);