Lines Matching refs:aead

47 static void *esp_alloc_tmp(struct crypto_aead *aead, int nfrags, int extralen)  in esp_alloc_tmp()  argument
53 len += crypto_aead_ivsize(aead); in esp_alloc_tmp()
56 len += crypto_aead_alignmask(aead) & in esp_alloc_tmp()
61 len += sizeof(struct aead_request) + crypto_aead_reqsize(aead); in esp_alloc_tmp()
74 static inline u8 *esp_tmp_iv(struct crypto_aead *aead, void *tmp, int extralen) in esp_tmp_iv() argument
76 return crypto_aead_ivsize(aead) ? in esp_tmp_iv()
78 crypto_aead_alignmask(aead) + 1) : tmp + extralen; in esp_tmp_iv()
81 static inline struct aead_request *esp_tmp_req(struct crypto_aead *aead, u8 *iv) in esp_tmp_req() argument
85 req = (void *)PTR_ALIGN(iv + crypto_aead_ivsize(aead), in esp_tmp_req()
87 aead_request_set_tfm(req, aead); in esp_tmp_req()
91 static inline struct scatterlist *esp_req_sg(struct crypto_aead *aead, in esp_req_sg() argument
95 crypto_aead_reqsize(aead), in esp_req_sg()
101 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()
541 struct crypto_aead *aead; in esp_output_tail() local
555 aead = x->data; in esp_output_tail()
556 alen = crypto_aead_authsize(aead); in esp_output_tail()
557 ivlen = crypto_aead_ivsize(aead); in esp_output_tail()
559 tmp = esp_alloc_tmp(aead, esp->nfrags + 2, extralen); in esp_output_tail()
564 iv = esp_tmp_iv(aead, tmp, extralen); in esp_output_tail()
565 req = esp_tmp_req(aead, iv); in esp_output_tail()
566 sg = esp_req_sg(aead, req); in esp_output_tail()
658 struct crypto_aead *aead; in esp_output() local
668 aead = x->data; in esp_output()
669 alen = crypto_aead_authsize(aead); in esp_output()
680 blksize = ALIGN(crypto_aead_blocksize(aead), 4); in esp_output()
706 struct crypto_aead *aead = x->data; in esp_remove_trailer() local
713 alen = crypto_aead_authsize(aead); in esp_remove_trailer()
714 hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead); in esp_remove_trailer()
749 struct crypto_aead *aead = x->data; in esp_input_done2() local
750 int hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead); in esp_input_done2()
878 struct crypto_aead *aead = x->data; in esp_input() local
881 int ivlen = crypto_aead_ivsize(aead); in esp_input()
927 tmp = esp_alloc_tmp(aead, nfrags, seqhilen); in esp_input()
933 iv = esp_tmp_iv(aead, tmp, seqhilen); in esp_input()
934 req = esp_tmp_req(aead, iv); in esp_input()
935 sg = esp_req_sg(aead, req); in esp_input()
1003 struct crypto_aead *aead = x->data; in esp_destroy() local
1005 if (!aead) in esp_destroy()
1008 crypto_free_aead(aead); in esp_destroy()
1014 struct crypto_aead *aead; in esp_init_aead() local
1018 x->geniv, x->aead->alg_name) >= CRYPTO_MAX_ALG_NAME) { in esp_init_aead()
1023 aead = crypto_alloc_aead(aead_name, 0, 0); in esp_init_aead()
1024 err = PTR_ERR(aead); in esp_init_aead()
1025 if (IS_ERR(aead)) in esp_init_aead()
1028 x->data = aead; in esp_init_aead()
1030 err = crypto_aead_setkey(aead, x->aead->alg_key, in esp_init_aead()
1031 (x->aead->alg_key_len + 7) / 8); in esp_init_aead()
1035 err = crypto_aead_setauthsize(aead, x->aead->alg_icv_len / 8); in esp_init_aead()
1049 struct crypto_aead *aead; in esp_init_authenc() local
1082 aead = crypto_alloc_aead(authenc_name, 0, 0); in esp_init_authenc()
1083 err = PTR_ERR(aead); in esp_init_authenc()
1084 if (IS_ERR(aead)) { in esp_init_authenc()
1089 x->data = aead; in esp_init_authenc()
1116 crypto_aead_authsize(aead)) { in esp_init_authenc()
1122 aead, x->aalg->alg_trunc_len / 8); in esp_init_authenc()
1132 err = crypto_aead_setkey(aead, key, keylen); in esp_init_authenc()
1143 struct crypto_aead *aead; in esp_init_state() local
1149 if (x->aead) { in esp_init_state()
1161 aead = x->data; in esp_init_state()
1164 crypto_aead_ivsize(aead); in esp_init_state()
1191 align = ALIGN(crypto_aead_blocksize(aead), 4); in esp_init_state()
1192 x->props.trailer_len = align + 1 + crypto_aead_authsize(aead); in esp_init_state()