Lines Matching refs:alg

452 	struct ahash_alg *alg = crypto_ahash_alg(hash);  in crypto_ahash_init_tfm()  local
462 hash->init = alg->init; in crypto_ahash_init_tfm()
463 hash->update = alg->update; in crypto_ahash_init_tfm()
464 hash->final = alg->final; in crypto_ahash_init_tfm()
465 hash->finup = alg->finup ?: ahash_def_finup; in crypto_ahash_init_tfm()
466 hash->digest = alg->digest; in crypto_ahash_init_tfm()
468 if (alg->setkey) { in crypto_ahash_init_tfm()
469 hash->setkey = alg->setkey; in crypto_ahash_init_tfm()
472 if (alg->export) in crypto_ahash_init_tfm()
473 hash->export = alg->export; in crypto_ahash_init_tfm()
474 if (alg->import) in crypto_ahash_init_tfm()
475 hash->import = alg->import; in crypto_ahash_init_tfm()
480 static unsigned int crypto_ahash_extsize(struct crypto_alg *alg) in crypto_ahash_extsize() argument
482 if (alg->cra_type == &crypto_ahash_type) in crypto_ahash_extsize()
483 return alg->cra_ctxsize; in crypto_ahash_extsize()
489 static int crypto_ahash_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_ahash_report() argument
495 rhash.blocksize = alg->cra_blocksize; in crypto_ahash_report()
496 rhash.digestsize = __crypto_hash_alg_common(alg)->digestsize; in crypto_ahash_report()
507 static int crypto_ahash_report(struct sk_buff *skb, struct crypto_alg *alg) in crypto_ahash_report() argument
513 static void crypto_ahash_show(struct seq_file *m, struct crypto_alg *alg)
515 static void crypto_ahash_show(struct seq_file *m, struct crypto_alg *alg) in crypto_ahash_show() argument
518 seq_printf(m, "async : %s\n", alg->cra_flags & CRYPTO_ALG_ASYNC ? in crypto_ahash_show()
520 seq_printf(m, "blocksize : %u\n", alg->cra_blocksize); in crypto_ahash_show()
522 __crypto_hash_alg_common(alg)->digestsize); in crypto_ahash_show()
546 static int ahash_prepare_alg(struct ahash_alg *alg) in ahash_prepare_alg() argument
548 struct crypto_alg *base = &alg->halg.base; in ahash_prepare_alg()
550 if (alg->halg.digestsize > PAGE_SIZE / 8 || in ahash_prepare_alg()
551 alg->halg.statesize > PAGE_SIZE / 8 || in ahash_prepare_alg()
552 alg->halg.statesize == 0) in ahash_prepare_alg()
562 int crypto_register_ahash(struct ahash_alg *alg) in crypto_register_ahash() argument
564 struct crypto_alg *base = &alg->halg.base; in crypto_register_ahash()
567 err = ahash_prepare_alg(alg); in crypto_register_ahash()
575 int crypto_unregister_ahash(struct ahash_alg *alg) in crypto_unregister_ahash() argument
577 return crypto_unregister_alg(&alg->halg.base); in crypto_unregister_ahash()
586 err = ahash_prepare_alg(&inst->alg); in ahash_register_instance()
602 struct hash_alg_common *alg, in crypto_init_ahash_spawn() argument
605 return crypto_init_spawn2(&spawn->base, &alg->base, inst, in crypto_init_ahash_spawn()
612 struct crypto_alg *alg; in ahash_attr_alg() local
614 alg = crypto_attr_alg2(rta, &crypto_ahash_type, type, mask); in ahash_attr_alg()
615 return IS_ERR(alg) ? ERR_CAST(alg) : __crypto_hash_alg_common(alg); in ahash_attr_alg()