diff options
Diffstat (limited to 'crypto')
| -rw-r--r-- | crypto/shash.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/crypto/shash.c b/crypto/shash.c index 32067f47e6c7..f426330f1017 100644 --- a/crypto/shash.c +++ b/crypto/shash.c | |||
| @@ -629,6 +629,42 @@ int crypto_unregister_shash(struct shash_alg *alg) | |||
| 629 | } | 629 | } |
| 630 | EXPORT_SYMBOL_GPL(crypto_unregister_shash); | 630 | EXPORT_SYMBOL_GPL(crypto_unregister_shash); |
| 631 | 631 | ||
| 632 | int crypto_register_shashes(struct shash_alg *algs, int count) | ||
| 633 | { | ||
| 634 | int i, ret; | ||
| 635 | |||
| 636 | for (i = 0; i < count; i++) { | ||
| 637 | ret = crypto_register_shash(&algs[i]); | ||
| 638 | if (ret) | ||
| 639 | goto err; | ||
| 640 | } | ||
| 641 | |||
| 642 | return 0; | ||
| 643 | |||
| 644 | err: | ||
| 645 | for (--i; i >= 0; --i) | ||
| 646 | crypto_unregister_shash(&algs[i]); | ||
| 647 | |||
| 648 | return ret; | ||
| 649 | } | ||
| 650 | EXPORT_SYMBOL_GPL(crypto_register_shashes); | ||
| 651 | |||
| 652 | int crypto_unregister_shashes(struct shash_alg *algs, int count) | ||
| 653 | { | ||
| 654 | int i, ret; | ||
| 655 | |||
| 656 | for (i = count - 1; i >= 0; --i) { | ||
| 657 | ret = crypto_unregister_shash(&algs[i]); | ||
| 658 | if (ret) | ||
| 659 | pr_err("Failed to unregister %s %s: %d\n", | ||
| 660 | algs[i].base.cra_driver_name, | ||
| 661 | algs[i].base.cra_name, ret); | ||
| 662 | } | ||
| 663 | |||
| 664 | return 0; | ||
| 665 | } | ||
| 666 | EXPORT_SYMBOL_GPL(crypto_unregister_shashes); | ||
| 667 | |||
| 632 | int shash_register_instance(struct crypto_template *tmpl, | 668 | int shash_register_instance(struct crypto_template *tmpl, |
| 633 | struct shash_instance *inst) | 669 | struct shash_instance *inst) |
| 634 | { | 670 | { |
