Lines Matching refs:req

97 static int __ecb_crypt(struct skcipher_request *req,
101 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
106 err = skcipher_walk_virt(&walk, req, false);
126 static int ecb_encrypt(struct skcipher_request *req)
128 return __ecb_crypt(req, aesbs_ecb_encrypt);
131 static int ecb_decrypt(struct skcipher_request *req)
133 return __ecb_crypt(req, aesbs_ecb_decrypt);
159 static int cbc_encrypt(struct skcipher_request *req)
161 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
166 err = skcipher_walk_virt(&walk, req, false);
182 static int cbc_decrypt(struct skcipher_request *req)
184 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
189 err = skcipher_walk_virt(&walk, req, false);
229 static int ctr_encrypt(struct skcipher_request *req)
231 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
237 err = skcipher_walk_virt(&walk, req, false);
310 static int ctr_encrypt_sync(struct skcipher_request *req)
313 return crypto_ctr_encrypt_walk(req, ctr_encrypt_one);
315 return ctr_encrypt(req);
318 static int __xts_crypt(struct skcipher_request *req, bool encrypt,
322 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
324 int tail = req->cryptlen % (8 * AES_BLOCK_SIZE);
333 if (req->cryptlen < AES_BLOCK_SIZE)
338 int xts_blocks = DIV_ROUND_UP(req->cryptlen,
343 skcipher_request_flags(req),
345 skcipher_request_set_crypt(&subreq, req->src, req->dst,
347 req->iv);
348 req = &subreq;
353 err = skcipher_walk_virt(&walk, req, false);
395 dst = src = scatterwalk_ffwd(sg_src, req->src, req->cryptlen);
396 if (req->dst != req->src)
397 dst = scatterwalk_ffwd(sg_dst, req->dst, req->cryptlen);
399 skcipher_request_set_crypt(req, src, dst, AES_BLOCK_SIZE + tail,
400 req->iv);
402 err = skcipher_walk_virt(&walk, req, false);
423 static int xts_encrypt(struct skcipher_request *req)
425 return __xts_crypt(req, true, aesbs_xts_encrypt);
428 static int xts_decrypt(struct skcipher_request *req)
430 return __xts_crypt(req, false, aesbs_xts_decrypt);