Lines Matching refs:req
76 struct skcipher_request req; member
96 struct aead_request req; member
169 struct crypto_async_request *req, *backlog; in cryptd_queue_worker() local
178 req = crypto_dequeue_request(&cpu_queue->queue); in cryptd_queue_worker()
182 if (!req) in cryptd_queue_worker()
187 crypto_request_complete(req, 0); in cryptd_queue_worker()
247 struct skcipher_request *req, int err) in cryptd_skcipher_prepare() argument
249 struct cryptd_skcipher_request_ctx *rctx = skcipher_request_ctx(req); in cryptd_skcipher_prepare()
250 struct skcipher_request *subreq = &rctx->req; in cryptd_skcipher_prepare()
254 req->base.complete = subreq->base.complete; in cryptd_skcipher_prepare()
255 req->base.data = subreq->base.data; in cryptd_skcipher_prepare()
260 ctx = crypto_skcipher_ctx(crypto_skcipher_reqtfm(req)); in cryptd_skcipher_prepare()
266 skcipher_request_set_crypt(subreq, req->src, req->dst, req->cryptlen, in cryptd_skcipher_prepare()
267 req->iv); in cryptd_skcipher_prepare()
272 static void cryptd_skcipher_complete(struct skcipher_request *req, int err, in cryptd_skcipher_complete() argument
275 struct cryptd_skcipher_request_ctx *rctx = skcipher_request_ctx(req); in cryptd_skcipher_complete()
276 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in cryptd_skcipher_complete()
278 struct skcipher_request *subreq = &rctx->req; in cryptd_skcipher_complete()
282 skcipher_request_complete(req, err); in cryptd_skcipher_complete()
286 subreq->base.complete = req->base.complete; in cryptd_skcipher_complete()
287 subreq->base.data = req->base.data; in cryptd_skcipher_complete()
288 req->base.complete = complete; in cryptd_skcipher_complete()
289 req->base.data = req; in cryptd_skcipher_complete()
296 struct skcipher_request *req = data; in cryptd_skcipher_encrypt() local
299 subreq = cryptd_skcipher_prepare(req, err); in cryptd_skcipher_encrypt()
303 cryptd_skcipher_complete(req, err, cryptd_skcipher_encrypt); in cryptd_skcipher_encrypt()
308 struct skcipher_request *req = data; in cryptd_skcipher_decrypt() local
311 subreq = cryptd_skcipher_prepare(req, err); in cryptd_skcipher_decrypt()
315 cryptd_skcipher_complete(req, err, cryptd_skcipher_decrypt); in cryptd_skcipher_decrypt()
318 static int cryptd_skcipher_enqueue(struct skcipher_request *req, in cryptd_skcipher_enqueue() argument
321 struct cryptd_skcipher_request_ctx *rctx = skcipher_request_ctx(req); in cryptd_skcipher_enqueue()
322 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in cryptd_skcipher_enqueue()
323 struct skcipher_request *subreq = &rctx->req; in cryptd_skcipher_enqueue()
327 subreq->base.complete = req->base.complete; in cryptd_skcipher_enqueue()
328 subreq->base.data = req->base.data; in cryptd_skcipher_enqueue()
329 req->base.complete = compl; in cryptd_skcipher_enqueue()
330 req->base.data = req; in cryptd_skcipher_enqueue()
332 return cryptd_enqueue_request(queue, &req->base); in cryptd_skcipher_enqueue()
335 static int cryptd_skcipher_encrypt_enqueue(struct skcipher_request *req) in cryptd_skcipher_encrypt_enqueue() argument
337 return cryptd_skcipher_enqueue(req, cryptd_skcipher_encrypt); in cryptd_skcipher_encrypt_enqueue()
340 static int cryptd_skcipher_decrypt_enqueue(struct skcipher_request *req) in cryptd_skcipher_decrypt_enqueue() argument
342 return cryptd_skcipher_enqueue(req, cryptd_skcipher_decrypt); in cryptd_skcipher_decrypt_enqueue()
489 static int cryptd_hash_enqueue(struct ahash_request *req, in cryptd_hash_enqueue() argument
492 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_enqueue()
493 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_enqueue()
497 rctx->complete = req->base.complete; in cryptd_hash_enqueue()
498 rctx->data = req->base.data; in cryptd_hash_enqueue()
499 req->base.complete = compl; in cryptd_hash_enqueue()
500 req->base.data = req; in cryptd_hash_enqueue()
502 return cryptd_enqueue_request(queue, &req->base); in cryptd_hash_enqueue()
505 static struct shash_desc *cryptd_hash_prepare(struct ahash_request *req, in cryptd_hash_prepare() argument
508 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_prepare()
510 req->base.complete = rctx->complete; in cryptd_hash_prepare()
511 req->base.data = rctx->data; in cryptd_hash_prepare()
519 static void cryptd_hash_complete(struct ahash_request *req, int err, in cryptd_hash_complete() argument
522 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_complete()
527 ahash_request_complete(req, err); in cryptd_hash_complete()
531 req->base.complete = complete; in cryptd_hash_complete()
532 req->base.data = req; in cryptd_hash_complete()
539 struct ahash_request *req = data; in cryptd_hash_init() local
540 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_init()
545 desc = cryptd_hash_prepare(req, err); in cryptd_hash_init()
554 cryptd_hash_complete(req, err, cryptd_hash_init); in cryptd_hash_init()
557 static int cryptd_hash_init_enqueue(struct ahash_request *req) in cryptd_hash_init_enqueue() argument
559 return cryptd_hash_enqueue(req, cryptd_hash_init); in cryptd_hash_init_enqueue()
564 struct ahash_request *req = data; in cryptd_hash_update() local
567 desc = cryptd_hash_prepare(req, err); in cryptd_hash_update()
569 err = shash_ahash_update(req, desc); in cryptd_hash_update()
571 cryptd_hash_complete(req, err, cryptd_hash_update); in cryptd_hash_update()
574 static int cryptd_hash_update_enqueue(struct ahash_request *req) in cryptd_hash_update_enqueue() argument
576 return cryptd_hash_enqueue(req, cryptd_hash_update); in cryptd_hash_update_enqueue()
581 struct ahash_request *req = data; in cryptd_hash_final() local
584 desc = cryptd_hash_prepare(req, err); in cryptd_hash_final()
586 err = crypto_shash_final(desc, req->result); in cryptd_hash_final()
588 cryptd_hash_complete(req, err, cryptd_hash_final); in cryptd_hash_final()
591 static int cryptd_hash_final_enqueue(struct ahash_request *req) in cryptd_hash_final_enqueue() argument
593 return cryptd_hash_enqueue(req, cryptd_hash_final); in cryptd_hash_final_enqueue()
598 struct ahash_request *req = data; in cryptd_hash_finup() local
601 desc = cryptd_hash_prepare(req, err); in cryptd_hash_finup()
603 err = shash_ahash_finup(req, desc); in cryptd_hash_finup()
605 cryptd_hash_complete(req, err, cryptd_hash_finup); in cryptd_hash_finup()
608 static int cryptd_hash_finup_enqueue(struct ahash_request *req) in cryptd_hash_finup_enqueue() argument
610 return cryptd_hash_enqueue(req, cryptd_hash_finup); in cryptd_hash_finup_enqueue()
615 struct ahash_request *req = data; in cryptd_hash_digest() local
616 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_digest()
621 desc = cryptd_hash_prepare(req, err); in cryptd_hash_digest()
627 err = shash_ahash_digest(req, desc); in cryptd_hash_digest()
630 cryptd_hash_complete(req, err, cryptd_hash_digest); in cryptd_hash_digest()
633 static int cryptd_hash_digest_enqueue(struct ahash_request *req) in cryptd_hash_digest_enqueue() argument
635 return cryptd_hash_enqueue(req, cryptd_hash_digest); in cryptd_hash_digest_enqueue()
638 static int cryptd_hash_export(struct ahash_request *req, void *out) in cryptd_hash_export() argument
640 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_export()
645 static int cryptd_hash_import(struct ahash_request *req, const void *in) in cryptd_hash_import() argument
647 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_import()
649 struct shash_desc *desc = cryptd_shash_desc(req); in cryptd_hash_import()
743 static void cryptd_aead_crypt(struct aead_request *req, in cryptd_aead_crypt() argument
745 int (*crypt)(struct aead_request *req), in cryptd_aead_crypt() argument
754 rctx = aead_request_ctx(req); in cryptd_aead_crypt()
755 subreq = &rctx->req; in cryptd_aead_crypt()
756 req->base.complete = subreq->base.complete; in cryptd_aead_crypt()
757 req->base.data = subreq->base.data; in cryptd_aead_crypt()
759 tfm = crypto_aead_reqtfm(req); in cryptd_aead_crypt()
767 aead_request_set_crypt(subreq, req->src, req->dst, req->cryptlen, in cryptd_aead_crypt()
768 req->iv); in cryptd_aead_crypt()
769 aead_request_set_ad(subreq, req->assoclen); in cryptd_aead_crypt()
778 aead_request_complete(req, err); in cryptd_aead_crypt()
782 subreq->base.complete = req->base.complete; in cryptd_aead_crypt()
783 subreq->base.data = req->base.data; in cryptd_aead_crypt()
784 req->base.complete = compl; in cryptd_aead_crypt()
785 req->base.data = req; in cryptd_aead_crypt()
792 struct aead_request *req = data; in cryptd_aead_encrypt() local
796 ctx = crypto_aead_ctx(crypto_aead_reqtfm(req)); in cryptd_aead_encrypt()
798 cryptd_aead_crypt(req, child, err, crypto_aead_alg(child)->encrypt, in cryptd_aead_encrypt()
804 struct aead_request *req = data; in cryptd_aead_decrypt() local
808 ctx = crypto_aead_ctx(crypto_aead_reqtfm(req)); in cryptd_aead_decrypt()
810 cryptd_aead_crypt(req, child, err, crypto_aead_alg(child)->decrypt, in cryptd_aead_decrypt()
814 static int cryptd_aead_enqueue(struct aead_request *req, in cryptd_aead_enqueue() argument
817 struct cryptd_aead_request_ctx *rctx = aead_request_ctx(req); in cryptd_aead_enqueue()
818 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in cryptd_aead_enqueue()
820 struct aead_request *subreq = &rctx->req; in cryptd_aead_enqueue()
822 subreq->base.complete = req->base.complete; in cryptd_aead_enqueue()
823 subreq->base.data = req->base.data; in cryptd_aead_enqueue()
824 req->base.complete = compl; in cryptd_aead_enqueue()
825 req->base.data = req; in cryptd_aead_enqueue()
826 return cryptd_enqueue_request(queue, &req->base); in cryptd_aead_enqueue()
829 static int cryptd_aead_encrypt_enqueue(struct aead_request *req) in cryptd_aead_encrypt_enqueue() argument
831 return cryptd_aead_enqueue(req, cryptd_aead_encrypt ); in cryptd_aead_encrypt_enqueue()
834 static int cryptd_aead_decrypt_enqueue(struct aead_request *req) in cryptd_aead_decrypt_enqueue() argument
836 return cryptd_aead_enqueue(req, cryptd_aead_decrypt ); in cryptd_aead_decrypt_enqueue()
1040 struct shash_desc *cryptd_shash_desc(struct ahash_request *req) in cryptd_shash_desc() argument
1042 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_shash_desc()