Lines Matching refs:alg
196 const struct hash_alg_common *alg = crypto_hash_alg_common(tfm); in ahash_set_needkey() local
199 !(alg->base.cra_flags & CRYPTO_ALG_OPTIONAL_KEY)) in ahash_set_needkey()
374 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_ahash_final() local
378 crypto_stats_get(alg); in crypto_ahash_final()
380 crypto_stats_ahash_final(nbytes, ret, alg); in crypto_ahash_final()
388 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_ahash_finup() local
392 crypto_stats_get(alg); in crypto_ahash_finup()
394 crypto_stats_ahash_final(nbytes, ret, alg); in crypto_ahash_finup()
402 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_ahash_digest() local
406 crypto_stats_get(alg); in crypto_ahash_digest()
411 crypto_stats_ahash_final(nbytes, ret, alg); in crypto_ahash_digest()
481 struct ahash_alg *alg = crypto_ahash_alg(hash); in crypto_ahash_init_tfm() local
488 hash->init = alg->init; in crypto_ahash_init_tfm()
489 hash->update = alg->update; in crypto_ahash_init_tfm()
490 hash->final = alg->final; in crypto_ahash_init_tfm()
491 hash->finup = alg->finup ?: ahash_def_finup; in crypto_ahash_init_tfm()
492 hash->digest = alg->digest; in crypto_ahash_init_tfm()
493 hash->export = alg->export; in crypto_ahash_init_tfm()
494 hash->import = alg->import; in crypto_ahash_init_tfm()
496 if (alg->setkey) { in crypto_ahash_init_tfm()
497 hash->setkey = alg->setkey; in crypto_ahash_init_tfm()
504 static unsigned int crypto_ahash_extsize(struct crypto_alg *alg) in crypto_ahash_extsize() argument
506 if (alg->cra_type != &crypto_ahash_type) in crypto_ahash_extsize()
509 return crypto_alg_extsize(alg); in crypto_ahash_extsize()
513 static int crypto_ahash_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_ahash_report() argument
521 rhash.blocksize = alg->cra_blocksize; in crypto_ahash_report()
522 rhash.digestsize = __crypto_hash_alg_common(alg)->digestsize; in crypto_ahash_report()
527 static int crypto_ahash_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_ahash_report() argument
533 static void crypto_ahash_show(struct seq_file *m, struct crypto_alg *alg)
535 static void crypto_ahash_show(struct seq_file *m, struct crypto_alg *alg) in crypto_ahash_show() argument
538 seq_printf(m, "async : %s\n", alg->cra_flags & CRYPTO_ALG_ASYNC ? in crypto_ahash_show()
540 seq_printf(m, "blocksize : %u\n", alg->cra_blocksize); in crypto_ahash_show()
542 __crypto_hash_alg_common(alg)->digestsize); in crypto_ahash_show()
572 static int ahash_prepare_alg(struct ahash_alg *alg) in ahash_prepare_alg() argument
574 struct crypto_alg *base = &alg->halg.base; in ahash_prepare_alg()
576 if (alg->halg.digestsize > HASH_MAX_DIGESTSIZE || in ahash_prepare_alg()
577 alg->halg.statesize > HASH_MAX_STATESIZE || in ahash_prepare_alg()
578 alg->halg.statesize == 0) in ahash_prepare_alg()
588 int crypto_register_ahash(struct ahash_alg *alg) in crypto_register_ahash() argument
590 struct crypto_alg *base = &alg->halg.base; in crypto_register_ahash()
593 err = ahash_prepare_alg(alg); in crypto_register_ahash()
601 int crypto_unregister_ahash(struct ahash_alg *alg) in crypto_unregister_ahash() argument
603 return crypto_unregister_alg(&alg->halg.base); in crypto_unregister_ahash()
641 err = ahash_prepare_alg(&inst->alg); in ahash_register_instance()
657 struct hash_alg_common *alg, in crypto_init_ahash_spawn() argument
660 return crypto_init_spawn2(&spawn->base, &alg->base, inst, in crypto_init_ahash_spawn()
667 struct crypto_alg *alg; in ahash_attr_alg() local
669 alg = crypto_attr_alg2(rta, &crypto_ahash_type, type, mask); in ahash_attr_alg()
670 return IS_ERR(alg) ? ERR_CAST(alg) : __crypto_hash_alg_common(alg); in ahash_attr_alg()
676 struct crypto_alg *alg = &halg->base; in crypto_hash_alg_has_setkey() local
678 if (alg->cra_type != &crypto_ahash_type) in crypto_hash_alg_has_setkey()
679 return crypto_shash_alg_has_setkey(__crypto_shash_alg(alg)); in crypto_hash_alg_has_setkey()
681 return __crypto_ahash_alg(alg)->setkey != NULL; in crypto_hash_alg_has_setkey()