Lines Matching refs:alg
93 struct aead_alg *alg = crypto_aead_alg(aead); in crypto_aead_exit_tfm() local
95 alg->exit(aead); in crypto_aead_exit_tfm()
101 struct aead_alg *alg = crypto_aead_alg(aead); in crypto_aead_init_tfm() local
105 aead->authsize = alg->maxauthsize; in crypto_aead_init_tfm()
107 if (alg->exit) in crypto_aead_init_tfm()
110 if (alg->init) in crypto_aead_init_tfm()
111 return alg->init(aead); in crypto_aead_init_tfm()
117 static int crypto_aead_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_aead_report() argument
120 struct aead_alg *aead = container_of(alg, struct aead_alg, base); in crypto_aead_report()
125 raead.blocksize = alg->cra_blocksize; in crypto_aead_report()
138 static int crypto_aead_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_aead_report() argument
144 static void crypto_aead_show(struct seq_file *m, struct crypto_alg *alg)
146 static void crypto_aead_show(struct seq_file *m, struct crypto_alg *alg) in crypto_aead_show() argument
148 struct aead_alg *aead = container_of(alg, struct aead_alg, base); in crypto_aead_show()
151 seq_printf(m, "async : %s\n", alg->cra_flags & CRYPTO_ALG_ASYNC ? in crypto_aead_show()
153 seq_printf(m, "blocksize : %u\n", alg->cra_blocksize); in crypto_aead_show()
208 struct aead_alg *alg; in aead_geniv_alloc() local
238 alg = crypto_spawn_aead_alg(spawn); in aead_geniv_alloc()
240 ivsize = crypto_aead_alg_ivsize(alg); in aead_geniv_alloc()
241 maxauthsize = crypto_aead_alg_maxauthsize(alg); in aead_geniv_alloc()
248 if (snprintf(inst->alg.base.cra_name, CRYPTO_MAX_ALG_NAME, in aead_geniv_alloc()
249 "%s(%s)", tmpl->name, alg->base.cra_name) >= in aead_geniv_alloc()
252 if (snprintf(inst->alg.base.cra_driver_name, CRYPTO_MAX_ALG_NAME, in aead_geniv_alloc()
253 "%s(%s)", tmpl->name, alg->base.cra_driver_name) >= in aead_geniv_alloc()
257 inst->alg.base.cra_flags = alg->base.cra_flags & CRYPTO_ALG_ASYNC; in aead_geniv_alloc()
258 inst->alg.base.cra_priority = alg->base.cra_priority; in aead_geniv_alloc()
259 inst->alg.base.cra_blocksize = alg->base.cra_blocksize; in aead_geniv_alloc()
260 inst->alg.base.cra_alignmask = alg->base.cra_alignmask; in aead_geniv_alloc()
261 inst->alg.base.cra_ctxsize = sizeof(struct aead_geniv_ctx); in aead_geniv_alloc()
263 inst->alg.setkey = aead_geniv_setkey; in aead_geniv_alloc()
264 inst->alg.setauthsize = aead_geniv_setauthsize; in aead_geniv_alloc()
266 inst->alg.ivsize = ivsize; in aead_geniv_alloc()
267 inst->alg.maxauthsize = maxauthsize; in aead_geniv_alloc()
355 static int aead_prepare_alg(struct aead_alg *alg) in aead_prepare_alg() argument
357 struct crypto_alg *base = &alg->base; in aead_prepare_alg()
359 if (max3(alg->maxauthsize, alg->ivsize, alg->chunksize) > in aead_prepare_alg()
363 if (!alg->chunksize) in aead_prepare_alg()
364 alg->chunksize = base->cra_blocksize; in aead_prepare_alg()
373 int crypto_register_aead(struct aead_alg *alg) in crypto_register_aead() argument
375 struct crypto_alg *base = &alg->base; in crypto_register_aead()
378 err = aead_prepare_alg(alg); in crypto_register_aead()
386 void crypto_unregister_aead(struct aead_alg *alg) in crypto_unregister_aead() argument
388 crypto_unregister_alg(&alg->base); in crypto_unregister_aead()
426 err = aead_prepare_alg(&inst->alg); in aead_register_instance()