Lines Matching refs:inst

517 	struct aead_instance *inst = aead_alg_instance(tfm);  in crypto_gcm_init_tfm()  local
518 struct gcm_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_gcm_init_tfm()
561 static void crypto_gcm_free(struct aead_instance *inst) in crypto_gcm_free() argument
563 struct gcm_instance_ctx *ctx = aead_instance_ctx(inst); in crypto_gcm_free()
567 kfree(inst); in crypto_gcm_free()
577 struct aead_instance *inst; in crypto_gcm_create_common() local
586 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in crypto_gcm_create_common()
587 if (!inst) in crypto_gcm_create_common()
589 ctx = aead_instance_ctx(inst); in crypto_gcm_create_common()
591 err = crypto_grab_ahash(&ctx->ghash, aead_crypto_instance(inst), in crypto_gcm_create_common()
602 err = crypto_grab_skcipher(&ctx->ctr, aead_crypto_instance(inst), in crypto_gcm_create_common()
615 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in crypto_gcm_create_common()
619 if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in crypto_gcm_create_common()
625 inst->alg.base.cra_priority = (ghash->base.cra_priority + in crypto_gcm_create_common()
627 inst->alg.base.cra_blocksize = 1; in crypto_gcm_create_common()
628 inst->alg.base.cra_alignmask = ctr->base.cra_alignmask; in crypto_gcm_create_common()
629 inst->alg.base.cra_ctxsize = sizeof(struct crypto_gcm_ctx); in crypto_gcm_create_common()
630 inst->alg.ivsize = GCM_AES_IV_SIZE; in crypto_gcm_create_common()
631 inst->alg.chunksize = ctr->chunksize; in crypto_gcm_create_common()
632 inst->alg.maxauthsize = 16; in crypto_gcm_create_common()
633 inst->alg.init = crypto_gcm_init_tfm; in crypto_gcm_create_common()
634 inst->alg.exit = crypto_gcm_exit_tfm; in crypto_gcm_create_common()
635 inst->alg.setkey = crypto_gcm_setkey; in crypto_gcm_create_common()
636 inst->alg.setauthsize = crypto_gcm_setauthsize; in crypto_gcm_create_common()
637 inst->alg.encrypt = crypto_gcm_encrypt; in crypto_gcm_create_common()
638 inst->alg.decrypt = crypto_gcm_decrypt; in crypto_gcm_create_common()
640 inst->free = crypto_gcm_free; in crypto_gcm_create_common()
642 err = aead_register_instance(tmpl, inst); in crypto_gcm_create_common()
645 crypto_gcm_free(inst); in crypto_gcm_create_common()
783 struct aead_instance *inst = aead_alg_instance(tfm); in crypto_rfc4106_init_tfm() local
784 struct crypto_aead_spawn *spawn = aead_instance_ctx(inst); in crypto_rfc4106_init_tfm()
813 static void crypto_rfc4106_free(struct aead_instance *inst) in crypto_rfc4106_free() argument
815 crypto_drop_aead(aead_instance_ctx(inst)); in crypto_rfc4106_free()
816 kfree(inst); in crypto_rfc4106_free()
823 struct aead_instance *inst; in crypto_rfc4106_create() local
832 inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); in crypto_rfc4106_create()
833 if (!inst) in crypto_rfc4106_create()
836 spawn = aead_instance_ctx(inst); in crypto_rfc4106_create()
837 err = crypto_grab_aead(spawn, aead_crypto_instance(inst), in crypto_rfc4106_create()
855 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in crypto_rfc4106_create()
858 snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in crypto_rfc4106_create()
863 inst->alg.base.cra_priority = alg->base.cra_priority; in crypto_rfc4106_create()
864 inst->alg.base.cra_blocksize = 1; in crypto_rfc4106_create()
865 inst->alg.base.cra_alignmask = alg->base.cra_alignmask; in crypto_rfc4106_create()
867 inst->alg.base.cra_ctxsize = sizeof(struct crypto_rfc4106_ctx); in crypto_rfc4106_create()
869 inst->alg.ivsize = GCM_RFC4106_IV_SIZE; in crypto_rfc4106_create()
870 inst->alg.chunksize = crypto_aead_alg_chunksize(alg); in crypto_rfc4106_create()
871 inst->alg.maxauthsize = crypto_aead_alg_maxauthsize(alg); in crypto_rfc4106_create()
873 inst->alg.init = crypto_rfc4106_init_tfm; in crypto_rfc4106_create()
874 inst->alg.exit = crypto_rfc4106_exit_tfm; in crypto_rfc4106_create()
876 inst->alg.setkey = crypto_rfc4106_setkey; in crypto_rfc4106_create()
877 inst->alg.setauthsize = crypto_rfc4106_setauthsize; in crypto_rfc4106_create()
878 inst->alg.encrypt = crypto_rfc4106_encrypt; in crypto_rfc4106_create()
879 inst->alg.decrypt = crypto_rfc4106_decrypt; in crypto_rfc4106_create()
881 inst->free = crypto_rfc4106_free; in crypto_rfc4106_create()
883 err = aead_register_instance(tmpl, inst); in crypto_rfc4106_create()
886 crypto_rfc4106_free(inst); in crypto_rfc4106_create()
965 struct aead_instance *inst = aead_alg_instance(tfm); in crypto_rfc4543_init_tfm() local
966 struct crypto_rfc4543_instance_ctx *ictx = aead_instance_ctx(inst); in crypto_rfc4543_init_tfm()
996 static void crypto_rfc4543_free(struct aead_instance *inst) in crypto_rfc4543_free() argument
998 struct crypto_rfc4543_instance_ctx *ctx = aead_instance_ctx(inst); in crypto_rfc4543_free()
1002 kfree(inst); in crypto_rfc4543_free()
1009 struct aead_instance *inst; in crypto_rfc4543_create() local
1018 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in crypto_rfc4543_create()
1019 if (!inst) in crypto_rfc4543_create()
1022 ctx = aead_instance_ctx(inst); in crypto_rfc4543_create()
1023 err = crypto_grab_aead(&ctx->aead, aead_crypto_instance(inst), in crypto_rfc4543_create()
1041 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in crypto_rfc4543_create()
1044 snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in crypto_rfc4543_create()
1049 inst->alg.base.cra_priority = alg->base.cra_priority; in crypto_rfc4543_create()
1050 inst->alg.base.cra_blocksize = 1; in crypto_rfc4543_create()
1051 inst->alg.base.cra_alignmask = alg->base.cra_alignmask; in crypto_rfc4543_create()
1053 inst->alg.base.cra_ctxsize = sizeof(struct crypto_rfc4543_ctx); in crypto_rfc4543_create()
1055 inst->alg.ivsize = GCM_RFC4543_IV_SIZE; in crypto_rfc4543_create()
1056 inst->alg.chunksize = crypto_aead_alg_chunksize(alg); in crypto_rfc4543_create()
1057 inst->alg.maxauthsize = crypto_aead_alg_maxauthsize(alg); in crypto_rfc4543_create()
1059 inst->alg.init = crypto_rfc4543_init_tfm; in crypto_rfc4543_create()
1060 inst->alg.exit = crypto_rfc4543_exit_tfm; in crypto_rfc4543_create()
1062 inst->alg.setkey = crypto_rfc4543_setkey; in crypto_rfc4543_create()
1063 inst->alg.setauthsize = crypto_rfc4543_setauthsize; in crypto_rfc4543_create()
1064 inst->alg.encrypt = crypto_rfc4543_encrypt; in crypto_rfc4543_create()
1065 inst->alg.decrypt = crypto_rfc4543_decrypt; in crypto_rfc4543_create()
1067 inst->free = crypto_rfc4543_free; in crypto_rfc4543_create()
1069 err = aead_register_instance(tmpl, inst); in crypto_rfc4543_create()
1072 crypto_rfc4543_free(inst); in crypto_rfc4543_create()