aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/tgr192.c
diff options
context:
space:
mode:
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-10-19 15:19:19 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-10-19 15:19:19 -0400
commite05dacd71db0a5da7c1a44bcaab2a8a240b9c233 (patch)
tree31382cf1c7d62c03126448affb2fc86e8c4aaa8b /crypto/tgr192.c
parent3ab0b83bf6a1e834f4b884150d8012990c75d25d (diff)
parentddffeb8c4d0331609ef2581d84de4d763607bd37 (diff)
Merge commit 'v3.7-rc1' into stable/for-linus-3.7
* commit 'v3.7-rc1': (10892 commits) Linux 3.7-rc1 x86, boot: Explicitly include autoconf.h for hostprogs perf: Fix UAPI fallout ARM: config: make sure that platforms are ordered by option string ARM: config: sort select statements alphanumerically UAPI: (Scripted) Disintegrate include/linux/byteorder UAPI: (Scripted) Disintegrate include/linux UAPI: Unexport linux/blk_types.h UAPI: Unexport part of linux/ppp-comp.h perf: Handle new rbtree implementation procfs: don't need a PATH_MAX allocation to hold a string representation of an int vfs: embed struct filename inside of names_cache allocation if possible audit: make audit_inode take struct filename vfs: make path_openat take a struct filename pointer vfs: turn do_path_lookup into wrapper around struct filename variant audit: allow audit code to satisfy getname requests from its names_list vfs: define struct filename and have getname() return it btrfs: Fix compilation with user namespace support enabled userns: Fix posix_acl_file_xattr_userns gid conversion userns: Properly print bluetooth socket uids ...
Diffstat (limited to 'crypto/tgr192.c')
-rw-r--r--crypto/tgr192.c38
1 files changed, 6 insertions, 32 deletions
diff --git a/crypto/tgr192.c b/crypto/tgr192.c
index cbca4f208c9f..87403556fd0b 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
631static struct shash_alg tgr192 = { 631static struct shash_alg tgr_algs[3] = { {
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,9 +640,7 @@ static struct shash_alg tgr192 = {
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
645static struct shash_alg tgr160 = {
646 .digestsize = TGR160_DIGEST_SIZE, 644 .digestsize = TGR160_DIGEST_SIZE,
647 .init = tgr192_init, 645 .init = tgr192_init,
648 .update = tgr192_update, 646 .update = tgr192_update,
@@ -654,9 +652,7 @@ static struct shash_alg tgr160 = {
654 .cra_blocksize = TGR192_BLOCK_SIZE, 652 .cra_blocksize = TGR192_BLOCK_SIZE,
655 .cra_module = THIS_MODULE, 653 .cra_module = THIS_MODULE,
656 } 654 }
657}; 655}, {
658
659static struct shash_alg tgr128 = {
660 .digestsize = TGR128_DIGEST_SIZE, 656 .digestsize = TGR128_DIGEST_SIZE,
661 .init = tgr192_init, 657 .init = tgr192_init,
662 .update = tgr192_update, 658 .update = tgr192_update,
@@ -668,38 +664,16 @@ static struct shash_alg tgr128 = {
668 .cra_blocksize = TGR192_BLOCK_SIZE, 664 .cra_blocksize = TGR192_BLOCK_SIZE,
669 .cra_module = THIS_MODULE, 665 .cra_module = THIS_MODULE,
670 } 666 }
671}; 667} };
672 668
673static int __init tgr192_mod_init(void) 669static int __init tgr192_mod_init(void)
674{ 670{
675 int ret = 0; 671 return crypto_register_shashes(tgr_algs, ARRAY_SIZE(tgr_algs));
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;
696} 672}
697 673
698static void __exit tgr192_mod_fini(void) 674static void __exit tgr192_mod_fini(void)
699{ 675{
700 crypto_unregister_shash(&tgr192); 676 crypto_unregister_shashes(tgr_algs, ARRAY_SIZE(tgr_algs));
701 crypto_unregister_shash(&tgr160);
702 crypto_unregister_shash(&tgr128);
703} 677}
704 678
705MODULE_ALIAS("tgr160"); 679MODULE_ALIAS("tgr160");