Lines Matching refs:aead

53 static void *esp_alloc_tmp(struct crypto_aead *aead, int nfrags, int seqihlen)  in esp_alloc_tmp()  argument
59 len += crypto_aead_ivsize(aead); in esp_alloc_tmp()
62 len += crypto_aead_alignmask(aead) & in esp_alloc_tmp()
67 len += sizeof(struct aead_request) + crypto_aead_reqsize(aead); in esp_alloc_tmp()
80 static inline u8 *esp_tmp_iv(struct crypto_aead *aead, void *tmp, int seqhilen) in esp_tmp_iv() argument
82 return crypto_aead_ivsize(aead) ? in esp_tmp_iv()
84 crypto_aead_alignmask(aead) + 1) : tmp + seqhilen; in esp_tmp_iv()
87 static inline struct aead_request *esp_tmp_req(struct crypto_aead *aead, u8 *iv) in esp_tmp_req() argument
91 req = (void *)PTR_ALIGN(iv + crypto_aead_ivsize(aead), in esp_tmp_req()
93 aead_request_set_tfm(req, aead); in esp_tmp_req()
97 static inline struct scatterlist *esp_req_sg(struct crypto_aead *aead, in esp_req_sg() argument
101 crypto_aead_reqsize(aead), in esp_req_sg()
107 struct crypto_aead *aead = x->data; in esp_ssg_unref() local
116 iv = esp_tmp_iv(aead, tmp, seqhilen); in esp_ssg_unref()
117 req = esp_tmp_req(aead, iv); in esp_ssg_unref()
319 struct crypto_aead *aead; in esp6_output_tail() local
331 aead = x->data; in esp6_output_tail()
332 alen = crypto_aead_authsize(aead); in esp6_output_tail()
333 ivlen = crypto_aead_ivsize(aead); in esp6_output_tail()
335 tmp = esp_alloc_tmp(aead, esp->nfrags + 2, seqhilen); in esp6_output_tail()
340 iv = esp_tmp_iv(aead, tmp, seqhilen); in esp6_output_tail()
341 req = esp_tmp_req(aead, iv); in esp6_output_tail()
342 sg = esp_req_sg(aead, req); in esp6_output_tail()
430 struct crypto_aead *aead; in esp6_output() local
440 aead = x->data; in esp6_output()
441 alen = crypto_aead_authsize(aead); in esp6_output()
452 blksize = ALIGN(crypto_aead_blocksize(aead), 4); in esp6_output()
477 struct crypto_aead *aead = x->data; in esp_remove_trailer() local
484 alen = crypto_aead_authsize(aead); in esp_remove_trailer()
485 hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead); in esp_remove_trailer()
522 struct crypto_aead *aead = x->data; in esp6_input_done2() local
523 int hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead); in esp6_input_done2()
593 struct crypto_aead *aead = x->data; in esp6_input() local
596 int ivlen = crypto_aead_ivsize(aead); in esp6_input()
646 tmp = esp_alloc_tmp(aead, nfrags, seqhilen); in esp6_input()
652 iv = esp_tmp_iv(aead, tmp, seqhilen); in esp6_input()
653 req = esp_tmp_req(aead, iv); in esp6_input()
654 sg = esp_req_sg(aead, req); in esp6_input()
717 struct crypto_aead *aead = x->data; in esp6_destroy() local
719 if (!aead) in esp6_destroy()
722 crypto_free_aead(aead); in esp6_destroy()
728 struct crypto_aead *aead; in esp_init_aead() local
733 x->geniv, x->aead->alg_name) >= CRYPTO_MAX_ALG_NAME) in esp_init_aead()
736 aead = crypto_alloc_aead(aead_name, 0, 0); in esp_init_aead()
737 err = PTR_ERR(aead); in esp_init_aead()
738 if (IS_ERR(aead)) in esp_init_aead()
741 x->data = aead; in esp_init_aead()
743 err = crypto_aead_setkey(aead, x->aead->alg_key, in esp_init_aead()
744 (x->aead->alg_key_len + 7) / 8); in esp_init_aead()
748 err = crypto_aead_setauthsize(aead, x->aead->alg_icv_len / 8); in esp_init_aead()
758 struct crypto_aead *aead; in esp_init_authenc() local
791 aead = crypto_alloc_aead(authenc_name, 0, 0); in esp_init_authenc()
792 err = PTR_ERR(aead); in esp_init_authenc()
793 if (IS_ERR(aead)) in esp_init_authenc()
796 x->data = aead; in esp_init_authenc()
823 crypto_aead_authsize(aead)) { in esp_init_authenc()
826 crypto_aead_authsize(aead), in esp_init_authenc()
832 aead, x->aalg->alg_trunc_len / 8); in esp_init_authenc()
840 err = crypto_aead_setkey(aead, key, keylen); in esp_init_authenc()
851 struct crypto_aead *aead; in esp6_init_state() local
860 if (x->aead) in esp6_init_state()
868 aead = x->data; in esp6_init_state()
871 crypto_aead_ivsize(aead); in esp6_init_state()
886 align = ALIGN(crypto_aead_blocksize(aead), 4); in esp6_init_state()
887 x->props.trailer_len = align + 1 + crypto_aead_authsize(aead); in esp6_init_state()