Lines Matching refs:req

43 static void authenc_esn_request_complete(struct aead_request *req, int err)
46 aead_request_complete(req, err);
86 static int crypto_authenc_esn_genicv_tail(struct aead_request *req,
89 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req);
91 struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req);
96 unsigned int assoclen = req->assoclen;
97 unsigned int cryptlen = req->cryptlen;
98 struct scatterlist *dst = req->dst;
113 struct aead_request *req = areq->data;
115 err = err ?: crypto_authenc_esn_genicv_tail(req, 0);
116 aead_request_complete(req, err);
119 static int crypto_authenc_esn_genicv(struct aead_request *req,
122 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req);
123 struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req);
130 unsigned int assoclen = req->assoclen;
131 unsigned int cryptlen = req->cryptlen;
132 struct scatterlist *dst = req->dst;
149 authenc_esn_geniv_ahash_done, req);
152 crypto_authenc_esn_genicv_tail(req, aead_request_flags(req));
156 static void crypto_authenc_esn_encrypt_done(struct crypto_async_request *req,
159 struct aead_request *areq = req->data;
167 static int crypto_authenc_esn_copy(struct aead_request *req, unsigned int len)
169 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req);
174 skcipher_request_set_callback(skreq, aead_request_flags(req),
176 skcipher_request_set_crypt(skreq, req->src, req->dst, len, NULL);
181 static int crypto_authenc_esn_encrypt(struct aead_request *req)
183 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req);
184 struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req);
189 unsigned int assoclen = req->assoclen;
190 unsigned int cryptlen = req->cryptlen;
195 src = scatterwalk_ffwd(areq_ctx->src, req->src, assoclen);
198 if (req->src != req->dst) {
199 err = crypto_authenc_esn_copy(req, assoclen);
204 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, assoclen);
208 skcipher_request_set_callback(skreq, aead_request_flags(req),
209 crypto_authenc_esn_encrypt_done, req);
210 skcipher_request_set_crypt(skreq, src, dst, cryptlen, req->iv);
216 return crypto_authenc_esn_genicv(req, aead_request_flags(req));
219 static int crypto_authenc_esn_decrypt_tail(struct aead_request *req,
222 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req);
224 struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req);
231 unsigned int cryptlen = req->cryptlen - authsize;
232 unsigned int assoclen = req->assoclen;
233 struct scatterlist *dst = req->dst;
255 req->base.complete, req->base.data);
256 skcipher_request_set_crypt(skreq, dst, dst, cryptlen, req->iv);
264 struct aead_request *req = areq->data;
266 err = err ?: crypto_authenc_esn_decrypt_tail(req, 0);
267 authenc_esn_request_complete(req, err);
270 static int crypto_authenc_esn_decrypt(struct aead_request *req)
272 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req);
273 struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req);
280 unsigned int assoclen = req->assoclen;
281 unsigned int cryptlen = req->cryptlen;
283 struct scatterlist *dst = req->dst;
289 if (req->src != dst) {
290 err = crypto_authenc_esn_copy(req, assoclen + cryptlen);
295 scatterwalk_map_and_copy(ihash, req->src, assoclen + cryptlen,
311 ahash_request_set_callback(ahreq, aead_request_flags(req),
312 authenc_esn_verify_ahash_done, req);
319 return crypto_authenc_esn_decrypt_tail(req, aead_request_flags(req));