Lines Matching refs:req
137 struct crypto_async_request *req, *backlog; in cryptd_queue_worker() local
149 req = crypto_dequeue_request(&cpu_queue->queue); in cryptd_queue_worker()
153 if (!req) in cryptd_queue_worker()
158 req->complete(req, 0); in cryptd_queue_worker()
200 static void cryptd_blkcipher_crypt(struct ablkcipher_request *req, in cryptd_blkcipher_crypt() argument
211 rctx = ablkcipher_request_ctx(req); in cryptd_blkcipher_crypt()
217 desc.info = req->info; in cryptd_blkcipher_crypt()
220 err = crypt(&desc, req->dst, req->src, req->nbytes); in cryptd_blkcipher_crypt()
222 req->base.complete = rctx->complete; in cryptd_blkcipher_crypt()
226 rctx->complete(&req->base, err); in cryptd_blkcipher_crypt()
230 static void cryptd_blkcipher_encrypt(struct crypto_async_request *req, int err) in cryptd_blkcipher_encrypt() argument
232 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(req->tfm); in cryptd_blkcipher_encrypt()
235 cryptd_blkcipher_crypt(ablkcipher_request_cast(req), child, err, in cryptd_blkcipher_encrypt()
239 static void cryptd_blkcipher_decrypt(struct crypto_async_request *req, int err) in cryptd_blkcipher_decrypt() argument
241 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(req->tfm); in cryptd_blkcipher_decrypt()
244 cryptd_blkcipher_crypt(ablkcipher_request_cast(req), child, err, in cryptd_blkcipher_decrypt()
248 static int cryptd_blkcipher_enqueue(struct ablkcipher_request *req, in cryptd_blkcipher_enqueue() argument
251 struct cryptd_blkcipher_request_ctx *rctx = ablkcipher_request_ctx(req); in cryptd_blkcipher_enqueue()
252 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); in cryptd_blkcipher_enqueue()
256 rctx->complete = req->base.complete; in cryptd_blkcipher_enqueue()
257 req->base.complete = compl; in cryptd_blkcipher_enqueue()
259 return cryptd_enqueue_request(queue, &req->base); in cryptd_blkcipher_enqueue()
262 static int cryptd_blkcipher_encrypt_enqueue(struct ablkcipher_request *req) in cryptd_blkcipher_encrypt_enqueue() argument
264 return cryptd_blkcipher_enqueue(req, cryptd_blkcipher_encrypt); in cryptd_blkcipher_encrypt_enqueue()
267 static int cryptd_blkcipher_decrypt_enqueue(struct ablkcipher_request *req) in cryptd_blkcipher_decrypt_enqueue() argument
269 return cryptd_blkcipher_enqueue(req, cryptd_blkcipher_decrypt); in cryptd_blkcipher_decrypt_enqueue()
445 static int cryptd_hash_enqueue(struct ahash_request *req, in cryptd_hash_enqueue() argument
448 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_enqueue()
449 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_enqueue()
453 rctx->complete = req->base.complete; in cryptd_hash_enqueue()
454 req->base.complete = compl; in cryptd_hash_enqueue()
456 return cryptd_enqueue_request(queue, &req->base); in cryptd_hash_enqueue()
463 struct ahash_request *req = ahash_request_cast(req_async); in cryptd_hash_init() local
464 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_init()
475 req->base.complete = rctx->complete; in cryptd_hash_init()
479 rctx->complete(&req->base, err); in cryptd_hash_init()
483 static int cryptd_hash_init_enqueue(struct ahash_request *req) in cryptd_hash_init_enqueue() argument
485 return cryptd_hash_enqueue(req, cryptd_hash_init); in cryptd_hash_init_enqueue()
490 struct ahash_request *req = ahash_request_cast(req_async); in cryptd_hash_update() local
493 rctx = ahash_request_ctx(req); in cryptd_hash_update()
498 err = shash_ahash_update(req, &rctx->desc); in cryptd_hash_update()
500 req->base.complete = rctx->complete; in cryptd_hash_update()
504 rctx->complete(&req->base, err); in cryptd_hash_update()
508 static int cryptd_hash_update_enqueue(struct ahash_request *req) in cryptd_hash_update_enqueue() argument
510 return cryptd_hash_enqueue(req, cryptd_hash_update); in cryptd_hash_update_enqueue()
515 struct ahash_request *req = ahash_request_cast(req_async); in cryptd_hash_final() local
516 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_final()
521 err = crypto_shash_final(&rctx->desc, req->result); in cryptd_hash_final()
523 req->base.complete = rctx->complete; in cryptd_hash_final()
527 rctx->complete(&req->base, err); in cryptd_hash_final()
531 static int cryptd_hash_final_enqueue(struct ahash_request *req) in cryptd_hash_final_enqueue() argument
533 return cryptd_hash_enqueue(req, cryptd_hash_final); in cryptd_hash_final_enqueue()
538 struct ahash_request *req = ahash_request_cast(req_async); in cryptd_hash_finup() local
539 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_finup()
544 err = shash_ahash_finup(req, &rctx->desc); in cryptd_hash_finup()
546 req->base.complete = rctx->complete; in cryptd_hash_finup()
550 rctx->complete(&req->base, err); in cryptd_hash_finup()
554 static int cryptd_hash_finup_enqueue(struct ahash_request *req) in cryptd_hash_finup_enqueue() argument
556 return cryptd_hash_enqueue(req, cryptd_hash_finup); in cryptd_hash_finup_enqueue()
563 struct ahash_request *req = ahash_request_cast(req_async); in cryptd_hash_digest() local
564 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_digest()
573 err = shash_ahash_digest(req, desc); in cryptd_hash_digest()
575 req->base.complete = rctx->complete; in cryptd_hash_digest()
579 rctx->complete(&req->base, err); in cryptd_hash_digest()
583 static int cryptd_hash_digest_enqueue(struct ahash_request *req) in cryptd_hash_digest_enqueue() argument
585 return cryptd_hash_enqueue(req, cryptd_hash_digest); in cryptd_hash_digest_enqueue()
588 static int cryptd_hash_export(struct ahash_request *req, void *out) in cryptd_hash_export() argument
590 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_export()
595 static int cryptd_hash_import(struct ahash_request *req, const void *in) in cryptd_hash_import() argument
597 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_import()
684 static void cryptd_aead_crypt(struct aead_request *req, in cryptd_aead_crypt() argument
687 int (*crypt)(struct aead_request *req)) in cryptd_aead_crypt() argument
692 rctx = aead_request_ctx(req); in cryptd_aead_crypt()
697 aead_request_set_tfm(req, child); in cryptd_aead_crypt()
698 err = crypt( req ); in cryptd_aead_crypt()
701 compl(&req->base, err); in cryptd_aead_crypt()
709 struct aead_request *req; in cryptd_aead_encrypt() local
711 req = container_of(areq, struct aead_request, base); in cryptd_aead_encrypt()
712 cryptd_aead_crypt(req, child, err, crypto_aead_alg(child)->encrypt); in cryptd_aead_encrypt()
719 struct aead_request *req; in cryptd_aead_decrypt() local
721 req = container_of(areq, struct aead_request, base); in cryptd_aead_decrypt()
722 cryptd_aead_crypt(req, child, err, crypto_aead_alg(child)->decrypt); in cryptd_aead_decrypt()
725 static int cryptd_aead_enqueue(struct aead_request *req, in cryptd_aead_enqueue() argument
728 struct cryptd_aead_request_ctx *rctx = aead_request_ctx(req); in cryptd_aead_enqueue()
729 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in cryptd_aead_enqueue()
732 rctx->complete = req->base.complete; in cryptd_aead_enqueue()
733 req->base.complete = compl; in cryptd_aead_enqueue()
734 return cryptd_enqueue_request(queue, &req->base); in cryptd_aead_enqueue()
737 static int cryptd_aead_encrypt_enqueue(struct aead_request *req) in cryptd_aead_encrypt_enqueue() argument
739 return cryptd_aead_enqueue(req, cryptd_aead_encrypt ); in cryptd_aead_encrypt_enqueue()
742 static int cryptd_aead_decrypt_enqueue(struct aead_request *req) in cryptd_aead_decrypt_enqueue() argument
744 return cryptd_aead_enqueue(req, cryptd_aead_decrypt ); in cryptd_aead_decrypt_enqueue()
948 struct shash_desc *cryptd_shash_desc(struct ahash_request *req) in cryptd_shash_desc() argument
950 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_shash_desc()