Lines Matching refs:inst
566 struct aead_instance *inst = aead_alg_instance(tfm); in crypto_gcm_init_tfm() local
567 struct gcm_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_gcm_init_tfm()
610 static void crypto_gcm_free(struct aead_instance *inst) in crypto_gcm_free() argument
612 struct gcm_instance_ctx *ctx = aead_instance_ctx(inst); in crypto_gcm_free()
616 kfree(inst); in crypto_gcm_free()
626 struct aead_instance *inst; in crypto_gcm_create_common() local
649 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in crypto_gcm_create_common()
650 if (!inst) in crypto_gcm_create_common()
653 ctx = aead_instance_ctx(inst); in crypto_gcm_create_common()
655 aead_crypto_instance(inst)); in crypto_gcm_create_common()
663 crypto_set_skcipher_spawn(&ctx->ctr, aead_crypto_instance(inst)); in crypto_gcm_create_common()
682 if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in crypto_gcm_create_common()
688 memcpy(inst->alg.base.cra_name, full_name, CRYPTO_MAX_ALG_NAME); in crypto_gcm_create_common()
690 inst->alg.base.cra_flags = (ghash->base.cra_flags | ctr->cra_flags) & in crypto_gcm_create_common()
692 inst->alg.base.cra_priority = (ghash->base.cra_priority + in crypto_gcm_create_common()
694 inst->alg.base.cra_blocksize = 1; in crypto_gcm_create_common()
695 inst->alg.base.cra_alignmask = ghash->base.cra_alignmask | in crypto_gcm_create_common()
697 inst->alg.base.cra_ctxsize = sizeof(struct crypto_gcm_ctx); in crypto_gcm_create_common()
698 inst->alg.ivsize = 12; in crypto_gcm_create_common()
699 inst->alg.maxauthsize = 16; in crypto_gcm_create_common()
700 inst->alg.init = crypto_gcm_init_tfm; in crypto_gcm_create_common()
701 inst->alg.exit = crypto_gcm_exit_tfm; in crypto_gcm_create_common()
702 inst->alg.setkey = crypto_gcm_setkey; in crypto_gcm_create_common()
703 inst->alg.setauthsize = crypto_gcm_setauthsize; in crypto_gcm_create_common()
704 inst->alg.encrypt = crypto_gcm_encrypt; in crypto_gcm_create_common()
705 inst->alg.decrypt = crypto_gcm_decrypt; in crypto_gcm_create_common()
707 inst->free = crypto_gcm_free; in crypto_gcm_create_common()
709 err = aead_register_instance(tmpl, inst); in crypto_gcm_create_common()
722 kfree(inst); in crypto_gcm_create_common()
886 struct aead_instance *inst = aead_alg_instance(tfm); in crypto_rfc4106_init_tfm() local
887 struct crypto_aead_spawn *spawn = aead_instance_ctx(inst); in crypto_rfc4106_init_tfm()
916 static void crypto_rfc4106_free(struct aead_instance *inst) in crypto_rfc4106_free() argument
918 crypto_drop_aead(aead_instance_ctx(inst)); in crypto_rfc4106_free()
919 kfree(inst); in crypto_rfc4106_free()
926 struct aead_instance *inst; in crypto_rfc4106_create() local
943 inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); in crypto_rfc4106_create()
944 if (!inst) in crypto_rfc4106_create()
947 spawn = aead_instance_ctx(inst); in crypto_rfc4106_create()
948 crypto_set_aead_spawn(spawn, aead_crypto_instance(inst)); in crypto_rfc4106_create()
967 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in crypto_rfc4106_create()
970 snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in crypto_rfc4106_create()
975 inst->alg.base.cra_flags = alg->base.cra_flags & CRYPTO_ALG_ASYNC; in crypto_rfc4106_create()
976 inst->alg.base.cra_priority = alg->base.cra_priority; in crypto_rfc4106_create()
977 inst->alg.base.cra_blocksize = 1; in crypto_rfc4106_create()
978 inst->alg.base.cra_alignmask = alg->base.cra_alignmask; in crypto_rfc4106_create()
980 inst->alg.base.cra_ctxsize = sizeof(struct crypto_rfc4106_ctx); in crypto_rfc4106_create()
982 inst->alg.ivsize = 8; in crypto_rfc4106_create()
983 inst->alg.maxauthsize = crypto_aead_alg_maxauthsize(alg); in crypto_rfc4106_create()
985 inst->alg.init = crypto_rfc4106_init_tfm; in crypto_rfc4106_create()
986 inst->alg.exit = crypto_rfc4106_exit_tfm; in crypto_rfc4106_create()
988 inst->alg.setkey = crypto_rfc4106_setkey; in crypto_rfc4106_create()
989 inst->alg.setauthsize = crypto_rfc4106_setauthsize; in crypto_rfc4106_create()
990 inst->alg.encrypt = crypto_rfc4106_encrypt; in crypto_rfc4106_create()
991 inst->alg.decrypt = crypto_rfc4106_decrypt; in crypto_rfc4106_create()
993 inst->free = crypto_rfc4106_free; in crypto_rfc4106_create()
995 err = aead_register_instance(tmpl, inst); in crypto_rfc4106_create()
1005 kfree(inst); in crypto_rfc4106_create()
1106 struct aead_instance *inst = aead_alg_instance(tfm); in crypto_rfc4543_init_tfm() local
1107 struct crypto_rfc4543_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_rfc4543_init_tfm()
1150 static void crypto_rfc4543_free(struct aead_instance *inst) in crypto_rfc4543_free() argument
1152 struct crypto_rfc4543_instance_ctx *ctx = aead_instance_ctx(inst); in crypto_rfc4543_free()
1156 kfree(inst); in crypto_rfc4543_free()
1163 struct aead_instance *inst; in crypto_rfc4543_create() local
1181 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in crypto_rfc4543_create()
1182 if (!inst) in crypto_rfc4543_create()
1185 ctx = aead_instance_ctx(inst); in crypto_rfc4543_create()
1187 crypto_set_aead_spawn(spawn, aead_crypto_instance(inst)); in crypto_rfc4543_create()
1206 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in crypto_rfc4543_create()
1209 snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in crypto_rfc4543_create()
1214 inst->alg.base.cra_flags = alg->base.cra_flags & CRYPTO_ALG_ASYNC; in crypto_rfc4543_create()
1215 inst->alg.base.cra_priority = alg->base.cra_priority; in crypto_rfc4543_create()
1216 inst->alg.base.cra_blocksize = 1; in crypto_rfc4543_create()
1217 inst->alg.base.cra_alignmask = alg->base.cra_alignmask; in crypto_rfc4543_create()
1219 inst->alg.base.cra_ctxsize = sizeof(struct crypto_rfc4543_ctx); in crypto_rfc4543_create()
1221 inst->alg.ivsize = 8; in crypto_rfc4543_create()
1222 inst->alg.maxauthsize = crypto_aead_alg_maxauthsize(alg); in crypto_rfc4543_create()
1224 inst->alg.init = crypto_rfc4543_init_tfm; in crypto_rfc4543_create()
1225 inst->alg.exit = crypto_rfc4543_exit_tfm; in crypto_rfc4543_create()
1227 inst->alg.setkey = crypto_rfc4543_setkey; in crypto_rfc4543_create()
1228 inst->alg.setauthsize = crypto_rfc4543_setauthsize; in crypto_rfc4543_create()
1229 inst->alg.encrypt = crypto_rfc4543_encrypt; in crypto_rfc4543_create()
1230 inst->alg.decrypt = crypto_rfc4543_decrypt; in crypto_rfc4543_create()
1232 inst->free = crypto_rfc4543_free, in crypto_rfc4543_create()
1234 err = aead_register_instance(tmpl, inst); in crypto_rfc4543_create()
1244 kfree(inst); in crypto_rfc4543_create()