Lines Matching refs:alg

165 	const struct hash_alg_common *alg = crypto_hash_alg_common(tfm);  in ahash_set_needkey()  local
168 !(alg->base.cra_flags & CRYPTO_ALG_OPTIONAL_KEY)) in ahash_set_needkey()
343 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_ahash_final() local
347 crypto_stats_get(alg); in crypto_ahash_final()
349 crypto_stats_ahash_final(nbytes, ret, alg); in crypto_ahash_final()
357 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_ahash_finup() local
361 crypto_stats_get(alg); in crypto_ahash_finup()
363 crypto_stats_ahash_final(nbytes, ret, alg); in crypto_ahash_finup()
371 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_ahash_digest() local
375 crypto_stats_get(alg); in crypto_ahash_digest()
380 crypto_stats_ahash_final(nbytes, ret, alg); in crypto_ahash_digest()
450 struct ahash_alg *alg = crypto_ahash_alg(hash); in crypto_ahash_exit_tfm() local
452 alg->exit_tfm(hash); in crypto_ahash_exit_tfm()
458 struct ahash_alg *alg = crypto_ahash_alg(hash); in crypto_ahash_init_tfm() local
465 hash->init = alg->init; in crypto_ahash_init_tfm()
466 hash->update = alg->update; in crypto_ahash_init_tfm()
467 hash->final = alg->final; in crypto_ahash_init_tfm()
468 hash->finup = alg->finup ?: ahash_def_finup; in crypto_ahash_init_tfm()
469 hash->digest = alg->digest; in crypto_ahash_init_tfm()
470 hash->export = alg->export; in crypto_ahash_init_tfm()
471 hash->import = alg->import; in crypto_ahash_init_tfm()
473 if (alg->setkey) { in crypto_ahash_init_tfm()
474 hash->setkey = alg->setkey; in crypto_ahash_init_tfm()
478 if (alg->exit_tfm) in crypto_ahash_init_tfm()
481 return alg->init_tfm ? alg->init_tfm(hash) : 0; in crypto_ahash_init_tfm()
484 static unsigned int crypto_ahash_extsize(struct crypto_alg *alg) in crypto_ahash_extsize() argument
486 if (alg->cra_type != &crypto_ahash_type) in crypto_ahash_extsize()
489 return crypto_alg_extsize(alg); in crypto_ahash_extsize()
500 static int crypto_ahash_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_ahash_report() argument
508 rhash.blocksize = alg->cra_blocksize; in crypto_ahash_report()
509 rhash.digestsize = __crypto_hash_alg_common(alg)->digestsize; in crypto_ahash_report()
514 static int crypto_ahash_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_ahash_report() argument
520 static void crypto_ahash_show(struct seq_file *m, struct crypto_alg *alg)
522 static void crypto_ahash_show(struct seq_file *m, struct crypto_alg *alg) in crypto_ahash_show() argument
525 seq_printf(m, "async : %s\n", alg->cra_flags & CRYPTO_ALG_ASYNC ? in crypto_ahash_show()
527 seq_printf(m, "blocksize : %u\n", alg->cra_blocksize); in crypto_ahash_show()
529 __crypto_hash_alg_common(alg)->digestsize); in crypto_ahash_show()
568 static int ahash_prepare_alg(struct ahash_alg *alg) in ahash_prepare_alg() argument
570 struct crypto_alg *base = &alg->halg.base; in ahash_prepare_alg()
572 if (alg->halg.digestsize > HASH_MAX_DIGESTSIZE || in ahash_prepare_alg()
573 alg->halg.statesize > HASH_MAX_STATESIZE || in ahash_prepare_alg()
574 alg->halg.statesize == 0) in ahash_prepare_alg()
584 int crypto_register_ahash(struct ahash_alg *alg) in crypto_register_ahash() argument
586 struct crypto_alg *base = &alg->halg.base; in crypto_register_ahash()
589 err = ahash_prepare_alg(alg); in crypto_register_ahash()
597 void crypto_unregister_ahash(struct ahash_alg *alg) in crypto_unregister_ahash() argument
599 crypto_unregister_alg(&alg->halg.base); in crypto_unregister_ahash()
640 err = ahash_prepare_alg(&inst->alg); in ahash_register_instance()
650 struct crypto_alg *alg = &halg->base; in crypto_hash_alg_has_setkey() local
652 if (alg->cra_type != &crypto_ahash_type) in crypto_hash_alg_has_setkey()
653 return crypto_shash_alg_has_setkey(__crypto_shash_alg(alg)); in crypto_hash_alg_has_setkey()
655 return __crypto_ahash_alg(alg)->setkey != NULL; in crypto_hash_alg_has_setkey()