Lines Matching refs:aead

38 static void *esp_alloc_tmp(struct crypto_aead *aead, int nfrags, int seqhilen)  in esp_alloc_tmp()  argument
44 len += crypto_aead_ivsize(aead); in esp_alloc_tmp()
47 len += crypto_aead_alignmask(aead) & in esp_alloc_tmp()
52 len += sizeof(struct aead_givcrypt_request) + crypto_aead_reqsize(aead); in esp_alloc_tmp()
64 static inline u8 *esp_tmp_iv(struct crypto_aead *aead, void *tmp, int seqhilen) in esp_tmp_iv() argument
66 return crypto_aead_ivsize(aead) ? in esp_tmp_iv()
68 crypto_aead_alignmask(aead) + 1) : tmp + seqhilen; in esp_tmp_iv()
72 struct crypto_aead *aead, u8 *iv) in esp_tmp_givreq() argument
76 req = (void *)PTR_ALIGN(iv + crypto_aead_ivsize(aead), in esp_tmp_givreq()
78 aead_givcrypt_set_tfm(req, aead); in esp_tmp_givreq()
82 static inline struct aead_request *esp_tmp_req(struct crypto_aead *aead, u8 *iv) in esp_tmp_req() argument
86 req = (void *)PTR_ALIGN(iv + crypto_aead_ivsize(aead), in esp_tmp_req()
88 aead_request_set_tfm(req, aead); in esp_tmp_req()
92 static inline struct scatterlist *esp_req_sg(struct crypto_aead *aead, in esp_req_sg() argument
96 crypto_aead_reqsize(aead), in esp_req_sg()
101 struct crypto_aead *aead, struct aead_givcrypt_request *req) in esp_givreq_sg() argument
104 crypto_aead_reqsize(aead), in esp_givreq_sg()
120 struct crypto_aead *aead; in esp_output() local
141 aead = x->data; in esp_output()
142 alen = crypto_aead_authsize(aead); in esp_output()
153 blksize = ALIGN(crypto_aead_blocksize(aead), 4); in esp_output()
172 tmp = esp_alloc_tmp(aead, nfrags + sglists, seqhilen); in esp_output()
179 iv = esp_tmp_iv(aead, tmp, seqhilen); in esp_output()
180 req = esp_tmp_givreq(aead, iv); in esp_output()
181 asg = esp_givreq_sg(aead, req); in esp_output()
243 esph->enc_data + crypto_aead_ivsize(aead) - skb->data, in esp_output()
280 struct crypto_aead *aead = x->data; in esp_input_done2() local
281 int alen = crypto_aead_authsize(aead); in esp_input_done2()
282 int hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead); in esp_input_done2()
375 struct crypto_aead *aead = x->data; in esp_input() local
378 int elen = skb->len - sizeof(*esph) - crypto_aead_ivsize(aead); in esp_input()
390 if (!pskb_may_pull(skb, sizeof(*esph) + crypto_aead_ivsize(aead))) in esp_input()
413 tmp = esp_alloc_tmp(aead, nfrags + sglists, seqhilen); in esp_input()
419 iv = esp_tmp_iv(aead, tmp, seqhilen); in esp_input()
420 req = esp_tmp_req(aead, iv); in esp_input()
421 asg = esp_req_sg(aead, req); in esp_input()
432 skb_to_sgvec(skb, sg, sizeof(*esph) + crypto_aead_ivsize(aead), elen); in esp_input()
459 struct crypto_aead *aead = x->data; in esp4_get_mtu() local
460 u32 blksize = ALIGN(crypto_aead_blocksize(aead), 4); in esp4_get_mtu()
475 return ((mtu - x->props.header_len - crypto_aead_authsize(aead) - in esp4_get_mtu()
512 struct crypto_aead *aead = x->data; in esp_destroy() local
514 if (!aead) in esp_destroy()
517 crypto_free_aead(aead); in esp_destroy()
522 struct crypto_aead *aead; in esp_init_aead() local
525 aead = crypto_alloc_aead(x->aead->alg_name, 0, 0); in esp_init_aead()
526 err = PTR_ERR(aead); in esp_init_aead()
527 if (IS_ERR(aead)) in esp_init_aead()
530 x->data = aead; in esp_init_aead()
532 err = crypto_aead_setkey(aead, x->aead->alg_key, in esp_init_aead()
533 (x->aead->alg_key_len + 7) / 8); in esp_init_aead()
537 err = crypto_aead_setauthsize(aead, x->aead->alg_icv_len / 8); in esp_init_aead()
547 struct crypto_aead *aead; in esp_init_authenc() local
576 aead = crypto_alloc_aead(authenc_name, 0, 0); in esp_init_authenc()
577 err = PTR_ERR(aead); in esp_init_authenc()
578 if (IS_ERR(aead)) in esp_init_authenc()
581 x->data = aead; in esp_init_authenc()
608 crypto_aead_authsize(aead)) { in esp_init_authenc()
611 crypto_aead_authsize(aead), in esp_init_authenc()
617 aead, x->aalg->alg_trunc_len / 8); in esp_init_authenc()
625 err = crypto_aead_setkey(aead, key, keylen); in esp_init_authenc()
636 struct crypto_aead *aead; in esp_init_state() local
642 if (x->aead) in esp_init_state()
650 aead = x->data; in esp_init_state()
653 crypto_aead_ivsize(aead); in esp_init_state()
673 align = ALIGN(crypto_aead_blocksize(aead), 4); in esp_init_state()
674 x->props.trailer_len = align + 1 + crypto_aead_authsize(aead); in esp_init_state()