aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/tcrypt.c
diff options
context:
space:
mode:
authorTan Swee Heng <thesweeheng@gmail.com>2007-11-23 06:45:00 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2008-01-10 16:16:15 -0500
commit2407d60872dd2a95404c6048f775f3b64d438f4b (patch)
tree6a333c5eaae616736b2f184cee8e9f052cee966d /crypto/tcrypt.c
parent332f8840f7095d294f9bb066b175a100bcde214c (diff)
[CRYPTO] salsa20: Salsa20 stream cipher
This patch implements the Salsa20 stream cipher using the blkcipher interface. The core cipher code comes from Daniel Bernstein's submission to eSTREAM: http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/salsa20/full/ref/ The test vectors comes from: http://www.ecrypt.eu.org/stream/svn/viewcvs.cgi/ecrypt/trunk/submissions/salsa20/full/ It has been tested successfully with "modprobe tcrypt mode=34" on an UML instance. Signed-off-by: Tan Swee Heng <thesweeheng@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/tcrypt.c')
-rw-r--r--crypto/tcrypt.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 4d364ccacbb2..b8cb1d1420ae 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -80,7 +80,7 @@ static char *check[] = {
80 "cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea", 80 "cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea",
81 "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea", 81 "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea",
82 "khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", "fcrypt", 82 "khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", "fcrypt",
83 "camellia", "seed", NULL 83 "camellia", "seed", "salsa20", NULL
84}; 84};
85 85
86static void hexdump(unsigned char *buf, unsigned int len) 86static void hexdump(unsigned char *buf, unsigned int len)
@@ -1309,6 +1309,12 @@ static void do_test(void)
1309 test_hash("sha224", sha224_tv_template, SHA224_TEST_VECTORS); 1309 test_hash("sha224", sha224_tv_template, SHA224_TEST_VECTORS);
1310 break; 1310 break;
1311 1311
1312 case 34:
1313 test_cipher("salsa20", ENCRYPT,
1314 salsa20_stream_enc_tv_template,
1315 SALSA20_STREAM_ENC_TEST_VECTORS);
1316 break;
1317
1312 case 100: 1318 case 100:
1313 test_hash("hmac(md5)", hmac_md5_tv_template, 1319 test_hash("hmac(md5)", hmac_md5_tv_template,
1314 HMAC_MD5_TEST_VECTORS); 1320 HMAC_MD5_TEST_VECTORS);