diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-04 12:06:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-04 12:06:34 -0400 |
commit | d66e6737d454553e1e62109d8298ede5351178a4 (patch) | |
tree | c28b205045935b111527f461d2b114daa26e4fb8 /crypto/serpent_generic.c | |
parent | 612a9aab56a93533e76e3ad91642db7033e03b69 (diff) | |
parent | c9f97a27ceee84998999bf3341e6d5d207b05539 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto update from Herbert Xu:
- Optimised AES/SHA1 for ARM.
- IPsec ESN support in talitos and caam.
- x86_64/avx implementation of cast5/cast6.
- Add/use multi-algorithm registration helpers where possible.
- Added IBM Power7+ in-Nest support.
- Misc fixes.
Fix up trivial conflicts in crypto/Kconfig due to the sparc64 crypto
config options being added next to the new ARM ones.
[ Side note: cut-and-paste duplicate help texts make those conflicts
harder to read than necessary, thanks to git being smart about
minimizing conflicts and maximizing the common parts... ]
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (71 commits)
crypto: x86/glue_helper - fix storing of new IV in CBC encryption
crypto: cast5/avx - fix storing of new IV in CBC encryption
crypto: tcrypt - add missing tests for camellia and ghash
crypto: testmgr - make test_aead also test 'dst != src' code paths
crypto: testmgr - make test_skcipher also test 'dst != src' code paths
crypto: testmgr - add test vectors for CTR mode IV increasement
crypto: testmgr - add test vectors for partial ctr(cast5) and ctr(cast6)
crypto: testmgr - allow non-multi page and multi page skcipher tests from same test template
crypto: caam - increase TRNG clocks per sample
crypto, tcrypt: remove local_bh_disable/enable() around local_irq_disable/enable()
crypto: tegra-aes - fix error return code
crypto: crypto4xx - fix error return code
crypto: hifn_795x - fix error return code
crypto: ux500 - fix error return code
crypto: caam - fix error IDs for SEC v5.x RNG4
hwrng: mxc-rnga - Access data via structure
hwrng: mxc-rnga - Adapt clocks to new i.mx clock framework
crypto: caam - add IPsec ESN support
crypto: 842 - remove .cra_list initialization
Revert "[CRYPTO] cast6: inline bloat--"
...
Diffstat (limited to 'crypto/serpent_generic.c')
-rw-r--r-- | crypto/serpent_generic.c | 53 |
1 files changed, 19 insertions, 34 deletions
diff --git a/crypto/serpent_generic.c b/crypto/serpent_generic.c index 8f32cf35e5ce..7ddbd7e88859 100644 --- a/crypto/serpent_generic.c +++ b/crypto/serpent_generic.c | |||
@@ -567,24 +567,6 @@ static void serpent_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) | |||
567 | __serpent_decrypt(ctx, dst, src); | 567 | __serpent_decrypt(ctx, dst, src); |
568 | } | 568 | } |
569 | 569 | ||
570 | static struct crypto_alg serpent_alg = { | ||
571 | .cra_name = "serpent", | ||
572 | .cra_driver_name = "serpent-generic", | ||
573 | .cra_priority = 100, | ||
574 | .cra_flags = CRYPTO_ALG_TYPE_CIPHER, | ||
575 | .cra_blocksize = SERPENT_BLOCK_SIZE, | ||
576 | .cra_ctxsize = sizeof(struct serpent_ctx), | ||
577 | .cra_alignmask = 3, | ||
578 | .cra_module = THIS_MODULE, | ||
579 | .cra_list = LIST_HEAD_INIT(serpent_alg.cra_list), | ||
580 | .cra_u = { .cipher = { | ||
581 | .cia_min_keysize = SERPENT_MIN_KEY_SIZE, | ||
582 | .cia_max_keysize = SERPENT_MAX_KEY_SIZE, | ||
583 | .cia_setkey = serpent_setkey, | ||
584 | .cia_encrypt = serpent_encrypt, | ||
585 | .cia_decrypt = serpent_decrypt } } | ||
586 | }; | ||
587 | |||
588 | static int tnepres_setkey(struct crypto_tfm *tfm, const u8 *key, | 570 | static int tnepres_setkey(struct crypto_tfm *tfm, const u8 *key, |
589 | unsigned int keylen) | 571 | unsigned int keylen) |
590 | { | 572 | { |
@@ -637,41 +619,44 @@ static void tnepres_decrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) | |||
637 | d[3] = swab32(rd[0]); | 619 | d[3] = swab32(rd[0]); |
638 | } | 620 | } |
639 | 621 | ||
640 | static struct crypto_alg tnepres_alg = { | 622 | static struct crypto_alg srp_algs[2] = { { |
623 | .cra_name = "serpent", | ||
624 | .cra_driver_name = "serpent-generic", | ||
625 | .cra_priority = 100, | ||
626 | .cra_flags = CRYPTO_ALG_TYPE_CIPHER, | ||
627 | .cra_blocksize = SERPENT_BLOCK_SIZE, | ||
628 | .cra_ctxsize = sizeof(struct serpent_ctx), | ||
629 | .cra_alignmask = 3, | ||
630 | .cra_module = THIS_MODULE, | ||
631 | .cra_u = { .cipher = { | ||
632 | .cia_min_keysize = SERPENT_MIN_KEY_SIZE, | ||
633 | .cia_max_keysize = SERPENT_MAX_KEY_SIZE, | ||
634 | .cia_setkey = serpent_setkey, | ||
635 | .cia_encrypt = serpent_encrypt, | ||
636 | .cia_decrypt = serpent_decrypt } } | ||
637 | }, { | ||
641 | .cra_name = "tnepres", | 638 | .cra_name = "tnepres", |
642 | .cra_flags = CRYPTO_ALG_TYPE_CIPHER, | 639 | .cra_flags = CRYPTO_ALG_TYPE_CIPHER, |
643 | .cra_blocksize = SERPENT_BLOCK_SIZE, | 640 | .cra_blocksize = SERPENT_BLOCK_SIZE, |
644 | .cra_ctxsize = sizeof(struct serpent_ctx), | 641 | .cra_ctxsize = sizeof(struct serpent_ctx), |
645 | .cra_alignmask = 3, | 642 | .cra_alignmask = 3, |
646 | .cra_module = THIS_MODULE, | 643 | .cra_module = THIS_MODULE, |
647 | .cra_list = LIST_HEAD_INIT(serpent_alg.cra_list), | ||
648 | .cra_u = { .cipher = { | 644 | .cra_u = { .cipher = { |
649 | .cia_min_keysize = SERPENT_MIN_KEY_SIZE, | 645 | .cia_min_keysize = SERPENT_MIN_KEY_SIZE, |
650 | .cia_max_keysize = SERPENT_MAX_KEY_SIZE, | 646 | .cia_max_keysize = SERPENT_MAX_KEY_SIZE, |
651 | .cia_setkey = tnepres_setkey, | 647 | .cia_setkey = tnepres_setkey, |
652 | .cia_encrypt = tnepres_encrypt, | 648 | .cia_encrypt = tnepres_encrypt, |
653 | .cia_decrypt = tnepres_decrypt } } | 649 | .cia_decrypt = tnepres_decrypt } } |
654 | }; | 650 | } }; |
655 | 651 | ||
656 | static int __init serpent_mod_init(void) | 652 | static int __init serpent_mod_init(void) |
657 | { | 653 | { |
658 | int ret = crypto_register_alg(&serpent_alg); | 654 | return crypto_register_algs(srp_algs, ARRAY_SIZE(srp_algs)); |
659 | |||
660 | if (ret) | ||
661 | return ret; | ||
662 | |||
663 | ret = crypto_register_alg(&tnepres_alg); | ||
664 | |||
665 | if (ret) | ||
666 | crypto_unregister_alg(&serpent_alg); | ||
667 | |||
668 | return ret; | ||
669 | } | 655 | } |
670 | 656 | ||
671 | static void __exit serpent_mod_fini(void) | 657 | static void __exit serpent_mod_fini(void) |
672 | { | 658 | { |
673 | crypto_unregister_alg(&tnepres_alg); | 659 | crypto_unregister_algs(srp_algs, ARRAY_SIZE(srp_algs)); |
674 | crypto_unregister_alg(&serpent_alg); | ||
675 | } | 660 | } |
676 | 661 | ||
677 | module_init(serpent_mod_init); | 662 | module_init(serpent_mod_init); |