Lines Matching refs:req

40 static void authenc_request_complete(struct aead_request *req, int err)
43 aead_request_complete(req, err);
114 struct aead_request *req = data;
115 struct crypto_aead *authenc = crypto_aead_reqtfm(req);
118 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req);
124 scatterwalk_map_and_copy(ahreq->result, req->dst,
125 req->assoclen + req->cryptlen,
129 aead_request_complete(req, err);
132 static int crypto_authenc_genicv(struct aead_request *req, unsigned int flags)
134 struct crypto_aead *authenc = crypto_aead_reqtfm(req);
139 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req);
148 ahash_request_set_crypt(ahreq, req->dst, hash,
149 req->assoclen + req->cryptlen);
151 authenc_geniv_ahash_done, req);
157 scatterwalk_map_and_copy(hash, req->dst, req->assoclen + req->cryptlen,
176 static int crypto_authenc_copy_assoc(struct aead_request *req)
178 struct crypto_aead *authenc = crypto_aead_reqtfm(req);
183 skcipher_request_set_callback(skreq, aead_request_flags(req),
185 skcipher_request_set_crypt(skreq, req->src, req->dst, req->assoclen,
191 static int crypto_authenc_encrypt(struct aead_request *req)
193 struct crypto_aead *authenc = crypto_aead_reqtfm(req);
197 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req);
199 unsigned int cryptlen = req->cryptlen;
205 src = scatterwalk_ffwd(areq_ctx->src, req->src, req->assoclen);
208 if (req->src != req->dst) {
209 err = crypto_authenc_copy_assoc(req);
213 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen);
217 skcipher_request_set_callback(skreq, aead_request_flags(req),
218 crypto_authenc_encrypt_done, req);
219 skcipher_request_set_crypt(skreq, src, dst, cryptlen, req->iv);
225 return crypto_authenc_genicv(req, aead_request_flags(req));
228 static int crypto_authenc_decrypt_tail(struct aead_request *req,
231 struct crypto_aead *authenc = crypto_aead_reqtfm(req);
235 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req);
243 scatterwalk_map_and_copy(ihash, req->src, ahreq->nbytes, authsize, 0);
248 src = scatterwalk_ffwd(areq_ctx->src, req->src, req->assoclen);
251 if (req->src != req->dst)
252 dst = scatterwalk_ffwd(areq_ctx->dst, req->dst, req->assoclen);
256 req->base.complete, req->base.data);
258 req->cryptlen - authsize, req->iv);
265 struct aead_request *req = data;
270 err = crypto_authenc_decrypt_tail(req, 0);
273 authenc_request_complete(req, err);
276 static int crypto_authenc_decrypt(struct aead_request *req)
278 struct crypto_aead *authenc = crypto_aead_reqtfm(req);
284 struct authenc_request_ctx *areq_ctx = aead_request_ctx(req);
293 ahash_request_set_crypt(ahreq, req->src, hash,
294 req->assoclen + req->cryptlen - authsize);
295 ahash_request_set_callback(ahreq, aead_request_flags(req),
296 authenc_verify_ahash_done, req);
302 return crypto_authenc_decrypt_tail(req, aead_request_flags(req));