Lines Matching refs:alg

26 static void shash_set_needkey(struct crypto_shash *tfm, struct shash_alg *alg)  in shash_set_needkey()  argument
28 if (crypto_shash_alg_needs_key(alg)) in shash_set_needkey()
147 struct shash_alg *alg = crypto_shash_alg(hash); in crypto_shash_exit_tfm() local
149 alg->exit_tfm(hash); in crypto_shash_exit_tfm()
155 struct shash_alg *alg = crypto_shash_alg(hash); in crypto_shash_init_tfm() local
158 hash->descsize = alg->descsize; in crypto_shash_init_tfm()
160 shash_set_needkey(hash, alg); in crypto_shash_init_tfm()
162 if (alg->exit_tfm) in crypto_shash_init_tfm()
165 if (!alg->init_tfm) in crypto_shash_init_tfm()
168 err = alg->init_tfm(hash); in crypto_shash_init_tfm()
174 if (alg->exit_tfm) in crypto_shash_init_tfm()
175 alg->exit_tfm(hash); in crypto_shash_init_tfm()
190 struct sk_buff *skb, struct crypto_alg *alg) in crypto_shash_report() argument
193 struct shash_alg *salg = __crypto_shash_alg(alg); in crypto_shash_report()
199 rhash.blocksize = alg->cra_blocksize; in crypto_shash_report()
205 static void crypto_shash_show(struct seq_file *m, struct crypto_alg *alg)
207 static void crypto_shash_show(struct seq_file *m, struct crypto_alg *alg) in crypto_shash_show() argument
209 struct shash_alg *salg = __crypto_shash_alg(alg); in crypto_shash_show()
212 seq_printf(m, "blocksize : %u\n", alg->cra_blocksize); in crypto_shash_show()
257 struct shash_alg *alg = crypto_shash_alg(hash); in crypto_clone_shash() local
261 if (!crypto_shash_alg_has_setkey(alg)) { in crypto_clone_shash()
269 if (!alg->clone_tfm && (alg->init_tfm || alg->base.cra_init)) in crypto_clone_shash()
278 if (alg->clone_tfm) { in crypto_clone_shash()
279 err = alg->clone_tfm(nhash, hash); in crypto_clone_shash()
290 int hash_prepare_alg(struct hash_alg_common *alg) in hash_prepare_alg() argument
292 struct crypto_alg *base = &alg->base; in hash_prepare_alg()
294 if (alg->digestsize > HASH_MAX_DIGESTSIZE) in hash_prepare_alg()
306 static int shash_prepare_alg(struct shash_alg *alg) in shash_prepare_alg() argument
308 struct crypto_alg *base = &alg->halg.base; in shash_prepare_alg()
311 if (alg->descsize > HASH_MAX_DESCSIZE) in shash_prepare_alg()
314 if ((alg->export && !alg->import) || (alg->import && !alg->export)) in shash_prepare_alg()
317 err = hash_prepare_alg(&alg->halg); in shash_prepare_alg()
335 if (!alg->finup) in shash_prepare_alg()
336 alg->finup = shash_default_finup; in shash_prepare_alg()
337 if (!alg->digest) in shash_prepare_alg()
338 alg->digest = shash_default_digest; in shash_prepare_alg()
339 if (!alg->export) in shash_prepare_alg()
340 alg->halg.statesize = alg->descsize; in shash_prepare_alg()
341 if (!alg->setkey) in shash_prepare_alg()
342 alg->setkey = shash_no_setkey; in shash_prepare_alg()
347 int crypto_register_shash(struct shash_alg *alg) in crypto_register_shash() argument
349 struct crypto_alg *base = &alg->base; in crypto_register_shash()
352 err = shash_prepare_alg(alg); in crypto_register_shash()
360 void crypto_unregister_shash(struct shash_alg *alg) in crypto_unregister_shash() argument
362 crypto_unregister_alg(&alg->base); in crypto_unregister_shash()
403 err = shash_prepare_alg(&inst->alg); in shash_register_instance()