Lines Matching refs:req

38 static void authenc_request_complete(struct aead_request *req, int err)  in authenc_request_complete()  argument
41 aead_request_complete(req, err); in authenc_request_complete()
112 struct aead_request *req = data; in authenc_geniv_ahash_done() local
113 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in authenc_geniv_ahash_done()
116 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in authenc_geniv_ahash_done()
122 scatterwalk_map_and_copy(ahreq->result, req->dst, in authenc_geniv_ahash_done()
123 req->assoclen + req->cryptlen, in authenc_geniv_ahash_done()
127 aead_request_complete(req, err); in authenc_geniv_ahash_done()
130 static int crypto_authenc_genicv(struct aead_request *req, unsigned int flags) in crypto_authenc_genicv() argument
132 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in crypto_authenc_genicv()
137 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_genicv()
143 ahash_request_set_crypt(ahreq, req->dst, hash, in crypto_authenc_genicv()
144 req->assoclen + req->cryptlen); in crypto_authenc_genicv()
146 authenc_geniv_ahash_done, req); in crypto_authenc_genicv()
152 scatterwalk_map_and_copy(hash, req->dst, req->assoclen + req->cryptlen, in crypto_authenc_genicv()
171 static int crypto_authenc_encrypt(struct aead_request *req) in crypto_authenc_encrypt() argument
173 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in crypto_authenc_encrypt()
177 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_encrypt()
179 unsigned int cryptlen = req->cryptlen; in crypto_authenc_encrypt()
185 src = scatterwalk_ffwd(areq_ctx->src, req->src, req->assoclen); in crypto_authenc_encrypt()
188 if (req->src != req->dst) { in crypto_authenc_encrypt()
189 memcpy_sglist(req->dst, req->src, req->assoclen); in crypto_authenc_encrypt()
190 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); in crypto_authenc_encrypt()
194 skcipher_request_set_callback(skreq, aead_request_flags(req), in crypto_authenc_encrypt()
195 crypto_authenc_encrypt_done, req); in crypto_authenc_encrypt()
196 skcipher_request_set_crypt(skreq, src, dst, cryptlen, req->iv); in crypto_authenc_encrypt()
202 return crypto_authenc_genicv(req, aead_request_flags(req)); in crypto_authenc_encrypt()
205 static int crypto_authenc_decrypt_tail(struct aead_request *req, in crypto_authenc_decrypt_tail() argument
208 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in crypto_authenc_decrypt_tail()
212 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_decrypt_tail()
220 scatterwalk_map_and_copy(ihash, req->src, ahreq->nbytes, authsize, 0); in crypto_authenc_decrypt_tail()
225 src = scatterwalk_ffwd(areq_ctx->src, req->src, req->assoclen); in crypto_authenc_decrypt_tail()
228 if (req->src != req->dst) in crypto_authenc_decrypt_tail()
229 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); in crypto_authenc_decrypt_tail()
233 req->base.complete, req->base.data); in crypto_authenc_decrypt_tail()
235 req->cryptlen - authsize, req->iv); in crypto_authenc_decrypt_tail()
242 struct aead_request *req = data; in authenc_verify_ahash_done() local
247 err = crypto_authenc_decrypt_tail(req, 0); in authenc_verify_ahash_done()
250 authenc_request_complete(req, err); in authenc_verify_ahash_done()
253 static int crypto_authenc_decrypt(struct aead_request *req) in crypto_authenc_decrypt() argument
255 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in crypto_authenc_decrypt()
261 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_decrypt()
267 ahash_request_set_crypt(ahreq, req->src, hash, in crypto_authenc_decrypt()
268 req->assoclen + req->cryptlen - authsize); in crypto_authenc_decrypt()
269 ahash_request_set_callback(ahreq, aead_request_flags(req), in crypto_authenc_decrypt()
270 authenc_verify_ahash_done, req); in crypto_authenc_decrypt()
276 return crypto_authenc_decrypt_tail(req, aead_request_flags(req)); in crypto_authenc_decrypt()