Lines Matching refs:aead

65 static void *esp_alloc_tmp(struct crypto_aead *aead, int nfrags, int seqihlen)  in esp_alloc_tmp()  argument
71 len += crypto_aead_ivsize(aead); in esp_alloc_tmp()
74 len += crypto_aead_alignmask(aead) & in esp_alloc_tmp()
79 len += sizeof(struct aead_givcrypt_request) + crypto_aead_reqsize(aead); in esp_alloc_tmp()
92 static inline u8 *esp_tmp_iv(struct crypto_aead *aead, void *tmp, int seqhilen) in esp_tmp_iv() argument
94 return crypto_aead_ivsize(aead) ? in esp_tmp_iv()
96 crypto_aead_alignmask(aead) + 1) : tmp + seqhilen; in esp_tmp_iv()
100 struct crypto_aead *aead, u8 *iv) in esp_tmp_givreq() argument
104 req = (void *)PTR_ALIGN(iv + crypto_aead_ivsize(aead), in esp_tmp_givreq()
106 aead_givcrypt_set_tfm(req, aead); in esp_tmp_givreq()
110 static inline struct aead_request *esp_tmp_req(struct crypto_aead *aead, u8 *iv) in esp_tmp_req() argument
114 req = (void *)PTR_ALIGN(iv + crypto_aead_ivsize(aead), in esp_tmp_req()
116 aead_request_set_tfm(req, aead); in esp_tmp_req()
120 static inline struct scatterlist *esp_req_sg(struct crypto_aead *aead, in esp_req_sg() argument
124 crypto_aead_reqsize(aead), in esp_req_sg()
129 struct crypto_aead *aead, struct aead_givcrypt_request *req) in esp_givreq_sg() argument
132 crypto_aead_reqsize(aead), in esp_givreq_sg()
148 struct crypto_aead *aead; in esp6_output() local
168 aead = x->data; in esp6_output()
169 alen = crypto_aead_authsize(aead); in esp6_output()
180 blksize = ALIGN(crypto_aead_blocksize(aead), 4); in esp6_output()
199 tmp = esp_alloc_tmp(aead, nfrags + sglists, seqhilen); in esp6_output()
206 iv = esp_tmp_iv(aead, tmp, seqhilen); in esp6_output()
207 req = esp_tmp_givreq(aead, iv); in esp6_output()
208 asg = esp_givreq_sg(aead, req); in esp6_output()
235 esph->enc_data + crypto_aead_ivsize(aead) - skb->data, in esp6_output()
271 struct crypto_aead *aead = x->data; in esp_input_done2() local
272 int alen = crypto_aead_authsize(aead); in esp_input_done2()
273 int hlen = sizeof(struct ip_esp_hdr) + crypto_aead_ivsize(aead); in esp_input_done2()
324 struct crypto_aead *aead = x->data; in esp6_input() local
327 int elen = skb->len - sizeof(*esph) - crypto_aead_ivsize(aead); in esp6_input()
339 if (!pskb_may_pull(skb, sizeof(*esph) + crypto_aead_ivsize(aead))) { in esp6_input()
367 tmp = esp_alloc_tmp(aead, nfrags + sglists, seqhilen); in esp6_input()
373 iv = esp_tmp_iv(aead, tmp, seqhilen); in esp6_input()
374 req = esp_tmp_req(aead, iv); in esp6_input()
375 asg = esp_req_sg(aead, req); in esp6_input()
386 skb_to_sgvec(skb, sg, sizeof(*esph) + crypto_aead_ivsize(aead), elen); in esp6_input()
413 struct crypto_aead *aead = x->data; in esp6_get_mtu() local
414 u32 blksize = ALIGN(crypto_aead_blocksize(aead), 4); in esp6_get_mtu()
422 return ((mtu - x->props.header_len - crypto_aead_authsize(aead) - in esp6_get_mtu()
454 struct crypto_aead *aead = x->data; in esp6_destroy() local
456 if (!aead) in esp6_destroy()
459 crypto_free_aead(aead); in esp6_destroy()
464 struct crypto_aead *aead; in esp_init_aead() local
467 aead = crypto_alloc_aead(x->aead->alg_name, 0, 0); in esp_init_aead()
468 err = PTR_ERR(aead); in esp_init_aead()
469 if (IS_ERR(aead)) in esp_init_aead()
472 x->data = aead; in esp_init_aead()
474 err = crypto_aead_setkey(aead, x->aead->alg_key, in esp_init_aead()
475 (x->aead->alg_key_len + 7) / 8); in esp_init_aead()
479 err = crypto_aead_setauthsize(aead, x->aead->alg_icv_len / 8); in esp_init_aead()
489 struct crypto_aead *aead; in esp_init_authenc() local
518 aead = crypto_alloc_aead(authenc_name, 0, 0); in esp_init_authenc()
519 err = PTR_ERR(aead); in esp_init_authenc()
520 if (IS_ERR(aead)) in esp_init_authenc()
523 x->data = aead; in esp_init_authenc()
550 crypto_aead_authsize(aead)) { in esp_init_authenc()
553 crypto_aead_authsize(aead), in esp_init_authenc()
559 aead, x->aalg->alg_trunc_len / 8); in esp_init_authenc()
567 err = crypto_aead_setkey(aead, key, keylen); in esp_init_authenc()
578 struct crypto_aead *aead; in esp6_init_state() local
587 if (x->aead) in esp6_init_state()
595 aead = x->data; in esp6_init_state()
598 crypto_aead_ivsize(aead); in esp6_init_state()
614 align = ALIGN(crypto_aead_blocksize(aead), 4); in esp6_init_state()
615 x->props.trailer_len = align + 1 + crypto_aead_authsize(aead); in esp6_init_state()