Lines Matching refs:req
48 static void authenc_esn_request_complete(struct aead_request *req, int err) in authenc_esn_request_complete() argument
51 aead_request_complete(req, err); in authenc_esn_request_complete()
100 static int crypto_authenc_esn_genicv_tail(struct aead_request *req, in crypto_authenc_esn_genicv_tail() argument
103 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req); in crypto_authenc_esn_genicv_tail()
105 struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_esn_genicv_tail()
110 unsigned int assoclen = req->assoclen; in crypto_authenc_esn_genicv_tail()
111 unsigned int cryptlen = req->cryptlen; in crypto_authenc_esn_genicv_tail()
112 struct scatterlist *dst = req->dst; in crypto_authenc_esn_genicv_tail()
127 struct aead_request *req = areq->data; in authenc_esn_geniv_ahash_done() local
129 err = err ?: crypto_authenc_esn_genicv_tail(req, 0); in authenc_esn_geniv_ahash_done()
130 aead_request_complete(req, err); in authenc_esn_geniv_ahash_done()
133 static int crypto_authenc_esn_genicv(struct aead_request *req, in crypto_authenc_esn_genicv() argument
136 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req); in crypto_authenc_esn_genicv()
137 struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_esn_genicv()
144 unsigned int assoclen = req->assoclen; in crypto_authenc_esn_genicv()
145 unsigned int cryptlen = req->cryptlen; in crypto_authenc_esn_genicv()
146 struct scatterlist *dst = req->dst; in crypto_authenc_esn_genicv()
163 authenc_esn_geniv_ahash_done, req); in crypto_authenc_esn_genicv()
166 crypto_authenc_esn_genicv_tail(req, aead_request_flags(req)); in crypto_authenc_esn_genicv()
170 static void crypto_authenc_esn_encrypt_done(struct crypto_async_request *req, in crypto_authenc_esn_encrypt_done() argument
173 struct aead_request *areq = req->data; in crypto_authenc_esn_encrypt_done()
181 static int crypto_authenc_esn_copy(struct aead_request *req, unsigned int len) in crypto_authenc_esn_copy() argument
183 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req); in crypto_authenc_esn_copy()
188 skcipher_request_set_callback(skreq, aead_request_flags(req), in crypto_authenc_esn_copy()
190 skcipher_request_set_crypt(skreq, req->src, req->dst, len, NULL); in crypto_authenc_esn_copy()
195 static int crypto_authenc_esn_encrypt(struct aead_request *req) in crypto_authenc_esn_encrypt() argument
197 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req); in crypto_authenc_esn_encrypt()
198 struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_esn_encrypt()
203 unsigned int assoclen = req->assoclen; in crypto_authenc_esn_encrypt()
204 unsigned int cryptlen = req->cryptlen; in crypto_authenc_esn_encrypt()
209 src = scatterwalk_ffwd(areq_ctx->src, req->src, assoclen); in crypto_authenc_esn_encrypt()
212 if (req->src != req->dst) { in crypto_authenc_esn_encrypt()
213 err = crypto_authenc_esn_copy(req, assoclen); in crypto_authenc_esn_encrypt()
218 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, assoclen); in crypto_authenc_esn_encrypt()
222 skcipher_request_set_callback(skreq, aead_request_flags(req), in crypto_authenc_esn_encrypt()
223 crypto_authenc_esn_encrypt_done, req); in crypto_authenc_esn_encrypt()
224 skcipher_request_set_crypt(skreq, src, dst, cryptlen, req->iv); in crypto_authenc_esn_encrypt()
230 return crypto_authenc_esn_genicv(req, aead_request_flags(req)); in crypto_authenc_esn_encrypt()
233 static int crypto_authenc_esn_decrypt_tail(struct aead_request *req, in crypto_authenc_esn_decrypt_tail() argument
236 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req); in crypto_authenc_esn_decrypt_tail()
238 struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_esn_decrypt_tail()
245 unsigned int cryptlen = req->cryptlen - authsize; in crypto_authenc_esn_decrypt_tail()
246 unsigned int assoclen = req->assoclen; in crypto_authenc_esn_decrypt_tail()
247 struct scatterlist *dst = req->dst; in crypto_authenc_esn_decrypt_tail()
269 req->base.complete, req->base.data); in crypto_authenc_esn_decrypt_tail()
270 skcipher_request_set_crypt(skreq, dst, dst, cryptlen, req->iv); in crypto_authenc_esn_decrypt_tail()
278 struct aead_request *req = areq->data; in authenc_esn_verify_ahash_done() local
280 err = err ?: crypto_authenc_esn_decrypt_tail(req, 0); in authenc_esn_verify_ahash_done()
281 aead_request_complete(req, err); in authenc_esn_verify_ahash_done()
284 static int crypto_authenc_esn_decrypt(struct aead_request *req) in crypto_authenc_esn_decrypt() argument
286 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req); in crypto_authenc_esn_decrypt()
287 struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_esn_decrypt()
294 unsigned int assoclen = req->assoclen; in crypto_authenc_esn_decrypt()
295 unsigned int cryptlen = req->cryptlen; in crypto_authenc_esn_decrypt()
297 struct scatterlist *dst = req->dst; in crypto_authenc_esn_decrypt()
303 if (req->src != dst) { in crypto_authenc_esn_decrypt()
304 err = crypto_authenc_esn_copy(req, assoclen + cryptlen); in crypto_authenc_esn_decrypt()
309 scatterwalk_map_and_copy(ihash, req->src, assoclen + cryptlen, in crypto_authenc_esn_decrypt()
325 ahash_request_set_callback(ahreq, aead_request_flags(req), in crypto_authenc_esn_decrypt()
326 authenc_esn_verify_ahash_done, req); in crypto_authenc_esn_decrypt()
333 return crypto_authenc_esn_decrypt_tail(req, aead_request_flags(req)); in crypto_authenc_esn_decrypt()