Lines Matching refs:inst
215 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in mcryptd_get_queue() local
216 struct mcryptd_instance_ctx *ictx = crypto_instance_ctx(inst); in mcryptd_get_queue()
225 struct crypto_instance *inst; in mcryptd_alloc_instance() local
228 p = kzalloc(head + sizeof(*inst) + tail, GFP_KERNEL); in mcryptd_alloc_instance()
232 inst = (void *)(p + head); in mcryptd_alloc_instance()
235 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in mcryptd_alloc_instance()
239 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in mcryptd_alloc_instance()
241 inst->alg.cra_priority = alg->cra_priority + 50; in mcryptd_alloc_instance()
242 inst->alg.cra_blocksize = alg->cra_blocksize; in mcryptd_alloc_instance()
243 inst->alg.cra_alignmask = alg->cra_alignmask; in mcryptd_alloc_instance()
274 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm); in mcryptd_hash_init_tfm() local
275 struct hashd_instance_ctx *ictx = crypto_instance_ctx(inst); in mcryptd_hash_init_tfm()
489 struct ahash_instance *inst; in mcryptd_create_hash() local
505 inst = mcryptd_alloc_instance(alg, ahash_instance_headroom(), in mcryptd_create_hash()
507 err = PTR_ERR(inst); in mcryptd_create_hash()
508 if (IS_ERR(inst)) in mcryptd_create_hash()
511 ctx = ahash_instance_ctx(inst); in mcryptd_create_hash()
515 ahash_crypto_instance(inst)); in mcryptd_create_hash()
519 inst->alg.halg.base.cra_flags = CRYPTO_ALG_ASYNC | in mcryptd_create_hash()
523 inst->alg.halg.digestsize = halg->digestsize; in mcryptd_create_hash()
524 inst->alg.halg.statesize = halg->statesize; in mcryptd_create_hash()
525 inst->alg.halg.base.cra_ctxsize = sizeof(struct mcryptd_hash_ctx); in mcryptd_create_hash()
527 inst->alg.halg.base.cra_init = mcryptd_hash_init_tfm; in mcryptd_create_hash()
528 inst->alg.halg.base.cra_exit = mcryptd_hash_exit_tfm; in mcryptd_create_hash()
530 inst->alg.init = mcryptd_hash_init_enqueue; in mcryptd_create_hash()
531 inst->alg.update = mcryptd_hash_update_enqueue; in mcryptd_create_hash()
532 inst->alg.final = mcryptd_hash_final_enqueue; in mcryptd_create_hash()
533 inst->alg.finup = mcryptd_hash_finup_enqueue; in mcryptd_create_hash()
534 inst->alg.export = mcryptd_hash_export; in mcryptd_create_hash()
535 inst->alg.import = mcryptd_hash_import; in mcryptd_create_hash()
537 inst->alg.setkey = mcryptd_hash_setkey; in mcryptd_create_hash()
538 inst->alg.digest = mcryptd_hash_digest_enqueue; in mcryptd_create_hash()
540 err = ahash_register_instance(tmpl, inst); in mcryptd_create_hash()
544 kfree(inst); in mcryptd_create_hash()
571 static void mcryptd_free(struct crypto_instance *inst) in mcryptd_free() argument
573 struct mcryptd_instance_ctx *ctx = crypto_instance_ctx(inst); in mcryptd_free()
574 struct hashd_instance_ctx *hctx = crypto_instance_ctx(inst); in mcryptd_free()
576 switch (inst->alg.cra_flags & CRYPTO_ALG_TYPE_MASK) { in mcryptd_free()
579 kfree(ahash_instance(inst)); in mcryptd_free()
583 kfree(inst); in mcryptd_free()