Lines Matching defs:inst
140 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm);
141 struct cryptd_instance_ctx *ictx = crypto_instance_ctx(inst);
235 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm);
236 struct cryptd_instance_ctx *ictx = crypto_instance_ctx(inst);
262 struct crypto_instance *inst;
265 p = kzalloc(head + sizeof(*inst) + tail, GFP_KERNEL);
269 inst = (void *)(p + head);
272 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME,
276 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME);
278 inst->alg.cra_priority = alg->cra_priority + 50;
279 inst->alg.cra_blocksize = alg->cra_blocksize;
280 inst->alg.cra_alignmask = alg->cra_alignmask;
296 struct crypto_instance *inst;
305 inst = cryptd_alloc_instance(alg, 0, sizeof(*ctx));
306 err = PTR_ERR(inst);
307 if (IS_ERR(inst))
310 ctx = crypto_instance_ctx(inst);
313 err = crypto_init_spawn(&ctx->spawn, alg, inst,
318 inst->alg.cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC;
319 inst->alg.cra_type = &crypto_ablkcipher_type;
321 inst->alg.cra_ablkcipher.ivsize = alg->cra_blkcipher.ivsize;
322 inst->alg.cra_ablkcipher.min_keysize = alg->cra_blkcipher.min_keysize;
323 inst->alg.cra_ablkcipher.max_keysize = alg->cra_blkcipher.max_keysize;
325 inst->alg.cra_ablkcipher.geniv = alg->cra_blkcipher.geniv;
327 inst->alg.cra_ctxsize = sizeof(struct cryptd_blkcipher_ctx);
329 inst->alg.cra_init = cryptd_blkcipher_init_tfm;
330 inst->alg.cra_exit = cryptd_blkcipher_exit_tfm;
332 inst->alg.cra_ablkcipher.setkey = cryptd_blkcipher_setkey;
333 inst->alg.cra_ablkcipher.encrypt = cryptd_blkcipher_encrypt_enqueue;
334 inst->alg.cra_ablkcipher.decrypt = cryptd_blkcipher_decrypt_enqueue;
336 err = crypto_register_instance(tmpl, inst);
340 kfree(inst);
350 struct crypto_instance *inst = crypto_tfm_alg_instance(tfm);
351 struct hashd_instance_ctx *ictx = crypto_instance_ctx(inst);
551 struct ahash_instance *inst;
561 inst = cryptd_alloc_instance(alg, ahash_instance_headroom(),
563 err = PTR_ERR(inst);
564 if (IS_ERR(inst))
567 ctx = ahash_instance_ctx(inst);
571 ahash_crypto_instance(inst));
575 inst->alg.halg.base.cra_flags = CRYPTO_ALG_ASYNC;
577 inst->alg.halg.digestsize = salg->digestsize;
578 inst->alg.halg.base.cra_ctxsize = sizeof(struct cryptd_hash_ctx);
580 inst->alg.halg.base.cra_init = cryptd_hash_init_tfm;
581 inst->alg.halg.base.cra_exit = cryptd_hash_exit_tfm;
583 inst->alg.init = cryptd_hash_init_enqueue;
584 inst->alg.update = cryptd_hash_update_enqueue;
585 inst->alg.final = cryptd_hash_final_enqueue;
586 inst->alg.finup = cryptd_hash_finup_enqueue;
587 inst->alg.export = cryptd_hash_export;
588 inst->alg.import = cryptd_hash_import;
589 inst->alg.setkey = cryptd_hash_setkey;
590 inst->alg.digest = cryptd_hash_digest_enqueue;
592 err = ahash_register_instance(tmpl, inst);
596 kfree(inst);
624 static void cryptd_free(struct crypto_instance *inst)
626 struct cryptd_instance_ctx *ctx = crypto_instance_ctx(inst);
627 struct hashd_instance_ctx *hctx = crypto_instance_ctx(inst);
629 switch (inst->alg.cra_flags & CRYPTO_ALG_TYPE_MASK) {
632 kfree(ahash_instance(inst));
637 kfree(inst);