Lines Matching refs:req
41 static void authenc_esn_request_complete(struct aead_request *req, int err) in authenc_esn_request_complete() argument
44 aead_request_complete(req, err); in authenc_esn_request_complete()
84 static int crypto_authenc_esn_genicv_tail(struct aead_request *req, in crypto_authenc_esn_genicv_tail() argument
87 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req); in crypto_authenc_esn_genicv_tail()
88 struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_esn_genicv_tail()
91 unsigned int assoclen = req->assoclen; in crypto_authenc_esn_genicv_tail()
92 unsigned int cryptlen = req->cryptlen; in crypto_authenc_esn_genicv_tail()
93 struct scatterlist *dst = req->dst; in crypto_authenc_esn_genicv_tail()
107 struct aead_request *req = data; in authenc_esn_geniv_ahash_done() local
109 err = err ?: crypto_authenc_esn_genicv_tail(req, 0); in authenc_esn_geniv_ahash_done()
110 aead_request_complete(req, err); in authenc_esn_geniv_ahash_done()
113 static int crypto_authenc_esn_genicv(struct aead_request *req, in crypto_authenc_esn_genicv() argument
116 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req); in crypto_authenc_esn_genicv()
117 struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_esn_genicv()
123 unsigned int assoclen = req->assoclen; in crypto_authenc_esn_genicv()
124 unsigned int cryptlen = req->cryptlen; in crypto_authenc_esn_genicv()
125 struct scatterlist *dst = req->dst; in crypto_authenc_esn_genicv()
142 authenc_esn_geniv_ahash_done, req); in crypto_authenc_esn_genicv()
145 crypto_authenc_esn_genicv_tail(req, aead_request_flags(req)); in crypto_authenc_esn_genicv()
159 static int crypto_authenc_esn_encrypt(struct aead_request *req) in crypto_authenc_esn_encrypt() argument
161 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req); in crypto_authenc_esn_encrypt()
162 struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_esn_encrypt()
167 unsigned int assoclen = req->assoclen; in crypto_authenc_esn_encrypt()
168 unsigned int cryptlen = req->cryptlen; in crypto_authenc_esn_encrypt()
173 src = scatterwalk_ffwd(areq_ctx->src, req->src, assoclen); in crypto_authenc_esn_encrypt()
176 if (req->src != req->dst) { in crypto_authenc_esn_encrypt()
177 memcpy_sglist(req->dst, req->src, assoclen); in crypto_authenc_esn_encrypt()
179 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, assoclen); in crypto_authenc_esn_encrypt()
183 skcipher_request_set_callback(skreq, aead_request_flags(req), in crypto_authenc_esn_encrypt()
184 crypto_authenc_esn_encrypt_done, req); in crypto_authenc_esn_encrypt()
185 skcipher_request_set_crypt(skreq, src, dst, cryptlen, req->iv); in crypto_authenc_esn_encrypt()
191 return crypto_authenc_esn_genicv(req, aead_request_flags(req)); in crypto_authenc_esn_encrypt()
194 static int crypto_authenc_esn_decrypt_tail(struct aead_request *req, in crypto_authenc_esn_decrypt_tail() argument
197 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req); in crypto_authenc_esn_decrypt_tail()
199 struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_esn_decrypt_tail()
205 unsigned int cryptlen = req->cryptlen - authsize; in crypto_authenc_esn_decrypt_tail()
206 unsigned int assoclen = req->assoclen; in crypto_authenc_esn_decrypt_tail()
207 struct scatterlist *dst = req->dst; in crypto_authenc_esn_decrypt_tail()
229 req->base.complete, req->base.data); in crypto_authenc_esn_decrypt_tail()
230 skcipher_request_set_crypt(skreq, dst, dst, cryptlen, req->iv); in crypto_authenc_esn_decrypt_tail()
237 struct aead_request *req = data; in authenc_esn_verify_ahash_done() local
239 err = err ?: crypto_authenc_esn_decrypt_tail(req, 0); in authenc_esn_verify_ahash_done()
240 authenc_esn_request_complete(req, err); in authenc_esn_verify_ahash_done()
243 static int crypto_authenc_esn_decrypt(struct aead_request *req) in crypto_authenc_esn_decrypt() argument
245 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req); in crypto_authenc_esn_decrypt()
246 struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_esn_decrypt()
252 unsigned int assoclen = req->assoclen; in crypto_authenc_esn_decrypt()
253 unsigned int cryptlen = req->cryptlen; in crypto_authenc_esn_decrypt()
255 struct scatterlist *dst = req->dst; in crypto_authenc_esn_decrypt()
261 if (req->src != dst) in crypto_authenc_esn_decrypt()
262 memcpy_sglist(dst, req->src, assoclen + cryptlen); in crypto_authenc_esn_decrypt()
264 scatterwalk_map_and_copy(ihash, req->src, assoclen + cryptlen, in crypto_authenc_esn_decrypt()
280 ahash_request_set_callback(ahreq, aead_request_flags(req), in crypto_authenc_esn_decrypt()
281 authenc_esn_verify_ahash_done, req); in crypto_authenc_esn_decrypt()
288 return crypto_authenc_esn_decrypt_tail(req, aead_request_flags(req)); in crypto_authenc_esn_decrypt()