Lines Matching refs:inst
189 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in cryptd_get_queue() local
190 struct cryptd_instance_ctx *ictx = crypto_instance_ctx(inst); in cryptd_get_queue()
210 static int cryptd_init_instance(struct crypto_instance *inst, in cryptd_init_instance() argument
213 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in cryptd_init_instance()
218 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in cryptd_init_instance()
220 inst->alg.cra_priority = alg->cra_priority + 50; in cryptd_init_instance()
221 inst->alg.cra_blocksize = alg->cra_blocksize; in cryptd_init_instance()
222 inst->alg.cra_alignmask = alg->cra_alignmask; in cryptd_init_instance()
337 struct skcipher_instance *inst = skcipher_alg_instance(tfm); in cryptd_skcipher_init_tfm() local
338 struct skcipherd_instance_ctx *ictx = skcipher_instance_ctx(inst); in cryptd_skcipher_init_tfm()
361 static void cryptd_skcipher_free(struct skcipher_instance *inst) in cryptd_skcipher_free() argument
363 struct skcipherd_instance_ctx *ctx = skcipher_instance_ctx(inst); in cryptd_skcipher_free()
366 kfree(inst); in cryptd_skcipher_free()
375 struct skcipher_instance *inst; in cryptd_create_skcipher() local
383 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in cryptd_create_skcipher()
384 if (!inst) in cryptd_create_skcipher()
387 ctx = skcipher_instance_ctx(inst); in cryptd_create_skcipher()
390 err = crypto_grab_skcipher(&ctx->spawn, skcipher_crypto_instance(inst), in cryptd_create_skcipher()
396 err = cryptd_init_instance(skcipher_crypto_instance(inst), &alg->base); in cryptd_create_skcipher()
400 inst->alg.base.cra_flags |= CRYPTO_ALG_ASYNC | in cryptd_create_skcipher()
402 inst->alg.ivsize = crypto_skcipher_alg_ivsize(alg); in cryptd_create_skcipher()
403 inst->alg.chunksize = crypto_skcipher_alg_chunksize(alg); in cryptd_create_skcipher()
404 inst->alg.min_keysize = crypto_skcipher_alg_min_keysize(alg); in cryptd_create_skcipher()
405 inst->alg.max_keysize = crypto_skcipher_alg_max_keysize(alg); in cryptd_create_skcipher()
407 inst->alg.base.cra_ctxsize = sizeof(struct cryptd_skcipher_ctx); in cryptd_create_skcipher()
409 inst->alg.init = cryptd_skcipher_init_tfm; in cryptd_create_skcipher()
410 inst->alg.exit = cryptd_skcipher_exit_tfm; in cryptd_create_skcipher()
412 inst->alg.setkey = cryptd_skcipher_setkey; in cryptd_create_skcipher()
413 inst->alg.encrypt = cryptd_skcipher_encrypt_enqueue; in cryptd_create_skcipher()
414 inst->alg.decrypt = cryptd_skcipher_decrypt_enqueue; in cryptd_create_skcipher()
416 inst->free = cryptd_skcipher_free; in cryptd_create_skcipher()
418 err = skcipher_register_instance(tmpl, inst); in cryptd_create_skcipher()
421 cryptd_skcipher_free(inst); in cryptd_create_skcipher()
428 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in cryptd_hash_init_tfm() local
429 struct hashd_instance_ctx *ictx = crypto_instance_ctx(inst); in cryptd_hash_init_tfm()
628 static void cryptd_hash_free(struct ahash_instance *inst) in cryptd_hash_free() argument
630 struct hashd_instance_ctx *ctx = ahash_instance_ctx(inst); in cryptd_hash_free()
633 kfree(inst); in cryptd_hash_free()
641 struct ahash_instance *inst; in cryptd_create_hash() local
649 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in cryptd_create_hash()
650 if (!inst) in cryptd_create_hash()
653 ctx = ahash_instance_ctx(inst); in cryptd_create_hash()
656 err = crypto_grab_shash(&ctx->spawn, ahash_crypto_instance(inst), in cryptd_create_hash()
662 err = cryptd_init_instance(ahash_crypto_instance(inst), &alg->base); in cryptd_create_hash()
666 inst->alg.halg.base.cra_flags |= CRYPTO_ALG_ASYNC | in cryptd_create_hash()
669 inst->alg.halg.digestsize = alg->digestsize; in cryptd_create_hash()
670 inst->alg.halg.statesize = alg->statesize; in cryptd_create_hash()
671 inst->alg.halg.base.cra_ctxsize = sizeof(struct cryptd_hash_ctx); in cryptd_create_hash()
673 inst->alg.halg.base.cra_init = cryptd_hash_init_tfm; in cryptd_create_hash()
674 inst->alg.halg.base.cra_exit = cryptd_hash_exit_tfm; in cryptd_create_hash()
676 inst->alg.init = cryptd_hash_init_enqueue; in cryptd_create_hash()
677 inst->alg.update = cryptd_hash_update_enqueue; in cryptd_create_hash()
678 inst->alg.final = cryptd_hash_final_enqueue; in cryptd_create_hash()
679 inst->alg.finup = cryptd_hash_finup_enqueue; in cryptd_create_hash()
680 inst->alg.export = cryptd_hash_export; in cryptd_create_hash()
681 inst->alg.import = cryptd_hash_import; in cryptd_create_hash()
683 inst->alg.setkey = cryptd_hash_setkey; in cryptd_create_hash()
684 inst->alg.digest = cryptd_hash_digest_enqueue; in cryptd_create_hash()
686 inst->free = cryptd_hash_free; in cryptd_create_hash()
688 err = ahash_register_instance(tmpl, inst); in cryptd_create_hash()
691 cryptd_hash_free(inst); in cryptd_create_hash()
791 struct aead_instance *inst = aead_alg_instance(tfm); in cryptd_aead_init_tfm() local
792 struct aead_instance_ctx *ictx = aead_instance_ctx(inst); in cryptd_aead_init_tfm()
814 static void cryptd_aead_free(struct aead_instance *inst) in cryptd_aead_free() argument
816 struct aead_instance_ctx *ctx = aead_instance_ctx(inst); in cryptd_aead_free()
819 kfree(inst); in cryptd_aead_free()
828 struct aead_instance *inst; in cryptd_create_aead() local
836 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in cryptd_create_aead()
837 if (!inst) in cryptd_create_aead()
840 ctx = aead_instance_ctx(inst); in cryptd_create_aead()
843 err = crypto_grab_aead(&ctx->aead_spawn, aead_crypto_instance(inst), in cryptd_create_aead()
849 err = cryptd_init_instance(aead_crypto_instance(inst), &alg->base); in cryptd_create_aead()
853 inst->alg.base.cra_flags |= CRYPTO_ALG_ASYNC | in cryptd_create_aead()
855 inst->alg.base.cra_ctxsize = sizeof(struct cryptd_aead_ctx); in cryptd_create_aead()
857 inst->alg.ivsize = crypto_aead_alg_ivsize(alg); in cryptd_create_aead()
858 inst->alg.maxauthsize = crypto_aead_alg_maxauthsize(alg); in cryptd_create_aead()
860 inst->alg.init = cryptd_aead_init_tfm; in cryptd_create_aead()
861 inst->alg.exit = cryptd_aead_exit_tfm; in cryptd_create_aead()
862 inst->alg.setkey = cryptd_aead_setkey; in cryptd_create_aead()
863 inst->alg.setauthsize = cryptd_aead_setauthsize; in cryptd_create_aead()
864 inst->alg.encrypt = cryptd_aead_encrypt_enqueue; in cryptd_create_aead()
865 inst->alg.decrypt = cryptd_aead_decrypt_enqueue; in cryptd_create_aead()
867 inst->free = cryptd_aead_free; in cryptd_create_aead()
869 err = aead_register_instance(tmpl, inst); in cryptd_create_aead()
872 cryptd_aead_free(inst); in cryptd_create_aead()