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()
309 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_ahash_final() local
313 crypto_stats_get(alg); in crypto_ahash_final()
315 crypto_stats_ahash_final(nbytes, ret, alg); in crypto_ahash_final()
323 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_ahash_finup() local
327 crypto_stats_get(alg); in crypto_ahash_finup()
329 crypto_stats_ahash_final(nbytes, ret, alg); in crypto_ahash_finup()
337 struct crypto_alg *alg = tfm->base.__crt_alg; in crypto_ahash_digest() local
341 crypto_stats_get(alg); in crypto_ahash_digest()
346 crypto_stats_ahash_final(nbytes, ret, alg); in crypto_ahash_digest()
419 struct ahash_alg *alg = crypto_ahash_alg(hash); in crypto_ahash_exit_tfm() local
421 alg->exit_tfm(hash); in crypto_ahash_exit_tfm()
427 struct ahash_alg *alg = crypto_ahash_alg(hash); in crypto_ahash_init_tfm() local
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 static int crypto_ahash_report(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 int crypto_ahash_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_ahash_report() argument
489 static void crypto_ahash_show(struct seq_file *m, struct crypto_alg *alg)
491 static void crypto_ahash_show(struct seq_file *m, struct crypto_alg *alg) in crypto_ahash_show() argument
494 seq_printf(m, "async : %s\n", alg->cra_flags & CRYPTO_ALG_ASYNC ? in crypto_ahash_show()
496 seq_printf(m, "blocksize : %u\n", alg->cra_blocksize); in crypto_ahash_show()
498 __crypto_hash_alg_common(alg)->digestsize); in crypto_ahash_show()
537 static int ahash_prepare_alg(struct ahash_alg *alg) in ahash_prepare_alg() argument
539 struct crypto_alg *base = &alg->halg.base; in ahash_prepare_alg()
541 if (alg->halg.digestsize > HASH_MAX_DIGESTSIZE || in ahash_prepare_alg()
542 alg->halg.statesize > HASH_MAX_STATESIZE || in ahash_prepare_alg()
543 alg->halg.statesize == 0) in ahash_prepare_alg()
553 int crypto_register_ahash(struct ahash_alg *alg) in crypto_register_ahash() argument
555 struct crypto_alg *base = &alg->halg.base; in crypto_register_ahash()
558 err = ahash_prepare_alg(alg); in crypto_register_ahash()
566 void crypto_unregister_ahash(struct ahash_alg *alg) in crypto_unregister_ahash() argument
568 crypto_unregister_alg(&alg->halg.base); in crypto_unregister_ahash()
609 err = ahash_prepare_alg(&inst->alg); in ahash_register_instance()
619 struct crypto_alg *alg = &halg->base; in crypto_hash_alg_has_setkey() local
621 if (alg->cra_type != &crypto_ahash_type) in crypto_hash_alg_has_setkey()
622 return crypto_shash_alg_has_setkey(__crypto_shash_alg(alg)); in crypto_hash_alg_has_setkey()
624 return __crypto_ahash_alg(alg)->setkey != NULL; in crypto_hash_alg_has_setkey()