Lines Matching refs:req

179 static int __maybe_unused ecb_encrypt(struct skcipher_request *req)
181 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
187 err = skcipher_walk_virt(&walk, req, false);
199 static int __maybe_unused ecb_decrypt(struct skcipher_request *req)
201 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
207 err = skcipher_walk_virt(&walk, req, false);
219 static int cbc_encrypt_walk(struct skcipher_request *req,
222 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
237 static int __maybe_unused cbc_encrypt(struct skcipher_request *req)
242 err = skcipher_walk_virt(&walk, req, false);
245 return cbc_encrypt_walk(req, &walk);
248 static int cbc_decrypt_walk(struct skcipher_request *req,
251 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
266 static int __maybe_unused cbc_decrypt(struct skcipher_request *req)
271 err = skcipher_walk_virt(&walk, req, false);
274 return cbc_decrypt_walk(req, &walk);
277 static int cts_cbc_encrypt(struct skcipher_request *req)
279 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
282 int cbc_blocks = DIV_ROUND_UP(req->cryptlen, AES_BLOCK_SIZE) - 2;
283 struct scatterlist *src = req->src, *dst = req->dst;
289 skcipher_request_set_callback(&subreq, skcipher_request_flags(req),
292 if (req->cryptlen <= AES_BLOCK_SIZE) {
293 if (req->cryptlen < AES_BLOCK_SIZE)
299 skcipher_request_set_crypt(&subreq, req->src, req->dst,
301 req->iv);
308 if (req->cryptlen == AES_BLOCK_SIZE)
311 dst = src = scatterwalk_ffwd(sg_src, req->src, subreq.cryptlen);
312 if (req->dst != req->src)
313 dst = scatterwalk_ffwd(sg_dst, req->dst,
319 req->cryptlen - cbc_blocks * AES_BLOCK_SIZE,
320 req->iv);
334 static int cts_cbc_decrypt(struct skcipher_request *req)
336 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
339 int cbc_blocks = DIV_ROUND_UP(req->cryptlen, AES_BLOCK_SIZE) - 2;
340 struct scatterlist *src = req->src, *dst = req->dst;
346 skcipher_request_set_callback(&subreq, skcipher_request_flags(req),
349 if (req->cryptlen <= AES_BLOCK_SIZE) {
350 if (req->cryptlen < AES_BLOCK_SIZE)
356 skcipher_request_set_crypt(&subreq, req->src, req->dst,
358 req->iv);
365 if (req->cryptlen == AES_BLOCK_SIZE)
368 dst = src = scatterwalk_ffwd(sg_src, req->src, subreq.cryptlen);
369 if (req->dst != req->src)
370 dst = scatterwalk_ffwd(sg_dst, req->dst,
376 req->cryptlen - cbc_blocks * AES_BLOCK_SIZE,
377 req->iv);
407 static int __maybe_unused essiv_cbc_encrypt(struct skcipher_request *req)
409 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
415 err = skcipher_walk_virt(&walk, req, false);
422 req->iv, ctx->key2.key_enc);
426 return err ?: cbc_encrypt_walk(req, &walk);
429 static int __maybe_unused essiv_cbc_decrypt(struct skcipher_request *req)
431 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
437 err = skcipher_walk_virt(&walk, req, false);
444 req->iv, ctx->key2.key_enc);
448 return err ?: cbc_decrypt_walk(req, &walk);
451 static int __maybe_unused xctr_encrypt(struct skcipher_request *req)
453 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
459 err = skcipher_walk_virt(&walk, req, false);
497 static int __maybe_unused ctr_encrypt(struct skcipher_request *req)
499 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
504 err = skcipher_walk_virt(&walk, req, false);
541 static int __maybe_unused xts_encrypt(struct skcipher_request *req)
543 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
546 int tail = req->cryptlen % AES_BLOCK_SIZE;
552 if (req->cryptlen < AES_BLOCK_SIZE)
555 err = skcipher_walk_virt(&walk, req, false);
558 int xts_blocks = DIV_ROUND_UP(req->cryptlen,
565 skcipher_request_flags(req),
567 skcipher_request_set_crypt(&subreq, req->src, req->dst,
569 req->iv);
570 req = &subreq;
571 err = skcipher_walk_virt(&walk, req, false);
593 dst = src = scatterwalk_ffwd(sg_src, req->src, req->cryptlen);
594 if (req->dst != req->src)
595 dst = scatterwalk_ffwd(sg_dst, req->dst, req->cryptlen);
597 skcipher_request_set_crypt(req, src, dst, AES_BLOCK_SIZE + tail,
598 req->iv);
613 static int __maybe_unused xts_decrypt(struct skcipher_request *req)
615 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
618 int tail = req->cryptlen % AES_BLOCK_SIZE;
624 if (req->cryptlen < AES_BLOCK_SIZE)
627 err = skcipher_walk_virt(&walk, req, false);
630 int xts_blocks = DIV_ROUND_UP(req->cryptlen,
637 skcipher_request_flags(req),
639 skcipher_request_set_crypt(&subreq, req->src, req->dst,
641 req->iv);
642 req = &subreq;
643 err = skcipher_walk_virt(&walk, req, false);
665 dst = src = scatterwalk_ffwd(sg_src, req->src, req->cryptlen);
666 if (req->dst != req->src)
667 dst = scatterwalk_ffwd(sg_dst, req->dst, req->cryptlen);
669 skcipher_request_set_crypt(req, src, dst, AES_BLOCK_SIZE + tail,
670 req->iv);