Lines Matching refs:inst

549 	struct crypto_instance *inst = crypto_tfm_alg_instance(tfm);  in crypto_authenc_init_tfm()  local
550 struct authenc_instance_ctx *ictx = crypto_instance_ctx(inst); in crypto_authenc_init_tfm()
599 struct crypto_instance *inst; in crypto_authenc_alloc() local
626 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in crypto_authenc_alloc()
628 if (!inst) in crypto_authenc_alloc()
631 ctx = crypto_instance_ctx(inst); in crypto_authenc_alloc()
633 err = crypto_init_ahash_spawn(&ctx->auth, auth, inst); in crypto_authenc_alloc()
637 crypto_set_skcipher_spawn(&ctx->enc, inst); in crypto_authenc_alloc()
647 if (snprintf(inst->alg.cra_name, CRYPTO_MAX_ALG_NAME, in crypto_authenc_alloc()
652 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in crypto_authenc_alloc()
657 inst->alg.cra_flags = CRYPTO_ALG_TYPE_AEAD; in crypto_authenc_alloc()
658 inst->alg.cra_flags |= enc->cra_flags & CRYPTO_ALG_ASYNC; in crypto_authenc_alloc()
659 inst->alg.cra_priority = enc->cra_priority * in crypto_authenc_alloc()
661 inst->alg.cra_blocksize = enc->cra_blocksize; in crypto_authenc_alloc()
662 inst->alg.cra_alignmask = auth_base->cra_alignmask | enc->cra_alignmask; in crypto_authenc_alloc()
663 inst->alg.cra_type = &crypto_aead_type; in crypto_authenc_alloc()
665 inst->alg.cra_aead.ivsize = enc->cra_ablkcipher.ivsize; in crypto_authenc_alloc()
666 inst->alg.cra_aead.maxauthsize = auth->digestsize; in crypto_authenc_alloc()
668 inst->alg.cra_ctxsize = sizeof(struct crypto_authenc_ctx); in crypto_authenc_alloc()
670 inst->alg.cra_init = crypto_authenc_init_tfm; in crypto_authenc_alloc()
671 inst->alg.cra_exit = crypto_authenc_exit_tfm; in crypto_authenc_alloc()
673 inst->alg.cra_aead.setkey = crypto_authenc_setkey; in crypto_authenc_alloc()
674 inst->alg.cra_aead.encrypt = crypto_authenc_encrypt; in crypto_authenc_alloc()
675 inst->alg.cra_aead.decrypt = crypto_authenc_decrypt; in crypto_authenc_alloc()
676 inst->alg.cra_aead.givencrypt = crypto_authenc_givencrypt; in crypto_authenc_alloc()
680 return inst; in crypto_authenc_alloc()
687 kfree(inst); in crypto_authenc_alloc()
689 inst = ERR_PTR(err); in crypto_authenc_alloc()
693 static void crypto_authenc_free(struct crypto_instance *inst) in crypto_authenc_free() argument
695 struct authenc_instance_ctx *ctx = crypto_instance_ctx(inst); in crypto_authenc_free()
699 kfree(inst); in crypto_authenc_free()