Lines Matching refs:inst
337 struct skcipher_instance *inst = skcipher_alg_instance(tfm); in hctr2_init_tfm() local
338 struct hctr2_instance_ctx *ictx = skcipher_instance_ctx(inst); in hctr2_init_tfm()
395 static void hctr2_free_instance(struct skcipher_instance *inst) in hctr2_free_instance() argument
397 struct hctr2_instance_ctx *ictx = skcipher_instance_ctx(inst); in hctr2_free_instance()
402 kfree(inst); in hctr2_free_instance()
411 struct skcipher_instance *inst; in hctr2_create_common() local
424 inst = kzalloc(sizeof(*inst) + sizeof(*ictx), GFP_KERNEL); in hctr2_create_common()
425 if (!inst) in hctr2_create_common()
427 ictx = skcipher_instance_ctx(inst); in hctr2_create_common()
431 skcipher_crypto_instance(inst), in hctr2_create_common()
450 skcipher_crypto_instance(inst), in hctr2_create_common()
463 skcipher_crypto_instance(inst), in hctr2_create_common()
477 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, "hctr2(%s)", in hctr2_create_common()
480 if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in hctr2_create_common()
486 inst->alg.base.cra_blocksize = BLOCKCIPHER_BLOCK_SIZE; in hctr2_create_common()
487 inst->alg.base.cra_ctxsize = sizeof(struct hctr2_tfm_ctx) + in hctr2_create_common()
489 inst->alg.base.cra_alignmask = xctr_alg->base.cra_alignmask | in hctr2_create_common()
495 inst->alg.base.cra_priority = (2 * xctr_alg->base.cra_priority + in hctr2_create_common()
499 inst->alg.setkey = hctr2_setkey; in hctr2_create_common()
500 inst->alg.encrypt = hctr2_encrypt; in hctr2_create_common()
501 inst->alg.decrypt = hctr2_decrypt; in hctr2_create_common()
502 inst->alg.init = hctr2_init_tfm; in hctr2_create_common()
503 inst->alg.exit = hctr2_exit_tfm; in hctr2_create_common()
504 inst->alg.min_keysize = crypto_skcipher_alg_min_keysize(xctr_alg); in hctr2_create_common()
505 inst->alg.max_keysize = crypto_skcipher_alg_max_keysize(xctr_alg); in hctr2_create_common()
506 inst->alg.ivsize = TWEAK_SIZE; in hctr2_create_common()
508 inst->free = hctr2_free_instance; in hctr2_create_common()
510 err = skcipher_register_instance(tmpl, inst); in hctr2_create_common()
513 hctr2_free_instance(inst); in hctr2_create_common()