diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /crypto/tgr192.c | |
parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) |
Patched in Tegra support.
Diffstat (limited to 'crypto/tgr192.c')
-rw-r--r-- | crypto/tgr192.c | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/crypto/tgr192.c b/crypto/tgr192.c index 87403556fd0..cbca4f208c9 100644 --- a/crypto/tgr192.c +++ b/crypto/tgr192.c | |||
@@ -628,7 +628,7 @@ static int tgr128_final(struct shash_desc *desc, u8 * out) | |||
628 | return 0; | 628 | return 0; |
629 | } | 629 | } |
630 | 630 | ||
631 | static struct shash_alg tgr_algs[3] = { { | 631 | static struct shash_alg tgr192 = { |
632 | .digestsize = TGR192_DIGEST_SIZE, | 632 | .digestsize = TGR192_DIGEST_SIZE, |
633 | .init = tgr192_init, | 633 | .init = tgr192_init, |
634 | .update = tgr192_update, | 634 | .update = tgr192_update, |
@@ -640,7 +640,9 @@ static struct shash_alg tgr_algs[3] = { { | |||
640 | .cra_blocksize = TGR192_BLOCK_SIZE, | 640 | .cra_blocksize = TGR192_BLOCK_SIZE, |
641 | .cra_module = THIS_MODULE, | 641 | .cra_module = THIS_MODULE, |
642 | } | 642 | } |
643 | }, { | 643 | }; |
644 | |||
645 | static struct shash_alg tgr160 = { | ||
644 | .digestsize = TGR160_DIGEST_SIZE, | 646 | .digestsize = TGR160_DIGEST_SIZE, |
645 | .init = tgr192_init, | 647 | .init = tgr192_init, |
646 | .update = tgr192_update, | 648 | .update = tgr192_update, |
@@ -652,7 +654,9 @@ static struct shash_alg tgr_algs[3] = { { | |||
652 | .cra_blocksize = TGR192_BLOCK_SIZE, | 654 | .cra_blocksize = TGR192_BLOCK_SIZE, |
653 | .cra_module = THIS_MODULE, | 655 | .cra_module = THIS_MODULE, |
654 | } | 656 | } |
655 | }, { | 657 | }; |
658 | |||
659 | static struct shash_alg tgr128 = { | ||
656 | .digestsize = TGR128_DIGEST_SIZE, | 660 | .digestsize = TGR128_DIGEST_SIZE, |
657 | .init = tgr192_init, | 661 | .init = tgr192_init, |
658 | .update = tgr192_update, | 662 | .update = tgr192_update, |
@@ -664,16 +668,38 @@ static struct shash_alg tgr_algs[3] = { { | |||
664 | .cra_blocksize = TGR192_BLOCK_SIZE, | 668 | .cra_blocksize = TGR192_BLOCK_SIZE, |
665 | .cra_module = THIS_MODULE, | 669 | .cra_module = THIS_MODULE, |
666 | } | 670 | } |
667 | } }; | 671 | }; |
668 | 672 | ||
669 | static int __init tgr192_mod_init(void) | 673 | static int __init tgr192_mod_init(void) |
670 | { | 674 | { |
671 | return crypto_register_shashes(tgr_algs, ARRAY_SIZE(tgr_algs)); | 675 | int ret = 0; |
676 | |||
677 | ret = crypto_register_shash(&tgr192); | ||
678 | |||
679 | if (ret < 0) { | ||
680 | goto out; | ||
681 | } | ||
682 | |||
683 | ret = crypto_register_shash(&tgr160); | ||
684 | if (ret < 0) { | ||
685 | crypto_unregister_shash(&tgr192); | ||
686 | goto out; | ||
687 | } | ||
688 | |||
689 | ret = crypto_register_shash(&tgr128); | ||
690 | if (ret < 0) { | ||
691 | crypto_unregister_shash(&tgr192); | ||
692 | crypto_unregister_shash(&tgr160); | ||
693 | } | ||
694 | out: | ||
695 | return ret; | ||
672 | } | 696 | } |
673 | 697 | ||
674 | static void __exit tgr192_mod_fini(void) | 698 | static void __exit tgr192_mod_fini(void) |
675 | { | 699 | { |
676 | crypto_unregister_shashes(tgr_algs, ARRAY_SIZE(tgr_algs)); | 700 | crypto_unregister_shash(&tgr192); |
701 | crypto_unregister_shash(&tgr160); | ||
702 | crypto_unregister_shash(&tgr128); | ||
677 | } | 703 | } |
678 | 704 | ||
679 | MODULE_ALIAS("tgr160"); | 705 | MODULE_ALIAS("tgr160"); |