Lines Matching refs:ctx
236 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(parent); in cryptd_skcipher_setkey() local
237 struct crypto_skcipher *child = ctx->child; in cryptd_skcipher_setkey()
251 struct cryptd_skcipher_ctx *ctx; in cryptd_skcipher_prepare() local
260 ctx = crypto_skcipher_ctx(crypto_skcipher_reqtfm(req)); in cryptd_skcipher_prepare()
261 child = ctx->child; in cryptd_skcipher_prepare()
277 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_complete() local
279 int refcnt = refcount_read(&ctx->refcnt); in cryptd_skcipher_complete()
290 } else if (refcnt && refcount_dec_and_test(&ctx->refcnt)) in cryptd_skcipher_complete()
350 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_init_tfm() local
357 ctx->child = cipher; in cryptd_skcipher_init_tfm()
366 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(tfm); in cryptd_skcipher_exit_tfm() local
368 crypto_free_skcipher(ctx->child); in cryptd_skcipher_exit_tfm()
373 struct skcipherd_instance_ctx *ctx = skcipher_instance_ctx(inst); in cryptd_skcipher_free() local
375 crypto_drop_skcipher(&ctx->spawn); in cryptd_skcipher_free()
384 struct skcipherd_instance_ctx *ctx; in cryptd_create_skcipher() local
393 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in cryptd_create_skcipher()
397 ctx = skcipher_instance_ctx(inst); in cryptd_create_skcipher()
398 ctx->queue = queue; in cryptd_create_skcipher()
400 err = crypto_grab_skcipher(&ctx->spawn, skcipher_crypto_instance(inst), in cryptd_create_skcipher()
405 alg = crypto_spawn_skcipher_alg_common(&ctx->spawn); in cryptd_create_skcipher()
441 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm); in cryptd_hash_init_tfm() local
448 ctx->child = hash; in cryptd_hash_init_tfm()
459 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm); in cryptd_hash_clone_tfm() local
462 hash = crypto_clone_shash(ctx->child); in cryptd_hash_clone_tfm()
472 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm); in cryptd_hash_exit_tfm() local
474 crypto_free_shash(ctx->child); in cryptd_hash_exit_tfm()
480 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(parent); in cryptd_hash_setkey() local
481 struct crypto_shash *child = ctx->child; in cryptd_hash_setkey()
523 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm); in cryptd_hash_complete() local
524 int refcnt = refcount_read(&ctx->refcnt); in cryptd_hash_complete()
533 } else if (refcnt && refcount_dec_and_test(&ctx->refcnt)) in cryptd_hash_complete()
541 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm); in cryptd_hash_init() local
542 struct crypto_shash *child = ctx->child; in cryptd_hash_init()
617 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm); in cryptd_hash_digest() local
618 struct crypto_shash *child = ctx->child; in cryptd_hash_digest()
648 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(tfm); in cryptd_hash_import() local
651 desc->tfm = ctx->child; in cryptd_hash_import()
658 struct hashd_instance_ctx *ctx = ahash_instance_ctx(inst); in cryptd_hash_free() local
660 crypto_drop_shash(&ctx->spawn); in cryptd_hash_free()
668 struct hashd_instance_ctx *ctx; in cryptd_create_hash() local
677 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in cryptd_create_hash()
681 ctx = ahash_instance_ctx(inst); in cryptd_create_hash()
682 ctx->queue = queue; in cryptd_create_hash()
684 err = crypto_grab_shash(&ctx->spawn, ahash_crypto_instance(inst), in cryptd_create_hash()
688 alg = crypto_spawn_shash_alg(&ctx->spawn); in cryptd_create_hash()
728 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(parent); in cryptd_aead_setkey() local
729 struct crypto_aead *child = ctx->child; in cryptd_aead_setkey()
737 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(parent); in cryptd_aead_setauthsize() local
738 struct crypto_aead *child = ctx->child; in cryptd_aead_setauthsize()
750 struct cryptd_aead_ctx *ctx; in cryptd_aead_crypt() local
774 ctx = crypto_aead_ctx(tfm); in cryptd_aead_crypt()
775 refcnt = refcount_read(&ctx->refcnt); in cryptd_aead_crypt()
786 } else if (refcnt && refcount_dec_and_test(&ctx->refcnt)) in cryptd_aead_crypt()
793 struct cryptd_aead_ctx *ctx; in cryptd_aead_encrypt() local
796 ctx = crypto_aead_ctx(crypto_aead_reqtfm(req)); in cryptd_aead_encrypt()
797 child = ctx->child; in cryptd_aead_encrypt()
805 struct cryptd_aead_ctx *ctx; in cryptd_aead_decrypt() local
808 ctx = crypto_aead_ctx(crypto_aead_reqtfm(req)); in cryptd_aead_decrypt()
809 child = ctx->child; in cryptd_aead_decrypt()
844 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(tfm); in cryptd_aead_init_tfm() local
851 ctx->child = cipher; in cryptd_aead_init_tfm()
860 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(tfm); in cryptd_aead_exit_tfm() local
861 crypto_free_aead(ctx->child); in cryptd_aead_exit_tfm()
866 struct aead_instance_ctx *ctx = aead_instance_ctx(inst); in cryptd_aead_free() local
868 crypto_drop_aead(&ctx->aead_spawn); in cryptd_aead_free()
877 struct aead_instance_ctx *ctx; in cryptd_create_aead() local
886 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in cryptd_create_aead()
890 ctx = aead_instance_ctx(inst); in cryptd_create_aead()
891 ctx->queue = queue; in cryptd_create_aead()
893 err = crypto_grab_aead(&ctx->aead_spawn, aead_crypto_instance(inst), in cryptd_create_aead()
898 alg = crypto_spawn_aead_alg(&ctx->aead_spawn); in cryptd_create_aead()
959 struct cryptd_skcipher_ctx *ctx; in cryptd_alloc_skcipher() local
975 ctx = crypto_skcipher_ctx(tfm); in cryptd_alloc_skcipher()
976 refcount_set(&ctx->refcnt, 1); in cryptd_alloc_skcipher()
984 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base); in cryptd_skcipher_child() local
986 return ctx->child; in cryptd_skcipher_child()
992 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base); in cryptd_skcipher_queued() local
994 return refcount_read(&ctx->refcnt) - 1; in cryptd_skcipher_queued()
1000 struct cryptd_skcipher_ctx *ctx = crypto_skcipher_ctx(&tfm->base); in cryptd_free_skcipher() local
1002 if (refcount_dec_and_test(&ctx->refcnt)) in cryptd_free_skcipher()
1011 struct cryptd_hash_ctx *ctx; in cryptd_alloc_ahash() local
1025 ctx = crypto_ahash_ctx(tfm); in cryptd_alloc_ahash()
1026 refcount_set(&ctx->refcnt, 1); in cryptd_alloc_ahash()
1034 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); in cryptd_ahash_child() local
1036 return ctx->child; in cryptd_ahash_child()
1049 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); in cryptd_ahash_queued() local
1051 return refcount_read(&ctx->refcnt) - 1; in cryptd_ahash_queued()
1057 struct cryptd_hash_ctx *ctx = crypto_ahash_ctx(&tfm->base); in cryptd_free_ahash() local
1059 if (refcount_dec_and_test(&ctx->refcnt)) in cryptd_free_ahash()
1068 struct cryptd_aead_ctx *ctx; in cryptd_alloc_aead() local
1082 ctx = crypto_aead_ctx(tfm); in cryptd_alloc_aead()
1083 refcount_set(&ctx->refcnt, 1); in cryptd_alloc_aead()
1091 struct cryptd_aead_ctx *ctx; in cryptd_aead_child() local
1092 ctx = crypto_aead_ctx(&tfm->base); in cryptd_aead_child()
1093 return ctx->child; in cryptd_aead_child()
1099 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(&tfm->base); in cryptd_aead_queued() local
1101 return refcount_read(&ctx->refcnt) - 1; in cryptd_aead_queued()
1107 struct cryptd_aead_ctx *ctx = crypto_aead_ctx(&tfm->base); in cryptd_free_aead() local
1109 if (refcount_dec_and_test(&ctx->refcnt)) in cryptd_free_aead()