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()
201 static void cryptd_blkcipher_crypt(struct ablkcipher_request *req, in cryptd_blkcipher_crypt() argument
212 rctx = ablkcipher_request_ctx(req); in cryptd_blkcipher_crypt()
218 desc.info = req->info; in cryptd_blkcipher_crypt()
221 err = crypt(&desc, req->dst, req->src, req->nbytes); in cryptd_blkcipher_crypt()
223 req->base.complete = rctx->complete; in cryptd_blkcipher_crypt()
227 rctx->complete(&req->base, err); in cryptd_blkcipher_crypt()
231 static void cryptd_blkcipher_encrypt(struct crypto_async_request *req, int err) in cryptd_blkcipher_encrypt() argument
233 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(req->tfm); in cryptd_blkcipher_encrypt()
236 cryptd_blkcipher_crypt(ablkcipher_request_cast(req), child, err, in cryptd_blkcipher_encrypt()
240 static void cryptd_blkcipher_decrypt(struct crypto_async_request *req, int err) in cryptd_blkcipher_decrypt() argument
242 struct cryptd_blkcipher_ctx *ctx = crypto_tfm_ctx(req->tfm); in cryptd_blkcipher_decrypt()
245 cryptd_blkcipher_crypt(ablkcipher_request_cast(req), child, err, in cryptd_blkcipher_decrypt()
249 static int cryptd_blkcipher_enqueue(struct ablkcipher_request *req, in cryptd_blkcipher_enqueue() argument
252 struct cryptd_blkcipher_request_ctx *rctx = ablkcipher_request_ctx(req); in cryptd_blkcipher_enqueue()
253 struct crypto_ablkcipher *tfm = crypto_ablkcipher_reqtfm(req); in cryptd_blkcipher_enqueue()
257 rctx->complete = req->base.complete; in cryptd_blkcipher_enqueue()
258 req->base.complete = compl; in cryptd_blkcipher_enqueue()
260 return cryptd_enqueue_request(queue, &req->base); in cryptd_blkcipher_enqueue()
263 static int cryptd_blkcipher_encrypt_enqueue(struct ablkcipher_request *req) in cryptd_blkcipher_encrypt_enqueue() argument
265 return cryptd_blkcipher_enqueue(req, cryptd_blkcipher_encrypt); in cryptd_blkcipher_encrypt_enqueue()
268 static int cryptd_blkcipher_decrypt_enqueue(struct ablkcipher_request *req) in cryptd_blkcipher_decrypt_enqueue() argument
270 return cryptd_blkcipher_enqueue(req, cryptd_blkcipher_decrypt); in cryptd_blkcipher_decrypt_enqueue()
436 static int cryptd_hash_enqueue(struct ahash_request *req, in cryptd_hash_enqueue() argument
439 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_enqueue()
440 struct crypto_ahash *tfm = crypto_ahash_reqtfm(req); in cryptd_hash_enqueue()
444 rctx->complete = req->base.complete; in cryptd_hash_enqueue()
445 req->base.complete = compl; in cryptd_hash_enqueue()
447 return cryptd_enqueue_request(queue, &req->base); in cryptd_hash_enqueue()
454 struct ahash_request *req = ahash_request_cast(req_async); in cryptd_hash_init() local
455 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_init()
466 req->base.complete = rctx->complete; in cryptd_hash_init()
470 rctx->complete(&req->base, err); in cryptd_hash_init()
474 static int cryptd_hash_init_enqueue(struct ahash_request *req) in cryptd_hash_init_enqueue() argument
476 return cryptd_hash_enqueue(req, cryptd_hash_init); in cryptd_hash_init_enqueue()
481 struct ahash_request *req = ahash_request_cast(req_async); in cryptd_hash_update() local
484 rctx = ahash_request_ctx(req); in cryptd_hash_update()
489 err = shash_ahash_update(req, &rctx->desc); in cryptd_hash_update()
491 req->base.complete = rctx->complete; in cryptd_hash_update()
495 rctx->complete(&req->base, err); in cryptd_hash_update()
499 static int cryptd_hash_update_enqueue(struct ahash_request *req) in cryptd_hash_update_enqueue() argument
501 return cryptd_hash_enqueue(req, cryptd_hash_update); in cryptd_hash_update_enqueue()
506 struct ahash_request *req = ahash_request_cast(req_async); in cryptd_hash_final() local
507 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_final()
512 err = crypto_shash_final(&rctx->desc, req->result); in cryptd_hash_final()
514 req->base.complete = rctx->complete; in cryptd_hash_final()
518 rctx->complete(&req->base, err); in cryptd_hash_final()
522 static int cryptd_hash_final_enqueue(struct ahash_request *req) in cryptd_hash_final_enqueue() argument
524 return cryptd_hash_enqueue(req, cryptd_hash_final); in cryptd_hash_final_enqueue()
529 struct ahash_request *req = ahash_request_cast(req_async); in cryptd_hash_finup() local
530 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_finup()
535 err = shash_ahash_finup(req, &rctx->desc); in cryptd_hash_finup()
537 req->base.complete = rctx->complete; in cryptd_hash_finup()
541 rctx->complete(&req->base, err); in cryptd_hash_finup()
545 static int cryptd_hash_finup_enqueue(struct ahash_request *req) in cryptd_hash_finup_enqueue() argument
547 return cryptd_hash_enqueue(req, cryptd_hash_finup); in cryptd_hash_finup_enqueue()
554 struct ahash_request *req = ahash_request_cast(req_async); in cryptd_hash_digest() local
555 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_digest()
564 err = shash_ahash_digest(req, desc); in cryptd_hash_digest()
566 req->base.complete = rctx->complete; in cryptd_hash_digest()
570 rctx->complete(&req->base, err); in cryptd_hash_digest()
574 static int cryptd_hash_digest_enqueue(struct ahash_request *req) in cryptd_hash_digest_enqueue() argument
576 return cryptd_hash_enqueue(req, cryptd_hash_digest); in cryptd_hash_digest_enqueue()
579 static int cryptd_hash_export(struct ahash_request *req, void *out) in cryptd_hash_export() argument
581 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_export()
586 static int cryptd_hash_import(struct ahash_request *req, const void *in) in cryptd_hash_import() argument
588 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_hash_import()
657 static void cryptd_aead_crypt(struct aead_request *req, in cryptd_aead_crypt() argument
660 int (*crypt)(struct aead_request *req)) in cryptd_aead_crypt() argument
663 rctx = aead_request_ctx(req); in cryptd_aead_crypt()
667 aead_request_set_tfm(req, child); in cryptd_aead_crypt()
668 err = crypt( req ); in cryptd_aead_crypt()
669 req->base.complete = rctx->complete; in cryptd_aead_crypt()
672 rctx->complete(&req->base, err); in cryptd_aead_crypt()
680 struct aead_request *req; in cryptd_aead_encrypt() local
682 req = container_of(areq, struct aead_request, base); in cryptd_aead_encrypt()
683 cryptd_aead_crypt(req, child, err, crypto_aead_crt(child)->encrypt); in cryptd_aead_encrypt()
690 struct aead_request *req; in cryptd_aead_decrypt() local
692 req = container_of(areq, struct aead_request, base); in cryptd_aead_decrypt()
693 cryptd_aead_crypt(req, child, err, crypto_aead_crt(child)->decrypt); in cryptd_aead_decrypt()
696 static int cryptd_aead_enqueue(struct aead_request *req, in cryptd_aead_enqueue() argument
699 struct cryptd_aead_request_ctx *rctx = aead_request_ctx(req); in cryptd_aead_enqueue()
700 struct crypto_aead *tfm = crypto_aead_reqtfm(req); in cryptd_aead_enqueue()
703 rctx->complete = req->base.complete; in cryptd_aead_enqueue()
704 req->base.complete = compl; in cryptd_aead_enqueue()
705 return cryptd_enqueue_request(queue, &req->base); in cryptd_aead_enqueue()
708 static int cryptd_aead_encrypt_enqueue(struct aead_request *req) in cryptd_aead_encrypt_enqueue() argument
710 return cryptd_aead_enqueue(req, cryptd_aead_encrypt ); in cryptd_aead_encrypt_enqueue()
713 static int cryptd_aead_decrypt_enqueue(struct aead_request *req) in cryptd_aead_decrypt_enqueue() argument
715 return cryptd_aead_enqueue(req, cryptd_aead_decrypt ); in cryptd_aead_decrypt_enqueue()
918 struct shash_desc *cryptd_shash_desc(struct ahash_request *req) in cryptd_shash_desc() argument
920 struct cryptd_hash_request_ctx *rctx = ahash_request_ctx(req); in cryptd_shash_desc()