Lines Matching refs:req

94 static int __ecb_crypt(struct skcipher_request *req,
98 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
103 err = skcipher_walk_virt(&walk, req, false);
123 static int ecb_encrypt(struct skcipher_request *req)
125 return __ecb_crypt(req, aesbs_ecb_encrypt);
128 static int ecb_decrypt(struct skcipher_request *req)
130 return __ecb_crypt(req, aesbs_ecb_decrypt);
156 static int cbc_encrypt(struct skcipher_request *req)
158 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
163 err = skcipher_walk_virt(&walk, req, false);
179 static int cbc_decrypt(struct skcipher_request *req)
181 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
186 err = skcipher_walk_virt(&walk, req, false);
207 static int ctr_encrypt(struct skcipher_request *req)
209 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
214 err = skcipher_walk_virt(&walk, req, false);
276 static int __xts_crypt(struct skcipher_request *req, bool encrypt,
280 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
282 int tail = req->cryptlen % (8 * AES_BLOCK_SIZE);
291 if (req->cryptlen < AES_BLOCK_SIZE)
296 int xts_blocks = DIV_ROUND_UP(req->cryptlen,
301 skcipher_request_flags(req),
303 skcipher_request_set_crypt(&subreq, req->src, req->dst,
305 req->iv);
306 req = &subreq;
311 err = skcipher_walk_virt(&walk, req, false);
355 dst = src = scatterwalk_ffwd(sg_src, req->src, req->cryptlen);
356 if (req->dst != req->src)
357 dst = scatterwalk_ffwd(sg_dst, req->dst, req->cryptlen);
359 skcipher_request_set_crypt(req, src, dst, AES_BLOCK_SIZE + tail,
360 req->iv);
362 err = skcipher_walk_virt(&walk, req, false);
382 static int xts_encrypt(struct skcipher_request *req)
384 return __xts_crypt(req, true, aesbs_xts_encrypt);
387 static int xts_decrypt(struct skcipher_request *req)
389 return __xts_crypt(req, false, aesbs_xts_decrypt);