Lines Matching refs:aead
46 static void *esp_alloc_tmp(struct crypto_aead *aead, int nfrags, int extralen) in esp_alloc_tmp() argument
52 len += crypto_aead_ivsize(aead); in esp_alloc_tmp()
55 len += crypto_aead_alignmask(aead) & in esp_alloc_tmp()
60 len += sizeof(struct aead_request) + crypto_aead_reqsize(aead); in esp_alloc_tmp()
73 static inline u8 *esp_tmp_iv(struct crypto_aead *aead, void *tmp, int extralen) in esp_tmp_iv() argument
75 return crypto_aead_ivsize(aead) ? in esp_tmp_iv()
77 crypto_aead_alignmask(aead) + 1) : tmp + extralen; in esp_tmp_iv()
80 static inline struct aead_request *esp_tmp_req(struct crypto_aead *aead, u8 *iv) in esp_tmp_req() argument
84 req = (void *)PTR_ALIGN(iv + crypto_aead_ivsize(aead), in esp_tmp_req()
86 aead_request_set_tfm(req, aead); in esp_tmp_req()
90 static inline struct scatterlist *esp_req_sg(struct crypto_aead *aead, in esp_req_sg() argument
94 crypto_aead_reqsize(aead), in esp_req_sg()
100 struct crypto_aead *aead = x->data; in esp_ssg_unref() local
109 iv = esp_tmp_iv(aead, tmp, extralen); in esp_ssg_unref()
110 req = esp_tmp_req(aead, iv); in esp_ssg_unref()
539 struct crypto_aead *aead; in esp_output_tail() local
553 aead = x->data; in esp_output_tail()
554 alen = crypto_aead_authsize(aead); in esp_output_tail()
555 ivlen = crypto_aead_ivsize(aead); in esp_output_tail()
557 tmp = esp_alloc_tmp(aead, esp->nfrags + 2, extralen); in esp_output_tail()
562 iv = esp_tmp_iv(aead, tmp, extralen); in esp_output_tail()
563 req = esp_tmp_req(aead, iv); in esp_output_tail()
564 sg = esp_req_sg(aead, req); in esp_output_tail()
656 struct crypto_aead *aead; in esp_output() local
666 aead = x->data; in esp_output()
667 alen = crypto_aead_authsize(aead); in esp_output()
678 blksize = ALIGN(crypto_aead_blocksize(aead), 4); in esp_output()
705 struct crypto_aead *aead = x->data; in esp_remove_trailer() local
712 alen = crypto_aead_authsize(aead); in esp_remove_trailer()
713 hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead); in esp_remove_trailer()
751 struct crypto_aead *aead = x->data; in esp_input_done2() local
752 int hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead); in esp_input_done2()
881 struct crypto_aead *aead = x->data; in esp_input() local
884 int ivlen = crypto_aead_ivsize(aead); in esp_input()
930 tmp = esp_alloc_tmp(aead, nfrags, seqhilen); in esp_input()
936 iv = esp_tmp_iv(aead, tmp, seqhilen); in esp_input()
937 req = esp_tmp_req(aead, iv); in esp_input()
938 sg = esp_req_sg(aead, req); in esp_input()
1006 struct crypto_aead *aead = x->data; in esp_destroy() local
1008 if (!aead) in esp_destroy()
1011 crypto_free_aead(aead); in esp_destroy()
1017 struct crypto_aead *aead; in esp_init_aead() local
1022 x->geniv, x->aead->alg_name) >= CRYPTO_MAX_ALG_NAME) in esp_init_aead()
1025 aead = crypto_alloc_aead(aead_name, 0, 0); in esp_init_aead()
1026 err = PTR_ERR(aead); in esp_init_aead()
1027 if (IS_ERR(aead)) in esp_init_aead()
1030 x->data = aead; in esp_init_aead()
1032 err = crypto_aead_setkey(aead, x->aead->alg_key, in esp_init_aead()
1033 (x->aead->alg_key_len + 7) / 8); in esp_init_aead()
1037 err = crypto_aead_setauthsize(aead, x->aead->alg_icv_len / 8); in esp_init_aead()
1047 struct crypto_aead *aead; in esp_init_authenc() local
1080 aead = crypto_alloc_aead(authenc_name, 0, 0); in esp_init_authenc()
1081 err = PTR_ERR(aead); in esp_init_authenc()
1082 if (IS_ERR(aead)) in esp_init_authenc()
1085 x->data = aead; in esp_init_authenc()
1112 crypto_aead_authsize(aead)) { in esp_init_authenc()
1115 crypto_aead_authsize(aead), in esp_init_authenc()
1121 aead, x->aalg->alg_trunc_len / 8); in esp_init_authenc()
1129 err = crypto_aead_setkey(aead, key, keylen); in esp_init_authenc()
1140 struct crypto_aead *aead; in esp_init_state() local
1146 if (x->aead) in esp_init_state()
1154 aead = x->data; in esp_init_state()
1157 crypto_aead_ivsize(aead); in esp_init_state()
1186 align = ALIGN(crypto_aead_blocksize(aead), 4); in esp_init_state()
1187 x->props.trailer_len = align + 1 + crypto_aead_authsize(aead); in esp_init_state()