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()
187 static void cryptd_blkcipher_crypt(struct ablkcipher_request *req, in cryptd_blkcipher_crypt() argument
198 rctx = ablkcipher_request_ctx(req); in cryptd_blkcipher_crypt()
204 desc.info = req->info; in cryptd_blkcipher_crypt()
207 err = crypt(&desc, req->dst, req->src, req->nbytes); in cryptd_blkcipher_crypt()
209 req->base.complete = rctx->complete; in cryptd_blkcipher_crypt()
213 rctx->complete(&req->base, err); in cryptd_blkcipher_crypt()
217 static void cryptd_blkcipher_encrypt(struct crypto_async_request *req, int err) in cryptd_blkcipher_encrypt() argument
219 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(req->tfm); in cryptd_blkcipher_encrypt()
222 cryptd_blkcipher_crypt(ablkcipher_request_cast(req), child, err, in cryptd_blkcipher_encrypt()
226 static void cryptd_blkcipher_decrypt(struct crypto_async_request *req, int err) in cryptd_blkcipher_decrypt() argument
228 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(req->tfm); in cryptd_blkcipher_decrypt()
231 cryptd_blkcipher_crypt(ablkcipher_request_cast(req), child, err, in cryptd_blkcipher_decrypt()
235 static int cryptd_blkcipher_enqueue(struct ablkcipher_request *req, in cryptd_blkcipher_enqueue() argument
238 struct cryptd_blkcipher_request_ctx *rctx = ablkcipher_request_ctx(req); in cryptd_blkcipher_enqueue()
239 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); in cryptd_blkcipher_enqueue()
243 rctx->complete = req->base.complete; in cryptd_blkcipher_enqueue()
244 req->base.complete = complete; in cryptd_blkcipher_enqueue()
246 return cryptd_enqueue_request(queue, &req->base); in cryptd_blkcipher_enqueue()
249 static int cryptd_blkcipher_encrypt_enqueue(struct ablkcipher_request *req) in cryptd_blkcipher_encrypt_enqueue() argument
251 return cryptd_blkcipher_enqueue(req, cryptd_blkcipher_encrypt); in cryptd_blkcipher_encrypt_enqueue()
254 static int cryptd_blkcipher_decrypt_enqueue(struct ablkcipher_request *req) in cryptd_blkcipher_decrypt_enqueue() argument
256 return cryptd_blkcipher_enqueue(req, cryptd_blkcipher_decrypt); in cryptd_blkcipher_decrypt_enqueue()
416 static int cryptd_hash_enqueue(struct ahash_request *req, in cryptd_hash_enqueue() argument
419 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_enqueue()
420 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_enqueue()
424 rctx->complete = req->base.complete; in cryptd_hash_enqueue()
425 req->base.complete = complete; in cryptd_hash_enqueue()
427 return cryptd_enqueue_request(queue, &req->base); in cryptd_hash_enqueue()
434 struct ahash_request *req = ahash_request_cast(req_async); in cryptd_hash_init() local
435 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_init()
446 req->base.complete = rctx->complete; in cryptd_hash_init()
450 rctx->complete(&req->base, err); in cryptd_hash_init()
454 static int cryptd_hash_init_enqueue(struct ahash_request *req) in cryptd_hash_init_enqueue() argument
456 return cryptd_hash_enqueue(req, cryptd_hash_init); in cryptd_hash_init_enqueue()
461 struct ahash_request *req = ahash_request_cast(req_async); in cryptd_hash_update() local
464 rctx = ahash_request_ctx(req); in cryptd_hash_update()
469 err = shash_ahash_update(req, &rctx->desc); in cryptd_hash_update()
471 req->base.complete = rctx->complete; in cryptd_hash_update()
475 rctx->complete(&req->base, err); in cryptd_hash_update()
479 static int cryptd_hash_update_enqueue(struct ahash_request *req) in cryptd_hash_update_enqueue() argument
481 return cryptd_hash_enqueue(req, cryptd_hash_update); in cryptd_hash_update_enqueue()
486 struct ahash_request *req = ahash_request_cast(req_async); in cryptd_hash_final() local
487 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_final()
492 err = crypto_shash_final(&rctx->desc, req->result); in cryptd_hash_final()
494 req->base.complete = rctx->complete; in cryptd_hash_final()
498 rctx->complete(&req->base, err); in cryptd_hash_final()
502 static int cryptd_hash_final_enqueue(struct ahash_request *req) in cryptd_hash_final_enqueue() argument
504 return cryptd_hash_enqueue(req, cryptd_hash_final); in cryptd_hash_final_enqueue()
509 struct ahash_request *req = ahash_request_cast(req_async); in cryptd_hash_finup() local
510 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_finup()
515 err = shash_ahash_finup(req, &rctx->desc); in cryptd_hash_finup()
517 req->base.complete = rctx->complete; in cryptd_hash_finup()
521 rctx->complete(&req->base, err); in cryptd_hash_finup()
525 static int cryptd_hash_finup_enqueue(struct ahash_request *req) in cryptd_hash_finup_enqueue() argument
527 return cryptd_hash_enqueue(req, cryptd_hash_finup); in cryptd_hash_finup_enqueue()
534 struct ahash_request *req = ahash_request_cast(req_async); in cryptd_hash_digest() local
535 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_digest()
544 err = shash_ahash_digest(req, desc); in cryptd_hash_digest()
546 req->base.complete = rctx->complete; in cryptd_hash_digest()
550 rctx->complete(&req->base, err); in cryptd_hash_digest()
554 static int cryptd_hash_digest_enqueue(struct ahash_request *req) in cryptd_hash_digest_enqueue() argument
556 return cryptd_hash_enqueue(req, cryptd_hash_digest); in cryptd_hash_digest_enqueue()
559 static int cryptd_hash_export(struct ahash_request *req, void *out) in cryptd_hash_export() argument
561 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_export()
566 static int cryptd_hash_import(struct ahash_request *req, const void *in) in cryptd_hash_import() argument
568 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_import()
630 static void cryptd_aead_crypt(struct aead_request *req, in cryptd_aead_crypt() argument
633 int (*crypt)(struct aead_request *req)) in cryptd_aead_crypt() argument
636 rctx = aead_request_ctx(req); in cryptd_aead_crypt()
640 aead_request_set_tfm(req, child); in cryptd_aead_crypt()
641 err = crypt( req ); in cryptd_aead_crypt()
642 req->base.complete = rctx->complete; in cryptd_aead_crypt()
645 rctx->complete(&req->base, err); in cryptd_aead_crypt()
653 struct aead_request *req; in cryptd_aead_encrypt() local
655 req = container_of(areq, struct aead_request, base); in cryptd_aead_encrypt()
656 cryptd_aead_crypt(req, child, err, crypto_aead_crt(child)->encrypt); in cryptd_aead_encrypt()
663 struct aead_request *req; in cryptd_aead_decrypt() local
665 req = container_of(areq, struct aead_request, base); in cryptd_aead_decrypt()
666 cryptd_aead_crypt(req, child, err, crypto_aead_crt(child)->decrypt); in cryptd_aead_decrypt()
669 static int cryptd_aead_enqueue(struct aead_request *req, in cryptd_aead_enqueue() argument
672 struct cryptd_aead_request_ctx *rctx = aead_request_ctx(req); in cryptd_aead_enqueue()
673 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in cryptd_aead_enqueue()
676 rctx->complete = req->base.complete; in cryptd_aead_enqueue()
677 req->base.complete = complete; in cryptd_aead_enqueue()
678 return cryptd_enqueue_request(queue, &req->base); in cryptd_aead_enqueue()
681 static int cryptd_aead_encrypt_enqueue(struct aead_request *req) in cryptd_aead_encrypt_enqueue() argument
683 return cryptd_aead_enqueue(req, cryptd_aead_encrypt ); in cryptd_aead_encrypt_enqueue()
686 static int cryptd_aead_decrypt_enqueue(struct aead_request *req) in cryptd_aead_decrypt_enqueue() argument
688 return cryptd_aead_enqueue(req, cryptd_aead_decrypt ); in cryptd_aead_decrypt_enqueue()
885 struct shash_desc *cryptd_shash_desc(struct ahash_request *req) in cryptd_shash_desc() argument
887 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_shash_desc()