• Home
  • Raw
  • Download

Lines Matching refs:inst

178 	struct aead_instance *inst = aead_alg_instance(tfm);  in pcrypt_aead_init_tfm()  local
179 struct pcrypt_instance_ctx *ictx = aead_instance_ctx(inst); in pcrypt_aead_init_tfm()
210 static void pcrypt_free(struct aead_instance *inst) in pcrypt_free() argument
212 struct pcrypt_instance_ctx *ctx = aead_instance_ctx(inst); in pcrypt_free()
217 kfree(inst); in pcrypt_free()
220 static int pcrypt_init_instance(struct crypto_instance *inst, in pcrypt_init_instance() argument
223 if (snprintf(inst->alg.cra_driver_name, CRYPTO_MAX_ALG_NAME, in pcrypt_init_instance()
227 memcpy(inst->alg.cra_name, alg->cra_name, CRYPTO_MAX_ALG_NAME); in pcrypt_init_instance()
229 inst->alg.cra_priority = alg->cra_priority + 100; in pcrypt_init_instance()
230 inst->alg.cra_blocksize = alg->cra_blocksize; in pcrypt_init_instance()
231 inst->alg.cra_alignmask = alg->cra_alignmask; in pcrypt_init_instance()
240 struct aead_instance *inst; in pcrypt_create_aead() local
245 inst = kzalloc(sizeof(*inst) + sizeof(*ctx), GFP_KERNEL); in pcrypt_create_aead()
246 if (!inst) in pcrypt_create_aead()
251 ctx = aead_instance_ctx(inst); in pcrypt_create_aead()
260 err = crypto_grab_aead(&ctx->spawn, aead_crypto_instance(inst), in pcrypt_create_aead()
266 err = pcrypt_init_instance(aead_crypto_instance(inst), &alg->base); in pcrypt_create_aead()
270 inst->alg.base.cra_flags |= CRYPTO_ALG_ASYNC; in pcrypt_create_aead()
272 inst->alg.ivsize = crypto_aead_alg_ivsize(alg); in pcrypt_create_aead()
273 inst->alg.maxauthsize = crypto_aead_alg_maxauthsize(alg); in pcrypt_create_aead()
275 inst->alg.base.cra_ctxsize = sizeof(struct pcrypt_aead_ctx); in pcrypt_create_aead()
277 inst->alg.init = pcrypt_aead_init_tfm; in pcrypt_create_aead()
278 inst->alg.exit = pcrypt_aead_exit_tfm; in pcrypt_create_aead()
280 inst->alg.setkey = pcrypt_aead_setkey; in pcrypt_create_aead()
281 inst->alg.setauthsize = pcrypt_aead_setauthsize; in pcrypt_create_aead()
282 inst->alg.encrypt = pcrypt_aead_encrypt; in pcrypt_create_aead()
283 inst->alg.decrypt = pcrypt_aead_decrypt; in pcrypt_create_aead()
285 inst->free = pcrypt_free; in pcrypt_create_aead()
287 err = aead_register_instance(tmpl, inst); in pcrypt_create_aead()
290 pcrypt_free(inst); in pcrypt_create_aead()