Lines Matching refs:ahp
126 struct ah_data *ahp = x->data; in ah_output_done() local
132 icv = ah_tmp_icv(ahp->ahash, iph, ihl); in ah_output_done()
133 memcpy(ah->auth_data, icv, ahp->icv_trunc_len); in ah_output_done()
159 struct ah_data *ahp; in ah_output() local
165 ahp = x->data; in ah_output()
166 ahash = ahp->ahash; in ah_output()
190 memset(ah->auth_data, 0, ahp->icv_trunc_len); in ah_output()
216 ah->hdrlen = (XFRM_ALIGN4(sizeof(*ah) + ahp->icv_trunc_len) >> 2) - 2; in ah_output()
218 ah->hdrlen = (XFRM_ALIGN8(sizeof(*ah) + ahp->icv_trunc_len) >> 2) - 2; in ah_output()
249 memcpy(ah->auth_data, icv, ahp->icv_trunc_len); in ah_output()
272 struct ah_data *ahp = x->data; in ah_input_done() local
282 icv = ah_tmp_icv(ahp->ahash, auth_data, ahp->icv_trunc_len); in ah_input_done()
284 err = crypto_memneq(icv, auth_data, ahp->icv_trunc_len) ? -EBADMSG : 0; in ah_input_done()
317 struct ah_data *ahp; in ah_input() local
328 ahp = x->data; in ah_input()
329 ahash = ahp->ahash; in ah_input()
335 if (ah_hlen != XFRM_ALIGN4(sizeof(*ah) + ahp->icv_full_len) && in ah_input()
336 ah_hlen != XFRM_ALIGN4(sizeof(*ah) + ahp->icv_trunc_len)) in ah_input()
339 if (ah_hlen != XFRM_ALIGN8(sizeof(*ah) + ahp->icv_full_len) && in ah_input()
340 ah_hlen != XFRM_ALIGN8(sizeof(*ah) + ahp->icv_trunc_len)) in ah_input()
369 ahp->icv_trunc_len + seqhi_len); in ah_input()
377 icv = ah_tmp_icv(ahash, auth_data, ahp->icv_trunc_len); in ah_input()
383 memcpy(auth_data, ah->auth_data, ahp->icv_trunc_len); in ah_input()
384 memset(ah->auth_data, 0, ahp->icv_trunc_len); in ah_input()
422 err = crypto_memneq(icv, auth_data, ahp->icv_trunc_len) ? -EBADMSG : 0; in ah_input()
476 struct ah_data *ahp = NULL; in ah_init_state() local
490 ahp = kzalloc(sizeof(*ahp), GFP_KERNEL); in ah_init_state()
491 if (!ahp) in ah_init_state()
500 ahp->ahash = ahash; in ah_init_state()
522 ahp->icv_full_len = aalg_desc->uinfo.auth.icv_fullbits/8; in ah_init_state()
523 ahp->icv_trunc_len = x->aalg->alg_trunc_len/8; in ah_init_state()
527 ahp->icv_trunc_len); in ah_init_state()
530 ahp->icv_trunc_len); in ah_init_state()
533 x->data = ahp; in ah_init_state()
538 if (ahp) { in ah_init_state()
539 crypto_free_ahash(ahp->ahash); in ah_init_state()
540 kfree(ahp); in ah_init_state()
547 struct ah_data *ahp = x->data; in ah_destroy() local
549 if (!ahp) in ah_destroy()
552 crypto_free_ahash(ahp->ahash); in ah_destroy()
553 kfree(ahp); in ah_destroy()