Lines Matching refs:alg

158 	const struct hash_alg_common *alg = crypto_hash_alg_common(tfm);  in ahash_set_needkey()  local
161 !(alg->base.cra_flags & CRYPTO_ALG_OPTIONAL_KEY)) in ahash_set_needkey()
305 struct hash_alg_common *alg = crypto_hash_alg_common(tfm); in crypto_ahash_final() local
308 atomic64_inc(&hash_get_stat(alg)->hash_cnt); in crypto_ahash_final()
317 struct hash_alg_common *alg = crypto_hash_alg_common(tfm); in crypto_ahash_finup() local
320 struct crypto_istat_hash *istat = hash_get_stat(alg); in crypto_ahash_finup()
333 struct hash_alg_common *alg = crypto_hash_alg_common(tfm); in crypto_ahash_digest() local
336 struct crypto_istat_hash *istat = hash_get_stat(alg); in crypto_ahash_digest()
343 return crypto_hash_errstat(alg, -ENOKEY); in crypto_ahash_digest()
417 struct ahash_alg *alg = crypto_ahash_alg(hash); in crypto_ahash_exit_tfm() local
419 alg->exit_tfm(hash); in crypto_ahash_exit_tfm()
425 struct ahash_alg *alg = crypto_ahash_alg(hash); in crypto_ahash_init_tfm() local
429 crypto_ahash_set_statesize(hash, alg->halg.statesize); in crypto_ahash_init_tfm()
434 hash->init = alg->init; in crypto_ahash_init_tfm()
435 hash->update = alg->update; in crypto_ahash_init_tfm()
436 hash->final = alg->final; in crypto_ahash_init_tfm()
437 hash->finup = alg->finup ?: ahash_def_finup; in crypto_ahash_init_tfm()
438 hash->digest = alg->digest; in crypto_ahash_init_tfm()
439 hash->export = alg->export; in crypto_ahash_init_tfm()
440 hash->import = alg->import; in crypto_ahash_init_tfm()
442 if (alg->setkey) { in crypto_ahash_init_tfm()
443 hash->setkey = alg->setkey; in crypto_ahash_init_tfm()
447 if (alg->exit_tfm) in crypto_ahash_init_tfm()
450 return alg->init_tfm ? alg->init_tfm(hash) : 0; in crypto_ahash_init_tfm()
453 static unsigned int crypto_ahash_extsize(struct crypto_alg *alg) in crypto_ahash_extsize() argument
455 if (alg->cra_type != &crypto_ahash_type) in crypto_ahash_extsize()
458 return crypto_alg_extsize(alg); in crypto_ahash_extsize()
469 struct sk_buff *skb, struct crypto_alg *alg) in crypto_ahash_report() argument
477 rhash.blocksize = alg->cra_blocksize; in crypto_ahash_report()
478 rhash.digestsize = __crypto_hash_alg_common(alg)->digestsize; in crypto_ahash_report()
483 static void crypto_ahash_show(struct seq_file *m, struct crypto_alg *alg)
485 static void crypto_ahash_show(struct seq_file *m, struct crypto_alg *alg) in crypto_ahash_show() argument
488 seq_printf(m, "async : %s\n", alg->cra_flags & CRYPTO_ALG_ASYNC ? in crypto_ahash_show()
490 seq_printf(m, "blocksize : %u\n", alg->cra_blocksize); in crypto_ahash_show()
492 __crypto_hash_alg_common(alg)->digestsize); in crypto_ahash_show()
496 struct sk_buff *skb, struct crypto_alg *alg) in crypto_ahash_report_stat() argument
498 return crypto_hash_report_stat(skb, alg, "ahash"); in crypto_ahash_report_stat()
547 struct ahash_alg *alg; in crypto_clone_ahash() local
578 alg = crypto_ahash_alg(hash); in crypto_clone_ahash()
579 if (!alg->clone_tfm) in crypto_clone_ahash()
582 err = alg->clone_tfm(nhash, hash); in crypto_clone_ahash()
594 static int ahash_prepare_alg(struct ahash_alg *alg) in ahash_prepare_alg() argument
596 struct crypto_alg *base = &alg->halg.base; in ahash_prepare_alg()
599 if (alg->halg.statesize == 0) in ahash_prepare_alg()
602 err = hash_prepare_alg(&alg->halg); in ahash_prepare_alg()
612 int crypto_register_ahash(struct ahash_alg *alg) in crypto_register_ahash() argument
614 struct crypto_alg *base = &alg->halg.base; in crypto_register_ahash()
617 err = ahash_prepare_alg(alg); in crypto_register_ahash()
625 void crypto_unregister_ahash(struct ahash_alg *alg) in crypto_unregister_ahash() argument
627 crypto_unregister_alg(&alg->halg.base); in crypto_unregister_ahash()
668 err = ahash_prepare_alg(&inst->alg); in ahash_register_instance()
678 struct crypto_alg *alg = &halg->base; in crypto_hash_alg_has_setkey() local
680 if (alg->cra_type != &crypto_ahash_type) in crypto_hash_alg_has_setkey()
681 return crypto_shash_alg_has_setkey(__crypto_shash_alg(alg)); in crypto_hash_alg_has_setkey()
683 return __crypto_ahash_alg(alg)->setkey != NULL; in crypto_hash_alg_has_setkey()