Lines Matching refs:req
45 static void authenc_request_complete(struct aead_request *req, int err) in authenc_request_complete() argument
48 aead_request_complete(req, err); in authenc_request_complete()
120 struct aead_request *req = areq->data; in authenc_geniv_ahash_done() local
121 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in authenc_geniv_ahash_done()
124 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in authenc_geniv_ahash_done()
130 scatterwalk_map_and_copy(ahreq->result, req->dst, in authenc_geniv_ahash_done()
131 req->assoclen + req->cryptlen, in authenc_geniv_ahash_done()
135 aead_request_complete(req, err); in authenc_geniv_ahash_done()
138 static int crypto_authenc_genicv(struct aead_request *req, unsigned int flags) in crypto_authenc_genicv() argument
140 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in crypto_authenc_genicv()
145 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_genicv()
154 ahash_request_set_crypt(ahreq, req->dst, hash, in crypto_authenc_genicv()
155 req->assoclen + req->cryptlen); in crypto_authenc_genicv()
157 authenc_geniv_ahash_done, req); in crypto_authenc_genicv()
163 scatterwalk_map_and_copy(hash, req->dst, req->assoclen + req->cryptlen, in crypto_authenc_genicv()
169 static void crypto_authenc_encrypt_done(struct crypto_async_request *req, in crypto_authenc_encrypt_done() argument
172 struct aead_request *areq = req->data; in crypto_authenc_encrypt_done()
183 static int crypto_authenc_copy_assoc(struct aead_request *req) in crypto_authenc_copy_assoc() argument
185 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in crypto_authenc_copy_assoc()
190 skcipher_request_set_callback(skreq, aead_request_flags(req), in crypto_authenc_copy_assoc()
192 skcipher_request_set_crypt(skreq, req->src, req->dst, req->assoclen, in crypto_authenc_copy_assoc()
198 static int crypto_authenc_encrypt(struct aead_request *req) in crypto_authenc_encrypt() argument
200 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in crypto_authenc_encrypt()
204 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_encrypt()
206 unsigned int cryptlen = req->cryptlen; in crypto_authenc_encrypt()
212 src = scatterwalk_ffwd(areq_ctx->src, req->src, req->assoclen); in crypto_authenc_encrypt()
215 if (req->src != req->dst) { in crypto_authenc_encrypt()
216 err = crypto_authenc_copy_assoc(req); in crypto_authenc_encrypt()
220 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); in crypto_authenc_encrypt()
224 skcipher_request_set_callback(skreq, aead_request_flags(req), in crypto_authenc_encrypt()
225 crypto_authenc_encrypt_done, req); in crypto_authenc_encrypt()
226 skcipher_request_set_crypt(skreq, src, dst, cryptlen, req->iv); in crypto_authenc_encrypt()
232 return crypto_authenc_genicv(req, aead_request_flags(req)); in crypto_authenc_encrypt()
235 static int crypto_authenc_decrypt_tail(struct aead_request *req, in crypto_authenc_decrypt_tail() argument
238 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in crypto_authenc_decrypt_tail()
242 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_decrypt_tail()
250 scatterwalk_map_and_copy(ihash, req->src, ahreq->nbytes, authsize, 0); in crypto_authenc_decrypt_tail()
255 src = scatterwalk_ffwd(areq_ctx->src, req->src, req->assoclen); in crypto_authenc_decrypt_tail()
258 if (req->src != req->dst) in crypto_authenc_decrypt_tail()
259 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); in crypto_authenc_decrypt_tail()
262 skcipher_request_set_callback(skreq, aead_request_flags(req), in crypto_authenc_decrypt_tail()
263 req->base.complete, req->base.data); in crypto_authenc_decrypt_tail()
265 req->cryptlen - authsize, req->iv); in crypto_authenc_decrypt_tail()
273 struct aead_request *req = areq->data; in authenc_verify_ahash_done() local
278 err = crypto_authenc_decrypt_tail(req, 0); in authenc_verify_ahash_done()
281 authenc_request_complete(req, err); in authenc_verify_ahash_done()
284 static int crypto_authenc_decrypt(struct aead_request *req) in crypto_authenc_decrypt() argument
286 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in crypto_authenc_decrypt()
292 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_decrypt()
301 ahash_request_set_crypt(ahreq, req->src, hash, in crypto_authenc_decrypt()
302 req->assoclen + req->cryptlen - authsize); in crypto_authenc_decrypt()
303 ahash_request_set_callback(ahreq, aead_request_flags(req), in crypto_authenc_decrypt()
304 authenc_verify_ahash_done, req); in crypto_authenc_decrypt()
310 return crypto_authenc_decrypt_tail(req, aead_request_flags(req)); in crypto_authenc_decrypt()