Lines Matching refs:inst
653 struct crypto_instance *inst = (void *)tfm->__crt_alg; in crypto_gcm_init_tfm() local
654 struct gcm_instance_ctx *ictx = crypto_instance_ctx(inst); in crypto_gcm_init_tfm()
703 struct crypto_instance *inst; in crypto_gcm_alloc_common() local
724 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in crypto_gcm_alloc_common()
725 if (!inst) in crypto_gcm_alloc_common()
728 ctx = crypto_instance_ctx(inst); in crypto_gcm_alloc_common()
731 inst); in crypto_gcm_alloc_common()
735 crypto_set_skcipher_spawn(&ctx->ctr, inst); in crypto_gcm_alloc_common()
754 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in crypto_gcm_alloc_common()
760 memcpy(inst->alg.cra_name, full_name, CRYPTO_MAX_ALG_NAME); in crypto_gcm_alloc_common()
762 inst->alg.cra_flags = CRYPTO_ALG_TYPE_AEAD; in crypto_gcm_alloc_common()
763 inst->alg.cra_flags |= ctr->cra_flags & CRYPTO_ALG_ASYNC; in crypto_gcm_alloc_common()
764 inst->alg.cra_priority = ctr->cra_priority; in crypto_gcm_alloc_common()
765 inst->alg.cra_blocksize = 1; in crypto_gcm_alloc_common()
766 inst->alg.cra_alignmask = ctr->cra_alignmask | (__alignof__(u64) - 1); in crypto_gcm_alloc_common()
767 inst->alg.cra_type = &crypto_aead_type; in crypto_gcm_alloc_common()
768 inst->alg.cra_aead.ivsize = 16; in crypto_gcm_alloc_common()
769 inst->alg.cra_aead.maxauthsize = 16; in crypto_gcm_alloc_common()
770 inst->alg.cra_ctxsize = sizeof(struct crypto_gcm_ctx); in crypto_gcm_alloc_common()
771 inst->alg.cra_init = crypto_gcm_init_tfm; in crypto_gcm_alloc_common()
772 inst->alg.cra_exit = crypto_gcm_exit_tfm; in crypto_gcm_alloc_common()
773 inst->alg.cra_aead.setkey = crypto_gcm_setkey; in crypto_gcm_alloc_common()
774 inst->alg.cra_aead.setauthsize = crypto_gcm_setauthsize; in crypto_gcm_alloc_common()
775 inst->alg.cra_aead.encrypt = crypto_gcm_encrypt; in crypto_gcm_alloc_common()
776 inst->alg.cra_aead.decrypt = crypto_gcm_decrypt; in crypto_gcm_alloc_common()
780 return inst; in crypto_gcm_alloc_common()
787 kfree(inst); in crypto_gcm_alloc_common()
789 inst = ERR_PTR(err); in crypto_gcm_alloc_common()
814 static void crypto_gcm_free(struct crypto_instance *inst) in crypto_gcm_free() argument
816 struct gcm_instance_ctx *ctx = crypto_instance_ctx(inst); in crypto_gcm_free()
820 kfree(inst); in crypto_gcm_free()
935 struct crypto_instance *inst = (void *)tfm->__crt_alg; in crypto_rfc4106_init_tfm() local
936 struct crypto_aead_spawn *spawn = crypto_instance_ctx(inst); in crypto_rfc4106_init_tfm()
967 struct crypto_instance *inst; in crypto_rfc4106_alloc() local
984 inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); in crypto_rfc4106_alloc()
985 if (!inst) in crypto_rfc4106_alloc()
988 spawn = crypto_instance_ctx(inst); in crypto_rfc4106_alloc()
989 crypto_set_aead_spawn(spawn, inst); in crypto_rfc4106_alloc()
1008 if (snprintf(inst->alg.cra_name, CRYPTO_MAX_ALG_NAME, in crypto_rfc4106_alloc()
1010 snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in crypto_rfc4106_alloc()
1015 inst->alg.cra_flags = CRYPTO_ALG_TYPE_AEAD; in crypto_rfc4106_alloc()
1016 inst->alg.cra_flags |= alg->cra_flags & CRYPTO_ALG_ASYNC; in crypto_rfc4106_alloc()
1017 inst->alg.cra_priority = alg->cra_priority; in crypto_rfc4106_alloc()
1018 inst->alg.cra_blocksize = 1; in crypto_rfc4106_alloc()
1019 inst->alg.cra_alignmask = alg->cra_alignmask; in crypto_rfc4106_alloc()
1020 inst->alg.cra_type = &crypto_nivaead_type; in crypto_rfc4106_alloc()
1022 inst->alg.cra_aead.ivsize = 8; in crypto_rfc4106_alloc()
1023 inst->alg.cra_aead.maxauthsize = 16; in crypto_rfc4106_alloc()
1025 inst->alg.cra_ctxsize = sizeof(struct crypto_rfc4106_ctx); in crypto_rfc4106_alloc()
1027 inst->alg.cra_init = crypto_rfc4106_init_tfm; in crypto_rfc4106_alloc()
1028 inst->alg.cra_exit = crypto_rfc4106_exit_tfm; in crypto_rfc4106_alloc()
1030 inst->alg.cra_aead.setkey = crypto_rfc4106_setkey; in crypto_rfc4106_alloc()
1031 inst->alg.cra_aead.setauthsize = crypto_rfc4106_setauthsize; in crypto_rfc4106_alloc()
1032 inst->alg.cra_aead.encrypt = crypto_rfc4106_encrypt; in crypto_rfc4106_alloc()
1033 inst->alg.cra_aead.decrypt = crypto_rfc4106_decrypt; in crypto_rfc4106_alloc()
1035 inst->alg.cra_aead.geniv = "seqiv"; in crypto_rfc4106_alloc()
1038 return inst; in crypto_rfc4106_alloc()
1043 kfree(inst); in crypto_rfc4106_alloc()
1044 inst = ERR_PTR(err); in crypto_rfc4106_alloc()
1048 static void crypto_rfc4106_free(struct crypto_instance *inst) in crypto_rfc4106_free() argument
1050 crypto_drop_spawn(crypto_instance_ctx(inst)); in crypto_rfc4106_free()
1051 kfree(inst); in crypto_rfc4106_free()
1236 struct crypto_instance *inst = (void *)tfm->__crt_alg; in crypto_rfc4543_init_tfm() local
1237 struct crypto_rfc4543_instance_ctx *ictx = crypto_instance_ctx(inst); in crypto_rfc4543_init_tfm()
1282 struct crypto_instance *inst; in crypto_rfc4543_alloc() local
1300 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in crypto_rfc4543_alloc()
1301 if (!inst) in crypto_rfc4543_alloc()
1304 ctx = crypto_instance_ctx(inst); in crypto_rfc4543_alloc()
1306 crypto_set_aead_spawn(spawn, inst); in crypto_rfc4543_alloc()
1314 crypto_set_skcipher_spawn(&ctx->null, inst); in crypto_rfc4543_alloc()
1333 if (snprintf(inst->alg.cra_name, CRYPTO_MAX_ALG_NAME, in crypto_rfc4543_alloc()
1335 snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in crypto_rfc4543_alloc()
1340 inst->alg.cra_flags = CRYPTO_ALG_TYPE_AEAD; in crypto_rfc4543_alloc()
1341 inst->alg.cra_flags |= alg->cra_flags & CRYPTO_ALG_ASYNC; in crypto_rfc4543_alloc()
1342 inst->alg.cra_priority = alg->cra_priority; in crypto_rfc4543_alloc()
1343 inst->alg.cra_blocksize = 1; in crypto_rfc4543_alloc()
1344 inst->alg.cra_alignmask = alg->cra_alignmask; in crypto_rfc4543_alloc()
1345 inst->alg.cra_type = &crypto_nivaead_type; in crypto_rfc4543_alloc()
1347 inst->alg.cra_aead.ivsize = 8; in crypto_rfc4543_alloc()
1348 inst->alg.cra_aead.maxauthsize = 16; in crypto_rfc4543_alloc()
1350 inst->alg.cra_ctxsize = sizeof(struct crypto_rfc4543_ctx); in crypto_rfc4543_alloc()
1352 inst->alg.cra_init = crypto_rfc4543_init_tfm; in crypto_rfc4543_alloc()
1353 inst->alg.cra_exit = crypto_rfc4543_exit_tfm; in crypto_rfc4543_alloc()
1355 inst->alg.cra_aead.setkey = crypto_rfc4543_setkey; in crypto_rfc4543_alloc()
1356 inst->alg.cra_aead.setauthsize = crypto_rfc4543_setauthsize; in crypto_rfc4543_alloc()
1357 inst->alg.cra_aead.encrypt = crypto_rfc4543_encrypt; in crypto_rfc4543_alloc()
1358 inst->alg.cra_aead.decrypt = crypto_rfc4543_decrypt; in crypto_rfc4543_alloc()
1360 inst->alg.cra_aead.geniv = "seqiv"; in crypto_rfc4543_alloc()
1363 return inst; in crypto_rfc4543_alloc()
1370 kfree(inst); in crypto_rfc4543_alloc()
1371 inst = ERR_PTR(err); in crypto_rfc4543_alloc()
1375 static void crypto_rfc4543_free(struct crypto_instance *inst) in crypto_rfc4543_free() argument
1377 struct crypto_rfc4543_instance_ctx *ctx = crypto_instance_ctx(inst); in crypto_rfc4543_free()
1382 kfree(inst); in crypto_rfc4543_free()