• Home
  • Raw
  • Download

Lines Matching refs:req

51 	struct aead_request *req)  in crypto_ccm_reqctx()  argument
53 unsigned long align = crypto_aead_alignmask(crypto_aead_reqtfm(req)); in crypto_ccm_reqctx()
55 return (void *)PTR_ALIGN((u8 *)aead_request_ctx(req), align + 1); in crypto_ccm_reqctx()
123 static int format_input(u8 *info, struct aead_request *req, in format_input() argument
126 struct crypto_aead *aead = crypto_aead_reqtfm(req); in format_input()
127 unsigned int lp = req->iv[0]; in format_input()
133 memcpy(info, req->iv, 16); in format_input()
139 if (req->assoclen) in format_input()
245 static int crypto_ccm_auth(struct aead_request *req, struct scatterlist *plain, in crypto_ccm_auth() argument
248 struct crypto_aead *aead = crypto_aead_reqtfm(req); in crypto_ccm_auth()
250 struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); in crypto_ccm_auth()
252 unsigned int assoclen = req->assoclen; in crypto_ccm_auth()
258 err = format_input(odata, req, cryptlen); in crypto_ccm_auth()
268 get_data_to_compute(cipher, pctx, req->assoc, req->assoclen); in crypto_ccm_auth()
282 struct aead_request *req = areq->data; in crypto_ccm_encrypt_done() local
283 struct crypto_aead *aead = crypto_aead_reqtfm(req); in crypto_ccm_encrypt_done()
284 struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); in crypto_ccm_encrypt_done()
288 scatterwalk_map_and_copy(odata, req->dst, req->cryptlen, in crypto_ccm_encrypt_done()
290 aead_request_complete(req, err); in crypto_ccm_encrypt_done()
302 static int crypto_ccm_encrypt(struct aead_request *req) in crypto_ccm_encrypt() argument
304 struct crypto_aead *aead = crypto_aead_reqtfm(req); in crypto_ccm_encrypt()
306 struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); in crypto_ccm_encrypt()
309 unsigned int cryptlen = req->cryptlen; in crypto_ccm_encrypt()
311 u8 *iv = req->iv; in crypto_ccm_encrypt()
318 pctx->flags = aead_request_flags(req); in crypto_ccm_encrypt()
320 err = crypto_ccm_auth(req, req->src, cryptlen); in crypto_ccm_encrypt()
331 scatterwalk_sg_chain(pctx->src, 2, req->src); in crypto_ccm_encrypt()
334 if (req->src != req->dst) { in crypto_ccm_encrypt()
337 scatterwalk_sg_chain(pctx->dst, 2, req->dst); in crypto_ccm_encrypt()
343 crypto_ccm_encrypt_done, req); in crypto_ccm_encrypt()
350 scatterwalk_map_and_copy(odata, req->dst, cryptlen, in crypto_ccm_encrypt()
358 struct aead_request *req = areq->data; in crypto_ccm_decrypt_done() local
359 struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); in crypto_ccm_decrypt_done()
360 struct crypto_aead *aead = crypto_aead_reqtfm(req); in crypto_ccm_decrypt_done()
362 unsigned int cryptlen = req->cryptlen - authsize; in crypto_ccm_decrypt_done()
365 err = crypto_ccm_auth(req, req->dst, cryptlen); in crypto_ccm_decrypt_done()
369 aead_request_complete(req, err); in crypto_ccm_decrypt_done()
372 static int crypto_ccm_decrypt(struct aead_request *req) in crypto_ccm_decrypt() argument
374 struct crypto_aead *aead = crypto_aead_reqtfm(req); in crypto_ccm_decrypt()
376 struct crypto_ccm_req_priv_ctx *pctx = crypto_ccm_reqctx(req); in crypto_ccm_decrypt()
380 unsigned int cryptlen = req->cryptlen; in crypto_ccm_decrypt()
383 u8 *iv = req->iv; in crypto_ccm_decrypt()
394 pctx->flags = aead_request_flags(req); in crypto_ccm_decrypt()
396 scatterwalk_map_and_copy(authtag, req->src, cryptlen, authsize, 0); in crypto_ccm_decrypt()
402 scatterwalk_sg_chain(pctx->src, 2, req->src); in crypto_ccm_decrypt()
405 if (req->src != req->dst) { in crypto_ccm_decrypt()
408 scatterwalk_sg_chain(pctx->dst, 2, req->dst); in crypto_ccm_decrypt()
414 crypto_ccm_decrypt_done, req); in crypto_ccm_decrypt()
420 err = crypto_ccm_auth(req, req->dst, cryptlen); in crypto_ccm_decrypt()
677 static struct aead_request *crypto_rfc4309_crypt(struct aead_request *req) in crypto_rfc4309_crypt() argument
679 struct aead_request *subreq = aead_request_ctx(req); in crypto_rfc4309_crypt()
680 struct crypto_aead *aead = crypto_aead_reqtfm(req); in crypto_rfc4309_crypt()
690 memcpy(iv + 4, req->iv, 8); in crypto_rfc4309_crypt()
693 aead_request_set_callback(subreq, req->base.flags, req->base.complete, in crypto_rfc4309_crypt()
694 req->base.data); in crypto_rfc4309_crypt()
695 aead_request_set_crypt(subreq, req->src, req->dst, req->cryptlen, iv); in crypto_rfc4309_crypt()
696 aead_request_set_assoc(subreq, req->assoc, req->assoclen); in crypto_rfc4309_crypt()
701 static int crypto_rfc4309_encrypt(struct aead_request *req) in crypto_rfc4309_encrypt() argument
703 req = crypto_rfc4309_crypt(req); in crypto_rfc4309_encrypt()
705 return crypto_aead_encrypt(req); in crypto_rfc4309_encrypt()
708 static int crypto_rfc4309_decrypt(struct aead_request *req) in crypto_rfc4309_decrypt() argument
710 req = crypto_rfc4309_crypt(req); in crypto_rfc4309_decrypt()
712 return crypto_aead_decrypt(req); in crypto_rfc4309_decrypt()