Lines Matching refs:ctx
230 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(parent); in cryptd_skcipher_setkey() local
231 struct crypto_skcipher *child = ctx->child; in cryptd_skcipher_setkey()
243 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_complete() local
245 int refcnt = refcount_read(&ctx->refcnt); in cryptd_skcipher_complete()
251 if (err != -EINPROGRESS && refcnt && refcount_dec_and_test(&ctx->refcnt)) in cryptd_skcipher_complete()
261 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_encrypt() local
263 struct crypto_skcipher *child = ctx->child; in cryptd_skcipher_encrypt()
289 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_decrypt() local
291 struct crypto_skcipher *child = ctx->child; in cryptd_skcipher_decrypt()
340 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_init_tfm() local
347 ctx->child = cipher; in cryptd_skcipher_init_tfm()
356 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_exit_tfm() local
358 crypto_free_skcipher(ctx->child); in cryptd_skcipher_exit_tfm()
363 struct skcipherd_instance_ctx *ctx = skcipher_instance_ctx(inst); in cryptd_skcipher_free() local
365 crypto_drop_skcipher(&ctx->spawn); in cryptd_skcipher_free()
374 struct skcipherd_instance_ctx *ctx; in cryptd_create_skcipher() local
383 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in cryptd_create_skcipher()
387 ctx = skcipher_instance_ctx(inst); in cryptd_create_skcipher()
388 ctx->queue = queue; in cryptd_create_skcipher()
390 err = crypto_grab_skcipher(&ctx->spawn, skcipher_crypto_instance(inst), in cryptd_create_skcipher()
395 alg = crypto_spawn_skcipher_alg(&ctx->spawn); in cryptd_create_skcipher()
431 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_hash_init_tfm() local
438 ctx->child = hash; in cryptd_hash_init_tfm()
447 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(tfm); in cryptd_hash_exit_tfm() local
449 crypto_free_shash(ctx->child); in cryptd_hash_exit_tfm()
455 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(parent); in cryptd_hash_setkey() local
456 struct crypto_shash *child = ctx->child; in cryptd_hash_setkey()
481 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm); in cryptd_hash_complete() local
483 int refcnt = refcount_read(&ctx->refcnt); in cryptd_hash_complete()
489 if (err != -EINPROGRESS && refcnt && refcount_dec_and_test(&ctx->refcnt)) in cryptd_hash_complete()
495 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(req_async->tfm); in cryptd_hash_init() local
496 struct crypto_shash *child = ctx->child; in cryptd_hash_init()
586 struct cryptd_hash_ctx *ctx = crypto_tfm_ctx(req_async->tfm); in cryptd_hash_digest() local
587 struct crypto_shash *child = ctx->child; in cryptd_hash_digest()
620 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm); in cryptd_hash_import() local
623 desc->tfm = ctx->child; in cryptd_hash_import()
630 struct hashd_instance_ctx *ctx = ahash_instance_ctx(inst); in cryptd_hash_free() local
632 crypto_drop_shash(&ctx->spawn); in cryptd_hash_free()
640 struct hashd_instance_ctx *ctx; in cryptd_create_hash() local
649 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in cryptd_create_hash()
653 ctx = ahash_instance_ctx(inst); in cryptd_create_hash()
654 ctx->queue = queue; in cryptd_create_hash()
656 err = crypto_grab_shash(&ctx->spawn, ahash_crypto_instance(inst), in cryptd_create_hash()
660 alg = crypto_spawn_shash_alg(&ctx->spawn); in cryptd_create_hash()
699 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(parent); in cryptd_aead_setkey() local
700 struct crypto_aead *child = ctx->child; in cryptd_aead_setkey()
708 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(parent); in cryptd_aead_setauthsize() local
709 struct crypto_aead *child = ctx->child; in cryptd_aead_setauthsize()
720 struct cryptd_aead_ctx *ctx; in cryptd_aead_crypt() local
736 ctx = crypto_aead_ctx(tfm); in cryptd_aead_crypt()
737 refcnt = refcount_read(&ctx->refcnt); in cryptd_aead_crypt()
743 if (err != -EINPROGRESS && refcnt && refcount_dec_and_test(&ctx->refcnt)) in cryptd_aead_crypt()
749 struct cryptd_aead_ctx *ctx = crypto_tfm_ctx(areq->tfm); in cryptd_aead_encrypt() local
750 struct crypto_aead *child = ctx->child; in cryptd_aead_encrypt()
759 struct cryptd_aead_ctx *ctx = crypto_tfm_ctx(areq->tfm); in cryptd_aead_decrypt() local
760 struct crypto_aead *child = ctx->child; in cryptd_aead_decrypt()
794 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(tfm); in cryptd_aead_init_tfm() local
801 ctx->child = cipher; in cryptd_aead_init_tfm()
810 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(tfm); in cryptd_aead_exit_tfm() local
811 crypto_free_aead(ctx->child); in cryptd_aead_exit_tfm()
816 struct aead_instance_ctx *ctx = aead_instance_ctx(inst); in cryptd_aead_free() local
818 crypto_drop_aead(&ctx->aead_spawn); in cryptd_aead_free()
827 struct aead_instance_ctx *ctx; in cryptd_create_aead() local
836 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in cryptd_create_aead()
840 ctx = aead_instance_ctx(inst); in cryptd_create_aead()
841 ctx->queue = queue; in cryptd_create_aead()
843 err = crypto_grab_aead(&ctx->aead_spawn, aead_crypto_instance(inst), in cryptd_create_aead()
848 alg = crypto_spawn_aead_alg(&ctx->aead_spawn); in cryptd_create_aead()
909 struct cryptd_skcipher_ctx *ctx; in cryptd_alloc_skcipher() local
925 ctx = crypto_skcipher_ctx(tfm); in cryptd_alloc_skcipher()
926 refcount_set(&ctx->refcnt, 1); in cryptd_alloc_skcipher()
934 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base); in cryptd_skcipher_child() local
936 return ctx->child; in cryptd_skcipher_child()
942 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base); in cryptd_skcipher_queued() local
944 return refcount_read(&ctx->refcnt) - 1; in cryptd_skcipher_queued()
950 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base); in cryptd_free_skcipher() local
952 if (refcount_dec_and_test(&ctx->refcnt)) in cryptd_free_skcipher()
961 struct cryptd_hash_ctx *ctx; in cryptd_alloc_ahash() local
975 ctx = crypto_ahash_ctx(tfm); in cryptd_alloc_ahash()
976 refcount_set(&ctx->refcnt, 1); in cryptd_alloc_ahash()
984 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); in cryptd_ahash_child() local
986 return ctx->child; in cryptd_ahash_child()
999 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); in cryptd_ahash_queued() local
1001 return refcount_read(&ctx->refcnt) - 1; in cryptd_ahash_queued()
1007 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); in cryptd_free_ahash() local
1009 if (refcount_dec_and_test(&ctx->refcnt)) in cryptd_free_ahash()
1018 struct cryptd_aead_ctx *ctx; in cryptd_alloc_aead() local
1032 ctx = crypto_aead_ctx(tfm); in cryptd_alloc_aead()
1033 refcount_set(&ctx->refcnt, 1); in cryptd_alloc_aead()
1041 struct cryptd_aead_ctx *ctx; in cryptd_aead_child() local
1042 ctx = crypto_aead_ctx(&tfm->base); in cryptd_aead_child()
1043 return ctx->child; in cryptd_aead_child()
1049 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(&tfm->base); in cryptd_aead_queued() local
1051 return refcount_read(&ctx->refcnt) - 1; in cryptd_aead_queued()
1057 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(&tfm->base); in cryptd_free_aead() local
1059 if (refcount_dec_and_test(&ctx->refcnt)) in cryptd_free_aead()