Lines Matching refs:inst
225 struct aead_instance *inst = aead_alg_instance(tfm); in pcrypt_aead_init_tfm() local
226 struct pcrypt_instance_ctx *ictx = aead_instance_ctx(inst); in pcrypt_aead_init_tfm()
257 static void pcrypt_free(struct aead_instance *inst) in pcrypt_free() argument
259 struct pcrypt_instance_ctx *ctx = aead_instance_ctx(inst); in pcrypt_free()
262 kfree(inst); in pcrypt_free()
265 static int pcrypt_init_instance(struct crypto_instance *inst, in pcrypt_init_instance() argument
268 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in pcrypt_init_instance()
272 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in pcrypt_init_instance()
274 inst->alg.cra_priority = alg->cra_priority + 100; in pcrypt_init_instance()
275 inst->alg.cra_blocksize = alg->cra_blocksize; in pcrypt_init_instance()
276 inst->alg.cra_alignmask = alg->cra_alignmask; in pcrypt_init_instance()
286 struct aead_instance *inst; in pcrypt_create_aead() local
299 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in pcrypt_create_aead()
300 if (!inst) in pcrypt_create_aead()
303 ctx = aead_instance_ctx(inst); in pcrypt_create_aead()
304 crypto_set_aead_spawn(&ctx->spawn, aead_crypto_instance(inst)); in pcrypt_create_aead()
311 err = pcrypt_init_instance(aead_crypto_instance(inst), &alg->base); in pcrypt_create_aead()
315 inst->alg.base.cra_flags = CRYPTO_ALG_ASYNC; in pcrypt_create_aead()
317 inst->alg.ivsize = crypto_aead_alg_ivsize(alg); in pcrypt_create_aead()
318 inst->alg.maxauthsize = crypto_aead_alg_maxauthsize(alg); in pcrypt_create_aead()
320 inst->alg.base.cra_ctxsize = sizeof(struct pcrypt_aead_ctx); in pcrypt_create_aead()
322 inst->alg.init = pcrypt_aead_init_tfm; in pcrypt_create_aead()
323 inst->alg.exit = pcrypt_aead_exit_tfm; in pcrypt_create_aead()
325 inst->alg.setkey = pcrypt_aead_setkey; in pcrypt_create_aead()
326 inst->alg.setauthsize = pcrypt_aead_setauthsize; in pcrypt_create_aead()
327 inst->alg.encrypt = pcrypt_aead_encrypt; in pcrypt_create_aead()
328 inst->alg.decrypt = pcrypt_aead_decrypt; in pcrypt_create_aead()
330 inst->free = pcrypt_free; in pcrypt_create_aead()
332 err = aead_register_instance(tmpl, inst); in pcrypt_create_aead()
342 kfree(inst); in pcrypt_create_aead()