Lines Matching full: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()
110 static void authenc_geniv_ahash_finish(struct aead_request *req) in authenc_geniv_ahash_finish() argument
112 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in authenc_geniv_ahash_finish()
115 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in authenc_geniv_ahash_finish()
118 scatterwalk_map_and_copy(ahreq->result, req->dst, in authenc_geniv_ahash_finish()
119 req->assoclen + req->cryptlen, in authenc_geniv_ahash_finish()
125 struct aead_request *req = data; in authenc_geniv_ahash_done() local
128 authenc_geniv_ahash_finish(req); in authenc_geniv_ahash_done()
129 aead_request_complete(req, err); in authenc_geniv_ahash_done()
138 struct aead_request *req = data; in authenc_geniv_ahash_done2() local
141 authenc_geniv_ahash_finish(req); in authenc_geniv_ahash_done2()
142 authenc_request_complete(req, err); in authenc_geniv_ahash_done2()
145 static int crypto_authenc_genicv(struct aead_request *req, unsigned int mask) in crypto_authenc_genicv() argument
147 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in crypto_authenc_genicv()
152 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_genicv()
154 unsigned int flags = aead_request_flags(req) & ~mask; in crypto_authenc_genicv()
159 ahash_request_set_crypt(ahreq, req->dst, hash, in crypto_authenc_genicv()
160 req->assoclen + req->cryptlen); in crypto_authenc_genicv()
163 authenc_geniv_ahash_done, req); in crypto_authenc_genicv()
169 scatterwalk_map_and_copy(hash, req->dst, req->assoclen + req->cryptlen, in crypto_authenc_genicv()
187 static int crypto_authenc_encrypt(struct aead_request *req) in crypto_authenc_encrypt() argument
189 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in crypto_authenc_encrypt()
193 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_encrypt()
195 unsigned int cryptlen = req->cryptlen; in crypto_authenc_encrypt()
201 src = scatterwalk_ffwd(areq_ctx->src, req->src, req->assoclen); in crypto_authenc_encrypt()
204 if (req->src != req->dst) { in crypto_authenc_encrypt()
205 memcpy_sglist(req->dst, req->src, req->assoclen); in crypto_authenc_encrypt()
206 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); in crypto_authenc_encrypt()
210 skcipher_request_set_callback(skreq, aead_request_flags(req), in crypto_authenc_encrypt()
211 crypto_authenc_encrypt_done, req); in crypto_authenc_encrypt()
212 skcipher_request_set_crypt(skreq, src, dst, cryptlen, req->iv); in crypto_authenc_encrypt()
218 return crypto_authenc_genicv(req, 0); in crypto_authenc_encrypt()
223 struct aead_request *req = data; in authenc_decrypt_tail_done() local
225 authenc_request_complete(req, err); in authenc_decrypt_tail_done()
228 static int crypto_authenc_decrypt_tail(struct aead_request *req, in crypto_authenc_decrypt_tail() argument
231 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in crypto_authenc_decrypt_tail()
235 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_decrypt_tail()
240 unsigned int flags = aead_request_flags(req) & ~mask; in crypto_authenc_decrypt_tail()
244 scatterwalk_map_and_copy(ihash, req->src, ahreq->nbytes, authsize, 0); in crypto_authenc_decrypt_tail()
249 src = scatterwalk_ffwd(areq_ctx->src, req->src, req->assoclen); in crypto_authenc_decrypt_tail()
252 if (req->src != req->dst) in crypto_authenc_decrypt_tail()
253 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen); in crypto_authenc_decrypt_tail()
258 req->base.complete, in crypto_authenc_decrypt_tail()
259 mask ? req : req->base.data); in crypto_authenc_decrypt_tail()
261 req->cryptlen - authsize, req->iv); in crypto_authenc_decrypt_tail()
268 struct aead_request *req = data; in authenc_verify_ahash_done() local
271 aead_request_complete(req, err); in authenc_verify_ahash_done()
274 err = crypto_authenc_decrypt_tail(req, CRYPTO_TFM_REQ_MAY_SLEEP); in authenc_verify_ahash_done()
275 authenc_request_complete(req, err); in authenc_verify_ahash_done()
278 static int crypto_authenc_decrypt(struct aead_request *req) in crypto_authenc_decrypt() argument
280 struct crypto_aead *authenc = crypto_aead_reqtfm(req); in crypto_authenc_decrypt()
286 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); in crypto_authenc_decrypt()
292 ahash_request_set_crypt(ahreq, req->src, hash, in crypto_authenc_decrypt()
293 req->assoclen + req->cryptlen - authsize); in crypto_authenc_decrypt()
294 ahash_request_set_callback(ahreq, aead_request_flags(req), in crypto_authenc_decrypt()
295 authenc_verify_ahash_done, req); in crypto_authenc_decrypt()
301 return crypto_authenc_decrypt_tail(req, 0); in crypto_authenc_decrypt()