Lines Matching refs:inst

70 	struct lskcipher_instance *inst = lskcipher_alg_instance(tfm);  in lskcipher_init_tfm_simple2()  local
75 spawn = lskcipher_instance_ctx(inst); in lskcipher_init_tfm_simple2()
91 static void lskcipher_free_instance_simple2(struct lskcipher_instance *inst) in lskcipher_free_instance_simple2() argument
93 crypto_drop_cipher(lskcipher_instance_ctx(inst)); in lskcipher_free_instance_simple2()
94 kfree(inst); in lskcipher_free_instance_simple2()
101 struct lskcipher_instance *inst; in lskcipher_alloc_instance_simple2() local
110 inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); in lskcipher_alloc_instance_simple2()
111 if (!inst) in lskcipher_alloc_instance_simple2()
113 spawn = lskcipher_instance_ctx(inst); in lskcipher_alloc_instance_simple2()
115 err = crypto_grab_cipher(spawn, lskcipher_crypto_instance(inst), in lskcipher_alloc_instance_simple2()
121 err = crypto_inst_setname(lskcipher_crypto_instance(inst), tmpl->name, in lskcipher_alloc_instance_simple2()
126 inst->free = lskcipher_free_instance_simple2; in lskcipher_alloc_instance_simple2()
129 inst->alg.co.base.cra_blocksize = cipher_alg->cra_blocksize; in lskcipher_alloc_instance_simple2()
130 inst->alg.co.base.cra_alignmask = cipher_alg->cra_alignmask; in lskcipher_alloc_instance_simple2()
131 inst->alg.co.base.cra_priority = cipher_alg->cra_priority; in lskcipher_alloc_instance_simple2()
132 inst->alg.co.min_keysize = cipher_alg->cra_cipher.cia_min_keysize; in lskcipher_alloc_instance_simple2()
133 inst->alg.co.max_keysize = cipher_alg->cra_cipher.cia_max_keysize; in lskcipher_alloc_instance_simple2()
134 inst->alg.co.ivsize = cipher_alg->cra_blocksize; in lskcipher_alloc_instance_simple2()
137 inst->alg.co.base.cra_ctxsize = sizeof(struct crypto_cipher *); in lskcipher_alloc_instance_simple2()
138 inst->alg.setkey = lskcipher_setkey_simple2; in lskcipher_alloc_instance_simple2()
139 inst->alg.init = lskcipher_init_tfm_simple2; in lskcipher_alloc_instance_simple2()
140 inst->alg.exit = lskcipher_exit_tfm_simple2; in lskcipher_alloc_instance_simple2()
142 return inst; in lskcipher_alloc_instance_simple2()
145 lskcipher_free_instance_simple2(inst); in lskcipher_alloc_instance_simple2()
151 struct lskcipher_instance *inst; in crypto_ecb_create2() local
154 inst = lskcipher_alloc_instance_simple2(tmpl, tb); in crypto_ecb_create2()
155 if (IS_ERR(inst)) in crypto_ecb_create2()
156 return PTR_ERR(inst); in crypto_ecb_create2()
159 inst->alg.co.ivsize = 0; in crypto_ecb_create2()
161 inst->alg.encrypt = crypto_ecb_encrypt2; in crypto_ecb_create2()
162 inst->alg.decrypt = crypto_ecb_decrypt2; in crypto_ecb_create2()
164 err = lskcipher_register_instance(tmpl, inst); in crypto_ecb_create2()
166 inst->free(inst); in crypto_ecb_create2()
175 struct lskcipher_instance *inst; in crypto_ecb_create() local
178 inst = lskcipher_alloc_instance_simple(tmpl, tb); in crypto_ecb_create()
179 if (IS_ERR(inst)) { in crypto_ecb_create()
184 spawn = lskcipher_instance_ctx(inst); in crypto_ecb_create()
188 inst->alg.co.ivsize = 0; in crypto_ecb_create()
192 inst->alg.co.base.cra_ctxsize = cipher_alg->co.base.cra_ctxsize; in crypto_ecb_create()
193 inst->alg.setkey = cipher_alg->setkey; in crypto_ecb_create()
194 inst->alg.encrypt = cipher_alg->encrypt; in crypto_ecb_create()
195 inst->alg.decrypt = cipher_alg->decrypt; in crypto_ecb_create()
196 inst->alg.init = cipher_alg->init; in crypto_ecb_create()
197 inst->alg.exit = cipher_alg->exit; in crypto_ecb_create()
199 err = lskcipher_register_instance(tmpl, inst); in crypto_ecb_create()
201 inst->free(inst); in crypto_ecb_create()