Lines Matching refs:inst
129 struct skcipher_instance *inst; in crypto_ctr_create() local
133 inst = skcipher_alloc_instance_simple(tmpl, tb); in crypto_ctr_create()
134 if (IS_ERR(inst)) in crypto_ctr_create()
135 return PTR_ERR(inst); in crypto_ctr_create()
137 alg = skcipher_ialg_simple(inst); in crypto_ctr_create()
149 inst->alg.base.cra_blocksize = 1; in crypto_ctr_create()
155 inst->alg.chunksize = alg->cra_blocksize; in crypto_ctr_create()
157 inst->alg.encrypt = crypto_ctr_crypt; in crypto_ctr_create()
158 inst->alg.decrypt = crypto_ctr_crypt; in crypto_ctr_create()
160 err = skcipher_register_instance(tmpl, inst); in crypto_ctr_create()
163 inst->free(inst); in crypto_ctr_create()
220 struct skcipher_instance *inst = skcipher_alg_instance(tfm); in crypto_rfc3686_init_tfm() local
221 struct crypto_skcipher_spawn *spawn = skcipher_instance_ctx(inst); in crypto_rfc3686_init_tfm()
249 static void crypto_rfc3686_free(struct skcipher_instance *inst) in crypto_rfc3686_free() argument
251 struct crypto_skcipher_spawn *spawn = skcipher_instance_ctx(inst); in crypto_rfc3686_free()
254 kfree(inst); in crypto_rfc3686_free()
260 struct skcipher_instance *inst; in crypto_rfc3686_create() local
270 inst = kzalloc(sizeof(*inst) + sizeof(*spawn), GFP_KERNEL); in crypto_rfc3686_create()
271 if (!inst) in crypto_rfc3686_create()
274 spawn = skcipher_instance_ctx(inst); in crypto_rfc3686_create()
276 err = crypto_grab_skcipher(spawn, skcipher_crypto_instance(inst), in crypto_rfc3686_create()
293 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in crypto_rfc3686_create()
296 if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in crypto_rfc3686_create()
301 inst->alg.base.cra_priority = alg->base.cra_priority; in crypto_rfc3686_create()
302 inst->alg.base.cra_blocksize = 1; in crypto_rfc3686_create()
303 inst->alg.base.cra_alignmask = alg->base.cra_alignmask; in crypto_rfc3686_create()
305 inst->alg.ivsize = CTR_RFC3686_IV_SIZE; in crypto_rfc3686_create()
306 inst->alg.chunksize = crypto_skcipher_alg_chunksize(alg); in crypto_rfc3686_create()
307 inst->alg.min_keysize = crypto_skcipher_alg_min_keysize(alg) + in crypto_rfc3686_create()
309 inst->alg.max_keysize = crypto_skcipher_alg_max_keysize(alg) + in crypto_rfc3686_create()
312 inst->alg.setkey = crypto_rfc3686_setkey; in crypto_rfc3686_create()
313 inst->alg.encrypt = crypto_rfc3686_crypt; in crypto_rfc3686_create()
314 inst->alg.decrypt = crypto_rfc3686_crypt; in crypto_rfc3686_create()
316 inst->alg.base.cra_ctxsize = sizeof(struct crypto_rfc3686_ctx); in crypto_rfc3686_create()
318 inst->alg.init = crypto_rfc3686_init_tfm; in crypto_rfc3686_create()
319 inst->alg.exit = crypto_rfc3686_exit_tfm; in crypto_rfc3686_create()
321 inst->free = crypto_rfc3686_free; in crypto_rfc3686_create()
323 err = skcipher_register_instance(tmpl, inst); in crypto_rfc3686_create()
326 crypto_rfc3686_free(inst); in crypto_rfc3686_create()