Lines Matching refs:alg

36 bool crypto_shash_alg_has_setkey(struct shash_alg *alg)  in crypto_shash_alg_has_setkey()  argument
38 return alg->setkey != shash_no_setkey; in crypto_shash_alg_has_setkey()
63 static void shash_set_needkey(struct crypto_shash *tfm, struct shash_alg *alg) in shash_set_needkey() argument
65 if (crypto_shash_alg_needs_key(alg)) in shash_set_needkey()
380 struct shash_alg *alg = __crypto_shash_alg(calg); in crypto_init_shash_ops_async() local
402 if (crypto_shash_alg_has_setkey(alg)) in crypto_init_shash_ops_async()
419 struct shash_alg *alg = crypto_shash_alg(hash); in crypto_shash_exit_tfm() local
421 alg->exit_tfm(hash); in crypto_shash_exit_tfm()
427 struct shash_alg *alg = crypto_shash_alg(hash); in crypto_shash_init_tfm() local
430 hash->descsize = alg->descsize; in crypto_shash_init_tfm()
432 shash_set_needkey(hash, alg); in crypto_shash_init_tfm()
434 if (alg->exit_tfm) in crypto_shash_init_tfm()
437 if (!alg->init_tfm) in crypto_shash_init_tfm()
440 err = alg->init_tfm(hash); in crypto_shash_init_tfm()
446 if (alg->exit_tfm) in crypto_shash_init_tfm()
447 alg->exit_tfm(hash); in crypto_shash_init_tfm()
462 static int crypto_shash_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_shash_report() argument
465 struct shash_alg *salg = __crypto_shash_alg(alg); in crypto_shash_report()
471 rhash.blocksize = alg->cra_blocksize; in crypto_shash_report()
477 static int crypto_shash_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_shash_report() argument
483 static void crypto_shash_show(struct seq_file *m, struct crypto_alg *alg)
485 static void crypto_shash_show(struct seq_file *m, struct crypto_alg *alg) in crypto_shash_show() argument
487 struct shash_alg *salg = __crypto_shash_alg(alg); in crypto_shash_show()
490 seq_printf(m, "blocksize : %u\n", alg->cra_blocksize); in crypto_shash_show()
524 static int shash_prepare_alg(struct shash_alg *alg) in shash_prepare_alg() argument
526 struct crypto_alg *base = &alg->base; in shash_prepare_alg()
528 if (alg->digestsize > HASH_MAX_DIGESTSIZE || in shash_prepare_alg()
529 alg->descsize > HASH_MAX_DESCSIZE || in shash_prepare_alg()
530 alg->statesize > HASH_MAX_STATESIZE) in shash_prepare_alg()
533 if ((alg->export && !alg->import) || (alg->import && !alg->export)) in shash_prepare_alg()
540 if (!alg->finup) in shash_prepare_alg()
541 alg->finup = shash_finup_unaligned; in shash_prepare_alg()
542 if (!alg->digest) in shash_prepare_alg()
543 alg->digest = shash_digest_unaligned; in shash_prepare_alg()
544 if (!alg->export) { in shash_prepare_alg()
545 alg->export = shash_default_export; in shash_prepare_alg()
546 alg->import = shash_default_import; in shash_prepare_alg()
547 alg->statesize = alg->descsize; in shash_prepare_alg()
549 if (!alg->setkey) in shash_prepare_alg()
550 alg->setkey = shash_no_setkey; in shash_prepare_alg()
555 int crypto_register_shash(struct shash_alg *alg) in crypto_register_shash() argument
557 struct crypto_alg *base = &alg->base; in crypto_register_shash()
560 err = shash_prepare_alg(alg); in crypto_register_shash()
568 void crypto_unregister_shash(struct shash_alg *alg) in crypto_unregister_shash() argument
570 crypto_unregister_alg(&alg->base); in crypto_unregister_shash()
611 err = shash_prepare_alg(&inst->alg); in shash_register_instance()