Lines Matching refs:inst

641 	struct crypto_instance *inst = crypto_tfm_alg_instance(tfm);  in crypto_authenc_esn_init_tfm()  local
642 struct authenc_esn_instance_ctx *ictx = crypto_instance_ctx(inst); in crypto_authenc_esn_init_tfm()
691 struct crypto_instance *inst; in crypto_authenc_esn_alloc() local
718 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in crypto_authenc_esn_alloc()
720 if (!inst) in crypto_authenc_esn_alloc()
723 ctx = crypto_instance_ctx(inst); in crypto_authenc_esn_alloc()
725 err = crypto_init_ahash_spawn(&ctx->auth, auth, inst); in crypto_authenc_esn_alloc()
729 crypto_set_skcipher_spawn(&ctx->enc, inst); in crypto_authenc_esn_alloc()
739 if (snprintf(inst->alg.cra_name, CRYPTO_MAX_ALG_NAME, in crypto_authenc_esn_alloc()
744 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in crypto_authenc_esn_alloc()
749 inst->alg.cra_flags = CRYPTO_ALG_TYPE_AEAD; in crypto_authenc_esn_alloc()
750 inst->alg.cra_flags |= enc->cra_flags & CRYPTO_ALG_ASYNC; in crypto_authenc_esn_alloc()
751 inst->alg.cra_priority = enc->cra_priority * in crypto_authenc_esn_alloc()
753 inst->alg.cra_blocksize = enc->cra_blocksize; in crypto_authenc_esn_alloc()
754 inst->alg.cra_alignmask = auth_base->cra_alignmask | enc->cra_alignmask; in crypto_authenc_esn_alloc()
755 inst->alg.cra_type = &crypto_aead_type; in crypto_authenc_esn_alloc()
757 inst->alg.cra_aead.ivsize = enc->cra_ablkcipher.ivsize; in crypto_authenc_esn_alloc()
758 inst->alg.cra_aead.maxauthsize = auth->digestsize; in crypto_authenc_esn_alloc()
760 inst->alg.cra_ctxsize = sizeof(struct crypto_authenc_esn_ctx); in crypto_authenc_esn_alloc()
762 inst->alg.cra_init = crypto_authenc_esn_init_tfm; in crypto_authenc_esn_alloc()
763 inst->alg.cra_exit = crypto_authenc_esn_exit_tfm; in crypto_authenc_esn_alloc()
765 inst->alg.cra_aead.setkey = crypto_authenc_esn_setkey; in crypto_authenc_esn_alloc()
766 inst->alg.cra_aead.encrypt = crypto_authenc_esn_encrypt; in crypto_authenc_esn_alloc()
767 inst->alg.cra_aead.decrypt = crypto_authenc_esn_decrypt; in crypto_authenc_esn_alloc()
768 inst->alg.cra_aead.givencrypt = crypto_authenc_esn_givencrypt; in crypto_authenc_esn_alloc()
772 return inst; in crypto_authenc_esn_alloc()
779 kfree(inst); in crypto_authenc_esn_alloc()
781 inst = ERR_PTR(err); in crypto_authenc_esn_alloc()
785 static void crypto_authenc_esn_free(struct crypto_instance *inst) in crypto_authenc_esn_free() argument
787 struct authenc_esn_instance_ctx *ctx = crypto_instance_ctx(inst); in crypto_authenc_esn_free()
791 kfree(inst); in crypto_authenc_esn_free()