Lines Matching refs:req
160 struct crypto_async_request *req, *backlog; in cryptd_queue_worker() local
172 req = crypto_dequeue_request(&cpu_queue->queue); in cryptd_queue_worker()
176 if (!req) in cryptd_queue_worker()
181 req->complete(req, 0); in cryptd_queue_worker()
268 static void cryptd_skcipher_complete(struct skcipher_request *req, int err) in cryptd_skcipher_complete() argument
270 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in cryptd_skcipher_complete()
272 struct cryptd_skcipher_request_ctx *rctx = skcipher_request_ctx(req); in cryptd_skcipher_complete()
276 rctx->complete(&req->base, err); in cryptd_skcipher_complete()
286 struct skcipher_request *req = skcipher_request_cast(base); in cryptd_skcipher_encrypt() local
287 struct cryptd_skcipher_request_ctx *rctx = skcipher_request_ctx(req); in cryptd_skcipher_encrypt()
288 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in cryptd_skcipher_encrypt()
299 skcipher_request_set_crypt(subreq, req->src, req->dst, req->cryptlen, in cryptd_skcipher_encrypt()
300 req->iv); in cryptd_skcipher_encrypt()
305 req->base.complete = rctx->complete; in cryptd_skcipher_encrypt()
308 cryptd_skcipher_complete(req, err); in cryptd_skcipher_encrypt()
314 struct skcipher_request *req = skcipher_request_cast(base); in cryptd_skcipher_decrypt() local
315 struct cryptd_skcipher_request_ctx *rctx = skcipher_request_ctx(req); in cryptd_skcipher_decrypt()
316 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in cryptd_skcipher_decrypt()
327 skcipher_request_set_crypt(subreq, req->src, req->dst, req->cryptlen, in cryptd_skcipher_decrypt()
328 req->iv); in cryptd_skcipher_decrypt()
333 req->base.complete = rctx->complete; in cryptd_skcipher_decrypt()
336 cryptd_skcipher_complete(req, err); in cryptd_skcipher_decrypt()
339 static int cryptd_skcipher_enqueue(struct skcipher_request *req, in cryptd_skcipher_enqueue() argument
342 struct cryptd_skcipher_request_ctx *rctx = skcipher_request_ctx(req); in cryptd_skcipher_enqueue()
343 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in cryptd_skcipher_enqueue()
347 rctx->complete = req->base.complete; in cryptd_skcipher_enqueue()
348 req->base.complete = compl; in cryptd_skcipher_enqueue()
350 return cryptd_enqueue_request(queue, &req->base); in cryptd_skcipher_enqueue()
353 static int cryptd_skcipher_encrypt_enqueue(struct skcipher_request *req) in cryptd_skcipher_encrypt_enqueue() argument
355 return cryptd_skcipher_enqueue(req, cryptd_skcipher_encrypt); in cryptd_skcipher_encrypt_enqueue()
358 static int cryptd_skcipher_decrypt_enqueue(struct skcipher_request *req) in cryptd_skcipher_decrypt_enqueue() argument
360 return cryptd_skcipher_enqueue(req, cryptd_skcipher_decrypt); in cryptd_skcipher_decrypt_enqueue()
505 static int cryptd_hash_enqueue(struct ahash_request *req, in cryptd_hash_enqueue() argument
508 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_enqueue()
509 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_enqueue()
513 rctx->complete = req->base.complete; in cryptd_hash_enqueue()
514 req->base.complete = compl; in cryptd_hash_enqueue()
516 return cryptd_enqueue_request(queue, &req->base); in cryptd_hash_enqueue()
519 static void cryptd_hash_complete(struct ahash_request *req, int err) in cryptd_hash_complete() argument
521 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_complete()
523 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_complete()
527 rctx->complete(&req->base, err); in cryptd_hash_complete()
538 struct ahash_request *req = ahash_request_cast(req_async); in cryptd_hash_init() local
539 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_init()
549 req->base.complete = rctx->complete; in cryptd_hash_init()
552 cryptd_hash_complete(req, err); in cryptd_hash_init()
555 static int cryptd_hash_init_enqueue(struct ahash_request *req) in cryptd_hash_init_enqueue() argument
557 return cryptd_hash_enqueue(req, cryptd_hash_init); in cryptd_hash_init_enqueue()
562 struct ahash_request *req = ahash_request_cast(req_async); in cryptd_hash_update() local
565 rctx = ahash_request_ctx(req); in cryptd_hash_update()
570 err = shash_ahash_update(req, &rctx->desc); in cryptd_hash_update()
572 req->base.complete = rctx->complete; in cryptd_hash_update()
575 cryptd_hash_complete(req, err); in cryptd_hash_update()
578 static int cryptd_hash_update_enqueue(struct ahash_request *req) in cryptd_hash_update_enqueue() argument
580 return cryptd_hash_enqueue(req, cryptd_hash_update); in cryptd_hash_update_enqueue()
585 struct ahash_request *req = ahash_request_cast(req_async); in cryptd_hash_final() local
586 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_final()
591 err = crypto_shash_final(&rctx->desc, req->result); in cryptd_hash_final()
593 req->base.complete = rctx->complete; in cryptd_hash_final()
596 cryptd_hash_complete(req, err); in cryptd_hash_final()
599 static int cryptd_hash_final_enqueue(struct ahash_request *req) in cryptd_hash_final_enqueue() argument
601 return cryptd_hash_enqueue(req, cryptd_hash_final); in cryptd_hash_final_enqueue()
606 struct ahash_request *req = ahash_request_cast(req_async); in cryptd_hash_finup() local
607 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_finup()
612 err = shash_ahash_finup(req, &rctx->desc); in cryptd_hash_finup()
614 req->base.complete = rctx->complete; in cryptd_hash_finup()
617 cryptd_hash_complete(req, err); in cryptd_hash_finup()
620 static int cryptd_hash_finup_enqueue(struct ahash_request *req) in cryptd_hash_finup_enqueue() argument
622 return cryptd_hash_enqueue(req, cryptd_hash_finup); in cryptd_hash_finup_enqueue()
629 struct ahash_request *req = ahash_request_cast(req_async); in cryptd_hash_digest() local
630 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_digest()
638 err = shash_ahash_digest(req, desc); in cryptd_hash_digest()
640 req->base.complete = rctx->complete; in cryptd_hash_digest()
643 cryptd_hash_complete(req, err); in cryptd_hash_digest()
646 static int cryptd_hash_digest_enqueue(struct ahash_request *req) in cryptd_hash_digest_enqueue() argument
648 return cryptd_hash_enqueue(req, cryptd_hash_digest); in cryptd_hash_digest_enqueue()
651 static int cryptd_hash_export(struct ahash_request *req, void *out) in cryptd_hash_export() argument
653 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_export()
658 static int cryptd_hash_import(struct ahash_request *req, const void *in) in cryptd_hash_import() argument
660 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_import()
662 struct shash_desc *desc = cryptd_shash_desc(req); in cryptd_hash_import()
752 static void cryptd_aead_crypt(struct aead_request *req, in cryptd_aead_crypt() argument
755 int (*crypt)(struct aead_request *req)) in cryptd_aead_crypt() argument
763 rctx = aead_request_ctx(req); in cryptd_aead_crypt()
766 tfm = crypto_aead_reqtfm(req); in cryptd_aead_crypt()
770 aead_request_set_tfm(req, child); in cryptd_aead_crypt()
771 err = crypt( req ); in cryptd_aead_crypt()
778 compl(&req->base, err); in cryptd_aead_crypt()
789 struct aead_request *req; in cryptd_aead_encrypt() local
791 req = container_of(areq, struct aead_request, base); in cryptd_aead_encrypt()
792 cryptd_aead_crypt(req, child, err, crypto_aead_alg(child)->encrypt); in cryptd_aead_encrypt()
799 struct aead_request *req; in cryptd_aead_decrypt() local
801 req = container_of(areq, struct aead_request, base); in cryptd_aead_decrypt()
802 cryptd_aead_crypt(req, child, err, crypto_aead_alg(child)->decrypt); in cryptd_aead_decrypt()
805 static int cryptd_aead_enqueue(struct aead_request *req, in cryptd_aead_enqueue() argument
808 struct cryptd_aead_request_ctx *rctx = aead_request_ctx(req); in cryptd_aead_enqueue()
809 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in cryptd_aead_enqueue()
812 rctx->complete = req->base.complete; in cryptd_aead_enqueue()
813 req->base.complete = compl; in cryptd_aead_enqueue()
814 return cryptd_enqueue_request(queue, &req->base); in cryptd_aead_enqueue()
817 static int cryptd_aead_encrypt_enqueue(struct aead_request *req) in cryptd_aead_encrypt_enqueue() argument
819 return cryptd_aead_enqueue(req, cryptd_aead_encrypt ); in cryptd_aead_encrypt_enqueue()
822 static int cryptd_aead_decrypt_enqueue(struct aead_request *req) in cryptd_aead_decrypt_enqueue() argument
824 return cryptd_aead_enqueue(req, cryptd_aead_decrypt ); in cryptd_aead_decrypt_enqueue()
1046 struct shash_desc *cryptd_shash_desc(struct ahash_request *req) in cryptd_shash_desc() argument
1048 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_shash_desc()