Lines Matching refs:aead

63 static void *esp_alloc_tmp(struct crypto_aead *aead, int nfrags, int seqihlen)  in esp_alloc_tmp()  argument
69 len += crypto_aead_ivsize(aead); in esp_alloc_tmp()
72 len += crypto_aead_alignmask(aead) & in esp_alloc_tmp()
77 len += sizeof(struct aead_request) + crypto_aead_reqsize(aead); in esp_alloc_tmp()
90 static inline u8 *esp_tmp_iv(struct crypto_aead *aead, void *tmp, int seqhilen) in esp_tmp_iv() argument
92 return crypto_aead_ivsize(aead) ? in esp_tmp_iv()
94 crypto_aead_alignmask(aead) + 1) : tmp + seqhilen; in esp_tmp_iv()
97 static inline struct aead_request *esp_tmp_req(struct crypto_aead *aead, u8 *iv) in esp_tmp_req() argument
101 req = (void *)PTR_ALIGN(iv + crypto_aead_ivsize(aead), in esp_tmp_req()
103 aead_request_set_tfm(req, aead); in esp_tmp_req()
107 static inline struct scatterlist *esp_req_sg(struct crypto_aead *aead, in esp_req_sg() argument
111 crypto_aead_reqsize(aead), in esp_req_sg()
118 struct crypto_aead *aead = x->data; in esp_ssg_unref() local
127 iv = esp_tmp_iv(aead, tmp, extralen); in esp_ssg_unref()
128 req = esp_tmp_req(aead, iv); in esp_ssg_unref()
576 struct crypto_aead *aead; in esp6_output_tail() local
589 aead = x->data; in esp6_output_tail()
590 alen = crypto_aead_authsize(aead); in esp6_output_tail()
591 ivlen = crypto_aead_ivsize(aead); in esp6_output_tail()
593 tmp = esp_alloc_tmp(aead, esp->nfrags + 2, extralen); in esp6_output_tail()
598 iv = esp_tmp_iv(aead, tmp, extralen); in esp6_output_tail()
599 req = esp_tmp_req(aead, iv); in esp6_output_tail()
600 sg = esp_req_sg(aead, req); in esp6_output_tail()
693 struct crypto_aead *aead; in esp6_output() local
703 aead = x->data; in esp6_output()
704 alen = crypto_aead_authsize(aead); in esp6_output()
715 blksize = ALIGN(crypto_aead_blocksize(aead), 4); in esp6_output()
742 struct crypto_aead *aead = x->data; in esp_remove_trailer() local
749 alen = crypto_aead_authsize(aead); in esp_remove_trailer()
750 hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead); in esp_remove_trailer()
787 struct crypto_aead *aead = x->data; in esp6_input_done2() local
788 int hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead); in esp6_input_done2()
925 struct crypto_aead *aead = x->data; in esp6_input() local
928 int ivlen = crypto_aead_ivsize(aead); in esp6_input()
978 tmp = esp_alloc_tmp(aead, nfrags, seqhilen); in esp6_input()
984 iv = esp_tmp_iv(aead, tmp, seqhilen); in esp6_input()
985 req = esp_tmp_req(aead, iv); in esp6_input()
986 sg = esp_req_sg(aead, req); in esp6_input()
1049 struct crypto_aead *aead = x->data; in esp6_destroy() local
1051 if (!aead) in esp6_destroy()
1054 crypto_free_aead(aead); in esp6_destroy()
1060 struct crypto_aead *aead; in esp_init_aead() local
1065 x->geniv, x->aead->alg_name) >= CRYPTO_MAX_ALG_NAME) in esp_init_aead()
1068 aead = crypto_alloc_aead(aead_name, 0, 0); in esp_init_aead()
1069 err = PTR_ERR(aead); in esp_init_aead()
1070 if (IS_ERR(aead)) in esp_init_aead()
1073 x->data = aead; in esp_init_aead()
1075 err = crypto_aead_setkey(aead, x->aead->alg_key, in esp_init_aead()
1076 (x->aead->alg_key_len + 7) / 8); in esp_init_aead()
1080 err = crypto_aead_setauthsize(aead, x->aead->alg_icv_len / 8); in esp_init_aead()
1090 struct crypto_aead *aead; in esp_init_authenc() local
1123 aead = crypto_alloc_aead(authenc_name, 0, 0); in esp_init_authenc()
1124 err = PTR_ERR(aead); in esp_init_authenc()
1125 if (IS_ERR(aead)) in esp_init_authenc()
1128 x->data = aead; in esp_init_authenc()
1155 crypto_aead_authsize(aead)) { in esp_init_authenc()
1158 crypto_aead_authsize(aead), in esp_init_authenc()
1164 aead, x->aalg->alg_trunc_len / 8); in esp_init_authenc()
1172 err = crypto_aead_setkey(aead, key, keylen); in esp_init_authenc()
1183 struct crypto_aead *aead; in esp6_init_state() local
1189 if (x->aead) in esp6_init_state()
1197 aead = x->data; in esp6_init_state()
1200 crypto_aead_ivsize(aead); in esp6_init_state()
1239 align = ALIGN(crypto_aead_blocksize(aead), 4); in esp6_init_state()
1240 x->props.trailer_len = align + 1 + crypto_aead_authsize(aead); in esp6_init_state()