aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/tcrypt.c
diff options
context:
space:
mode:
authorAaron Grothe <ajgrothe@yahoo.com>2005-09-01 20:42:46 -0400
committerDavid S. Miller <davem@davemloft.net>2005-09-01 20:42:46 -0400
commitfb4f10ed50f01b0f953068456bfb6e2885921b01 (patch)
treee9eb4112522d7969fdc4bbf6455b6d0d59426121 /crypto/tcrypt.c
parent75c80c382fbd08acf06fbef9d54c9844e806a8b4 (diff)
[CRYPTO]: Fix XTEA implementation
The XTEA implementation was incorrect due to a misinterpretation of operator precedence. Because of the wide-spread nature of this error, the erroneous implementation will be kept, albeit under the new name of XETA. Signed-off-by: Aaron Grothe <ajgrothe@yahoo.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'crypto/tcrypt.c')
-rw-r--r--crypto/tcrypt.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index bd7524cfff33..68639419c5bd 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -72,7 +72,7 @@ static char *check[] = {
72 "des", "md5", "des3_ede", "rot13", "sha1", "sha256", "blowfish", 72 "des", "md5", "des3_ede", "rot13", "sha1", "sha256", "blowfish",
73 "twofish", "serpent", "sha384", "sha512", "md4", "aes", "cast6", 73 "twofish", "serpent", "sha384", "sha512", "md4", "aes", "cast6",
74 "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea", 74 "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea",
75 "khazad", "wp512", "wp384", "wp256", "tnepres", NULL 75 "khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", NULL
76}; 76};
77 77
78static void hexdump(unsigned char *buf, unsigned int len) 78static void hexdump(unsigned char *buf, unsigned int len)
@@ -859,6 +859,10 @@ static void do_test(void)
859 test_cipher ("anubis", MODE_CBC, ENCRYPT, anubis_cbc_enc_tv_template, ANUBIS_CBC_ENC_TEST_VECTORS); 859 test_cipher ("anubis", MODE_CBC, ENCRYPT, anubis_cbc_enc_tv_template, ANUBIS_CBC_ENC_TEST_VECTORS);
860 test_cipher ("anubis", MODE_CBC, DECRYPT, anubis_cbc_dec_tv_template, ANUBIS_CBC_ENC_TEST_VECTORS); 860 test_cipher ("anubis", MODE_CBC, DECRYPT, anubis_cbc_dec_tv_template, ANUBIS_CBC_ENC_TEST_VECTORS);
861 861
862 //XETA
863 test_cipher ("xeta", MODE_ECB, ENCRYPT, xeta_enc_tv_template, XETA_ENC_TEST_VECTORS);
864 test_cipher ("xeta", MODE_ECB, DECRYPT, xeta_dec_tv_template, XETA_DEC_TEST_VECTORS);
865
862 test_hash("sha384", sha384_tv_template, SHA384_TEST_VECTORS); 866 test_hash("sha384", sha384_tv_template, SHA384_TEST_VECTORS);
863 test_hash("sha512", sha512_tv_template, SHA512_TEST_VECTORS); 867 test_hash("sha512", sha512_tv_template, SHA512_TEST_VECTORS);
864 test_hash("wp512", wp512_tv_template, WP512_TEST_VECTORS); 868 test_hash("wp512", wp512_tv_template, WP512_TEST_VECTORS);
@@ -1016,6 +1020,11 @@ static void do_test(void)
1016 case 29: 1020 case 29:
1017 test_hash("tgr128", tgr128_tv_template, TGR128_TEST_VECTORS); 1021 test_hash("tgr128", tgr128_tv_template, TGR128_TEST_VECTORS);
1018 break; 1022 break;
1023
1024 case 30:
1025 test_cipher ("xeta", MODE_ECB, ENCRYPT, xeta_enc_tv_template, XETA_ENC_TEST_VECTORS);
1026 test_cipher ("xeta", MODE_ECB, DECRYPT, xeta_dec_tv_template, XETA_DEC_TEST_VECTORS);
1027 break;
1019 1028
1020#ifdef CONFIG_CRYPTO_HMAC 1029#ifdef CONFIG_CRYPTO_HMAC
1021 case 100: 1030 case 100: