Lines Matching refs:aead
45 static void *esp_alloc_tmp(struct crypto_aead *aead, int nfrags, int extralen) in esp_alloc_tmp() argument
51 len += crypto_aead_ivsize(aead); in esp_alloc_tmp()
54 len += crypto_aead_alignmask(aead) & in esp_alloc_tmp()
59 len += sizeof(struct aead_request) + crypto_aead_reqsize(aead); in esp_alloc_tmp()
72 static inline u8 *esp_tmp_iv(struct crypto_aead *aead, void *tmp, int extralen) in esp_tmp_iv() argument
74 return crypto_aead_ivsize(aead) ? in esp_tmp_iv()
76 crypto_aead_alignmask(aead) + 1) : tmp + extralen; in esp_tmp_iv()
79 static inline struct aead_request *esp_tmp_req(struct crypto_aead *aead, u8 *iv) in esp_tmp_req() argument
83 req = (void *)PTR_ALIGN(iv + crypto_aead_ivsize(aead), in esp_tmp_req()
85 aead_request_set_tfm(req, aead); in esp_tmp_req()
89 static inline struct scatterlist *esp_req_sg(struct crypto_aead *aead, in esp_req_sg() argument
93 crypto_aead_reqsize(aead), in esp_req_sg()
100 struct crypto_aead *aead = x->data; in esp_ssg_unref() local
110 iv = esp_tmp_iv(aead, tmp, extralen); in esp_ssg_unref()
111 req = esp_tmp_req(aead, iv); in esp_ssg_unref()
363 struct crypto_aead *aead; in esp_output_tail() local
377 aead = x->data; in esp_output_tail()
378 alen = crypto_aead_authsize(aead); in esp_output_tail()
379 ivlen = crypto_aead_ivsize(aead); in esp_output_tail()
381 tmp = esp_alloc_tmp(aead, esp->nfrags + 2, extralen); in esp_output_tail()
386 iv = esp_tmp_iv(aead, tmp, extralen); in esp_output_tail()
387 req = esp_tmp_req(aead, iv); in esp_output_tail()
388 sg = esp_req_sg(aead, req); in esp_output_tail()
477 struct crypto_aead *aead; in esp_output() local
487 aead = x->data; in esp_output()
488 alen = crypto_aead_authsize(aead); in esp_output()
499 blksize = ALIGN(crypto_aead_blocksize(aead), 4); in esp_output()
526 struct crypto_aead *aead = x->data; in esp_remove_trailer() local
533 alen = crypto_aead_authsize(aead); in esp_remove_trailer()
534 hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead); in esp_remove_trailer()
572 struct crypto_aead *aead = x->data; in esp_input_done2() local
573 int hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead); in esp_input_done2()
687 struct crypto_aead *aead = x->data; in esp_input() local
690 int ivlen = crypto_aead_ivsize(aead); in esp_input()
736 tmp = esp_alloc_tmp(aead, nfrags, seqhilen); in esp_input()
742 iv = esp_tmp_iv(aead, tmp, seqhilen); in esp_input()
743 req = esp_tmp_req(aead, iv); in esp_input()
744 sg = esp_req_sg(aead, req); in esp_input()
780 struct crypto_aead *aead = x->data; in esp4_get_mtu() local
781 u32 blksize = ALIGN(crypto_aead_blocksize(aead), 4); in esp4_get_mtu()
796 return ((mtu - x->props.header_len - crypto_aead_authsize(aead) - in esp4_get_mtu()
833 struct crypto_aead *aead = x->data; in esp_destroy() local
835 if (!aead) in esp_destroy()
838 crypto_free_aead(aead); in esp_destroy()
844 struct crypto_aead *aead; in esp_init_aead() local
849 x->geniv, x->aead->alg_name) >= CRYPTO_MAX_ALG_NAME) in esp_init_aead()
852 aead = crypto_alloc_aead(aead_name, 0, 0); in esp_init_aead()
853 err = PTR_ERR(aead); in esp_init_aead()
854 if (IS_ERR(aead)) in esp_init_aead()
857 x->data = aead; in esp_init_aead()
859 err = crypto_aead_setkey(aead, x->aead->alg_key, in esp_init_aead()
860 (x->aead->alg_key_len + 7) / 8); in esp_init_aead()
864 err = crypto_aead_setauthsize(aead, x->aead->alg_icv_len / 8); in esp_init_aead()
874 struct crypto_aead *aead; in esp_init_authenc() local
907 aead = crypto_alloc_aead(authenc_name, 0, 0); in esp_init_authenc()
908 err = PTR_ERR(aead); in esp_init_authenc()
909 if (IS_ERR(aead)) in esp_init_authenc()
912 x->data = aead; in esp_init_authenc()
939 crypto_aead_authsize(aead)) { in esp_init_authenc()
942 crypto_aead_authsize(aead), in esp_init_authenc()
948 aead, x->aalg->alg_trunc_len / 8); in esp_init_authenc()
956 err = crypto_aead_setkey(aead, key, keylen); in esp_init_authenc()
967 struct crypto_aead *aead; in esp_init_state() local
973 if (x->aead) in esp_init_state()
981 aead = x->data; in esp_init_state()
984 crypto_aead_ivsize(aead); in esp_init_state()
1005 align = ALIGN(crypto_aead_blocksize(aead), 4); in esp_init_state()
1006 x->props.trailer_len = align + 1 + crypto_aead_authsize(aead); in esp_init_state()