Lines Matching refs:aead

67 static void *esp_alloc_tmp(struct crypto_aead *aead, int nfrags, int seqihlen)  in esp_alloc_tmp()  argument
73 len += crypto_aead_ivsize(aead); in esp_alloc_tmp()
76 len += crypto_aead_alignmask(aead) & in esp_alloc_tmp()
81 len += sizeof(struct aead_request) + crypto_aead_reqsize(aead); in esp_alloc_tmp()
94 static inline u8 *esp_tmp_iv(struct crypto_aead *aead, void *tmp, int seqhilen) in esp_tmp_iv() argument
96 return crypto_aead_ivsize(aead) ? in esp_tmp_iv()
98 crypto_aead_alignmask(aead) + 1) : tmp + seqhilen; in esp_tmp_iv()
101 static inline struct aead_request *esp_tmp_req(struct crypto_aead *aead, u8 *iv) in esp_tmp_req() argument
105 req = (void *)PTR_ALIGN(iv + crypto_aead_ivsize(aead), in esp_tmp_req()
107 aead_request_set_tfm(req, aead); in esp_tmp_req()
111 static inline struct scatterlist *esp_req_sg(struct crypto_aead *aead, in esp_req_sg() argument
115 crypto_aead_reqsize(aead), in esp_req_sg()
121 struct crypto_aead *aead = x->data; in esp_ssg_unref() local
130 iv = esp_tmp_iv(aead, tmp, seqhilen); in esp_ssg_unref()
131 req = esp_tmp_req(aead, iv); in esp_ssg_unref()
330 struct crypto_aead *aead; in esp6_output_tail() local
342 aead = x->data; in esp6_output_tail()
343 alen = crypto_aead_authsize(aead); in esp6_output_tail()
344 ivlen = crypto_aead_ivsize(aead); in esp6_output_tail()
346 tmp = esp_alloc_tmp(aead, esp->nfrags + 2, seqhilen); in esp6_output_tail()
351 iv = esp_tmp_iv(aead, tmp, seqhilen); in esp6_output_tail()
352 req = esp_tmp_req(aead, iv); in esp6_output_tail()
353 sg = esp_req_sg(aead, req); in esp6_output_tail()
441 struct crypto_aead *aead; in esp6_output() local
451 aead = x->data; in esp6_output()
452 alen = crypto_aead_authsize(aead); in esp6_output()
463 blksize = ALIGN(crypto_aead_blocksize(aead), 4); in esp6_output()
488 struct crypto_aead *aead = x->data; in esp_remove_trailer() local
495 alen = crypto_aead_authsize(aead); in esp_remove_trailer()
496 hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead); in esp_remove_trailer()
533 struct crypto_aead *aead = x->data; in esp6_input_done2() local
534 int hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead); in esp6_input_done2()
605 struct crypto_aead *aead = x->data; in esp6_input() local
608 int ivlen = crypto_aead_ivsize(aead); in esp6_input()
658 tmp = esp_alloc_tmp(aead, nfrags, seqhilen); in esp6_input()
664 iv = esp_tmp_iv(aead, tmp, seqhilen); in esp6_input()
665 req = esp_tmp_req(aead, iv); in esp6_input()
666 sg = esp_req_sg(aead, req); in esp6_input()
702 struct crypto_aead *aead = x->data; in esp6_get_mtu() local
703 u32 blksize = ALIGN(crypto_aead_blocksize(aead), 4); in esp6_get_mtu()
711 return ((mtu - x->props.header_len - crypto_aead_authsize(aead) - in esp6_get_mtu()
744 struct crypto_aead *aead = x->data; in esp6_destroy() local
746 if (!aead) in esp6_destroy()
749 crypto_free_aead(aead); in esp6_destroy()
755 struct crypto_aead *aead; in esp_init_aead() local
760 x->geniv, x->aead->alg_name) >= CRYPTO_MAX_ALG_NAME) in esp_init_aead()
763 aead = crypto_alloc_aead(aead_name, 0, 0); in esp_init_aead()
764 err = PTR_ERR(aead); in esp_init_aead()
765 if (IS_ERR(aead)) in esp_init_aead()
768 x->data = aead; in esp_init_aead()
770 err = crypto_aead_setkey(aead, x->aead->alg_key, in esp_init_aead()
771 (x->aead->alg_key_len + 7) / 8); in esp_init_aead()
775 err = crypto_aead_setauthsize(aead, x->aead->alg_icv_len / 8); in esp_init_aead()
785 struct crypto_aead *aead; in esp_init_authenc() local
818 aead = crypto_alloc_aead(authenc_name, 0, 0); in esp_init_authenc()
819 err = PTR_ERR(aead); in esp_init_authenc()
820 if (IS_ERR(aead)) in esp_init_authenc()
823 x->data = aead; in esp_init_authenc()
850 crypto_aead_authsize(aead)) { in esp_init_authenc()
853 crypto_aead_authsize(aead), in esp_init_authenc()
859 aead, x->aalg->alg_trunc_len / 8); in esp_init_authenc()
867 err = crypto_aead_setkey(aead, key, keylen); in esp_init_authenc()
878 struct crypto_aead *aead; in esp6_init_state() local
887 if (x->aead) in esp6_init_state()
895 aead = x->data; in esp6_init_state()
898 crypto_aead_ivsize(aead); in esp6_init_state()
913 align = ALIGN(crypto_aead_blocksize(aead), 4); in esp6_init_state()
914 x->props.trailer_len = align + 1 + crypto_aead_authsize(aead); in esp6_init_state()