Lines Matching refs:req

140 static int lrw_xor_tweak(struct skcipher_request *req, bool second_pass)
143 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
145 struct lrw_request_ctx *rctx = skcipher_request_ctx(req);
153 req = &rctx->subreq;
155 skcipher_request_set_tfm(req, tfm);
158 err = skcipher_walk_virt(&w, req, false);
198 static int lrw_xor_tweak_pre(struct skcipher_request *req)
200 return lrw_xor_tweak(req, false);
203 static int lrw_xor_tweak_post(struct skcipher_request *req)
205 return lrw_xor_tweak(req, true);
210 struct skcipher_request *req = areq->data;
213 struct lrw_request_ctx *rctx = skcipher_request_ctx(req);
216 err = lrw_xor_tweak_post(req);
219 skcipher_request_complete(req, err);
222 static void lrw_init_crypt(struct skcipher_request *req)
225 crypto_skcipher_ctx(crypto_skcipher_reqtfm(req));
226 struct lrw_request_ctx *rctx = skcipher_request_ctx(req);
230 skcipher_request_set_callback(subreq, req->base.flags, lrw_crypt_done,
231 req);
232 /* pass req->iv as IV (will be used by xor_tweak, ECB will ignore it) */
233 skcipher_request_set_crypt(subreq, req->dst, req->dst,
234 req->cryptlen, req->iv);
237 memcpy(&rctx->t, req->iv, sizeof(rctx->t));
243 static int lrw_encrypt(struct skcipher_request *req)
245 struct lrw_request_ctx *rctx = skcipher_request_ctx(req);
248 lrw_init_crypt(req);
249 return lrw_xor_tweak_pre(req) ?:
251 lrw_xor_tweak_post(req);
254 static int lrw_decrypt(struct skcipher_request *req)
256 struct lrw_request_ctx *rctx = skcipher_request_ctx(req);
259 lrw_init_crypt(req);
260 return lrw_xor_tweak_pre(req) ?:
262 lrw_xor_tweak_post(req);