Lines Matching refs:ahp
62 struct ah_data *ahp;
93 ahp = x->data;
95 ahp->icv_trunc_len) >> 2) - 2;
101 err = ah_mac_digest(ahp, skb, ah->auth_data);
104 memcpy(ah->auth_data, ahp->work_icv, ahp->icv_trunc_len);
129 struct ah_data *ahp;
136 ahp = x->data;
139 if (ah_hlen != XFRM_ALIGN8(sizeof(struct ip_auth_hdr) + ahp->icv_full_len) &&
140 ah_hlen != XFRM_ALIGN8(sizeof(struct ip_auth_hdr) + ahp->icv_trunc_len))
172 memcpy(auth_data, ah->auth_data, ahp->icv_trunc_len);
174 err = ah_mac_digest(ahp, skb, ah->auth_data);
178 if (memcmp(ahp->work_icv, auth_data, ahp->icv_trunc_len)) {
215 struct ah_data *ahp = NULL;
229 ahp = kzalloc(sizeof(*ahp), GFP_KERNEL);
230 if (ahp == NULL)
233 ahp->key = x->aalg->alg_key;
234 ahp->key_len = (x->aalg->alg_key_len+7)/8;
239 ahp->tfm = tfm;
240 if (crypto_hash_setkey(tfm, ahp->key, ahp->key_len))
260 ahp->icv_full_len = aalg_desc->uinfo.auth.icv_fullbits/8;
261 ahp->icv_trunc_len = aalg_desc->uinfo.auth.icv_truncbits/8;
263 BUG_ON(ahp->icv_trunc_len > MAX_AH_AUTH_LEN);
265 ahp->work_icv = kmalloc(ahp->icv_full_len, GFP_KERNEL);
266 if (!ahp->work_icv)
269 x->props.header_len = XFRM_ALIGN8(sizeof(struct ip_auth_hdr) + ahp->icv_trunc_len);
272 x->data = ahp;
277 if (ahp) {
278 kfree(ahp->work_icv);
279 crypto_free_hash(ahp->tfm);
280 kfree(ahp);
287 struct ah_data *ahp = x->data;
289 if (!ahp)
292 kfree(ahp->work_icv);
293 ahp->work_icv = NULL;
294 crypto_free_hash(ahp->tfm);
295 ahp->tfm = NULL;
296 kfree(ahp);