Lines Matching refs:alg

51 static void shash_set_needkey(struct crypto_shash *tfm, struct shash_alg *alg)  in shash_set_needkey()  argument
53 if (crypto_shash_alg_needs_key(alg)) in shash_set_needkey()
368 struct shash_alg *alg = __crypto_shash_alg(calg); in crypto_init_shash_ops_async() local
390 if (crypto_shash_alg_has_setkey(alg)) in crypto_init_shash_ops_async()
407 struct shash_alg *alg = crypto_shash_alg(hash); in crypto_shash_exit_tfm() local
409 alg->exit_tfm(hash); in crypto_shash_exit_tfm()
415 struct shash_alg *alg = crypto_shash_alg(hash); in crypto_shash_init_tfm() local
418 hash->descsize = alg->descsize; in crypto_shash_init_tfm()
420 shash_set_needkey(hash, alg); in crypto_shash_init_tfm()
422 if (alg->exit_tfm) in crypto_shash_init_tfm()
425 if (!alg->init_tfm) in crypto_shash_init_tfm()
428 err = alg->init_tfm(hash); in crypto_shash_init_tfm()
434 if (alg->exit_tfm) in crypto_shash_init_tfm()
435 alg->exit_tfm(hash); in crypto_shash_init_tfm()
450 static int crypto_shash_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_shash_report() argument
453 struct shash_alg *salg = __crypto_shash_alg(alg); in crypto_shash_report()
459 rhash.blocksize = alg->cra_blocksize; in crypto_shash_report()
465 static int crypto_shash_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_shash_report() argument
471 static void crypto_shash_show(struct seq_file *m, struct crypto_alg *alg)
473 static void crypto_shash_show(struct seq_file *m, struct crypto_alg *alg) in crypto_shash_show() argument
475 struct shash_alg *salg = __crypto_shash_alg(alg); in crypto_shash_show()
478 seq_printf(m, "blocksize : %u\n", alg->cra_blocksize); in crypto_shash_show()
512 static int shash_prepare_alg(struct shash_alg *alg) in shash_prepare_alg() argument
514 struct crypto_alg *base = &alg->base; in shash_prepare_alg()
516 if (alg->digestsize > HASH_MAX_DIGESTSIZE || in shash_prepare_alg()
517 alg->descsize > HASH_MAX_DESCSIZE || in shash_prepare_alg()
518 alg->statesize > HASH_MAX_STATESIZE) in shash_prepare_alg()
521 if ((alg->export && !alg->import) || (alg->import && !alg->export)) in shash_prepare_alg()
528 if (!alg->finup) in shash_prepare_alg()
529 alg->finup = shash_finup_unaligned; in shash_prepare_alg()
530 if (!alg->digest) in shash_prepare_alg()
531 alg->digest = shash_digest_unaligned; in shash_prepare_alg()
532 if (!alg->export) { in shash_prepare_alg()
533 alg->export = shash_default_export; in shash_prepare_alg()
534 alg->import = shash_default_import; in shash_prepare_alg()
535 alg->statesize = alg->descsize; in shash_prepare_alg()
537 if (!alg->setkey) in shash_prepare_alg()
538 alg->setkey = shash_no_setkey; in shash_prepare_alg()
543 int crypto_register_shash(struct shash_alg *alg) in crypto_register_shash() argument
545 struct crypto_alg *base = &alg->base; in crypto_register_shash()
548 err = shash_prepare_alg(alg); in crypto_register_shash()
556 void crypto_unregister_shash(struct shash_alg *alg) in crypto_unregister_shash() argument
558 crypto_unregister_alg(&alg->base); in crypto_unregister_shash()
599 err = shash_prepare_alg(&inst->alg); in shash_register_instance()