Lines Matching defs:alg

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