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;
112 struct aead_request *req = data;
114 err = err ?: crypto_authenc_esn_genicv_tail(req, 0);
115 aead_request_complete(req, err);
118 static int crypto_authenc_esn_genicv(struct aead_request *req,
121 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req);
122 struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req);
129 unsigned int assoclen = req->assoclen;
130 unsigned int cryptlen = req->cryptlen;
131 struct scatterlist *dst = req->dst;
148 authenc_esn_geniv_ahash_done, req);
151 crypto_authenc_esn_genicv_tail(req, aead_request_flags(req));
165 static int crypto_authenc_esn_copy(struct aead_request *req, unsigned int len)
167 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req);
172 skcipher_request_set_callback(skreq, aead_request_flags(req),
174 skcipher_request_set_crypt(skreq, req->src, req->dst, len, NULL);
179 static int crypto_authenc_esn_encrypt(struct aead_request *req)
181 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req);
182 struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req);
187 unsigned int assoclen = req->assoclen;
188 unsigned int cryptlen = req->cryptlen;
193 src = scatterwalk_ffwd(areq_ctx->src, req->src, assoclen);
196 if (req->src != req->dst) {
197 err = crypto_authenc_esn_copy(req, assoclen);
202 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, assoclen);
206 skcipher_request_set_callback(skreq, aead_request_flags(req),
207 crypto_authenc_esn_encrypt_done, req);
208 skcipher_request_set_crypt(skreq, src, dst, cryptlen, req->iv);
214 return crypto_authenc_esn_genicv(req, aead_request_flags(req));
217 static int crypto_authenc_esn_decrypt_tail(struct aead_request *req,
220 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req);
222 struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req);
229 unsigned int cryptlen = req->cryptlen - authsize;
230 unsigned int assoclen = req->assoclen;
231 struct scatterlist *dst = req->dst;
253 req->base.complete, req->base.data);
254 skcipher_request_set_crypt(skreq, dst, dst, cryptlen, req->iv);
261 struct aead_request *req = data;
263 err = err ?: crypto_authenc_esn_decrypt_tail(req, 0);
264 authenc_esn_request_complete(req, err);
267 static int crypto_authenc_esn_decrypt(struct aead_request *req)
269 struct crypto_aead *authenc_esn = crypto_aead_reqtfm(req);
270 struct authenc_esn_request_ctx *areq_ctx = aead_request_ctx(req);
277 unsigned int assoclen = req->assoclen;
278 unsigned int cryptlen = req->cryptlen;
280 struct scatterlist *dst = req->dst;
286 if (req->src != dst) {
287 err = crypto_authenc_esn_copy(req, assoclen + cryptlen);
292 scatterwalk_map_and_copy(ihash, req->src, assoclen + cryptlen,
308 ahash_request_set_callback(ahreq, aead_request_flags(req),
309 authenc_esn_verify_ahash_done, req);
316 return crypto_authenc_esn_decrypt_tail(req, aead_request_flags(req));