Lines Matching defs:req
95 static int __ecb_crypt(struct skcipher_request *req,
99 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
104 err = skcipher_walk_virt(&walk, req, false);
124 static int ecb_encrypt(struct skcipher_request *req)
126 return __ecb_crypt(req, aesbs_ecb_encrypt);
129 static int ecb_decrypt(struct skcipher_request *req)
131 return __ecb_crypt(req, aesbs_ecb_decrypt);
157 static int cbc_encrypt(struct skcipher_request *req)
159 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
164 err = skcipher_walk_virt(&walk, req, false);
180 static int cbc_decrypt(struct skcipher_request *req)
182 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
187 err = skcipher_walk_virt(&walk, req, false);
208 static int ctr_encrypt(struct skcipher_request *req)
210 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
215 err = skcipher_walk_virt(&walk, req, false);
277 static int __xts_crypt(struct skcipher_request *req, bool encrypt,
281 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
283 int tail = req->cryptlen % (8 * AES_BLOCK_SIZE);
293 if (req->cryptlen < AES_BLOCK_SIZE)
298 int xts_blocks = DIV_ROUND_UP(req->cryptlen,
303 skcipher_request_flags(req),
305 skcipher_request_set_crypt(&subreq, req->src, req->dst,
307 req->iv);
308 req = &subreq;
313 err = skcipher_walk_virt(&walk, req, false);
357 dst = src = scatterwalk_ffwd(sg_src, req->src, req->cryptlen);
358 if (req->dst != req->src)
359 dst = scatterwalk_ffwd(sg_dst, req->dst, req->cryptlen);
361 skcipher_request_set_crypt(req, src, dst, AES_BLOCK_SIZE + tail,
362 req->iv);
364 err = skcipher_walk_virt(&walk, req, false);
384 static int xts_encrypt(struct skcipher_request *req)
386 return __xts_crypt(req, true, aesbs_xts_encrypt);
389 static int xts_decrypt(struct skcipher_request *req)
391 return __xts_crypt(req, false, aesbs_xts_decrypt);