Lines Matching defs:inst
550 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm);
551 struct authenc_instance_ctx *ictx = crypto_instance_ctx(inst);
600 struct crypto_instance *inst;
628 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL);
630 if (!inst)
633 ctx = crypto_instance_ctx(inst);
635 err = crypto_init_ahash_spawn(&ctx->auth, auth, inst);
639 crypto_set_skcipher_spawn(&ctx->enc, inst);
649 if (snprintf(inst->alg.cra_name, CRYPTO_MAX_ALG_NAME,
654 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME,
659 inst->alg.cra_flags = CRYPTO_ALG_TYPE_AEAD;
660 inst->alg.cra_flags |= enc->cra_flags & CRYPTO_ALG_ASYNC;
661 inst->alg.cra_priority = enc->cra_priority *
663 inst->alg.cra_blocksize = enc->cra_blocksize;
664 inst->alg.cra_alignmask = auth_base->cra_alignmask | enc->cra_alignmask;
665 inst->alg.cra_type = &crypto_aead_type;
667 inst->alg.cra_aead.ivsize = enc->cra_ablkcipher.ivsize;
668 inst->alg.cra_aead.maxauthsize = auth->digestsize;
670 inst->alg.cra_ctxsize = sizeof(struct crypto_authenc_ctx);
672 inst->alg.cra_init = crypto_authenc_init_tfm;
673 inst->alg.cra_exit = crypto_authenc_exit_tfm;
675 inst->alg.cra_aead.setkey = crypto_authenc_setkey;
676 inst->alg.cra_aead.encrypt = crypto_authenc_encrypt;
677 inst->alg.cra_aead.decrypt = crypto_authenc_decrypt;
678 inst->alg.cra_aead.givencrypt = crypto_authenc_givencrypt;
682 return inst;
689 kfree(inst);
691 inst = ERR_PTR(err);
695 static void crypto_authenc_free(struct crypto_instance *inst)
697 struct authenc_instance_ctx *ctx = crypto_instance_ctx(inst);
701 kfree(inst);