Mercurial > projects > dcrypt
comparison dcrypt/crypto/ciphers/RC4.d @ 26:176c933827a8
Implemented MD4. Refactored MD5. Replaced all instances of 'version (UnitTest)' with 'debug (UnitTest)'.
author | Thomas Dixon <reikon@reikon.us> |
---|---|
date | Sun, 01 Mar 2009 13:06:48 -0500 |
parents | 6428dfd7fede |
children | 8b5eaf3c2979 |
comparison
equal
deleted
inserted
replaced
25:528676d20398 | 26:176c933827a8 |
---|---|
8 | 8 |
9 module dcrypt.crypto.ciphers.RC4; | 9 module dcrypt.crypto.ciphers.RC4; |
10 | 10 |
11 import dcrypt.crypto.StreamCipher; | 11 import dcrypt.crypto.StreamCipher; |
12 | 12 |
13 version (UnitTest) { | 13 debug (UnitTest) { |
14 import dcrypt.misc.ByteConverter; | 14 import dcrypt.misc.ByteConverter; |
15 } | 15 } |
16 | 16 |
17 /** Implementation of RC4 designed by Ron Rivest of RSA Security. */ | 17 /** Implementation of RC4 designed by Ron Rivest of RSA Security. */ |
18 class RC4 : StreamCipher { | 18 class RC4 : StreamCipher { |
99 | 99 |
100 x = y = 0; | 100 x = y = 0; |
101 } | 101 } |
102 | 102 |
103 /** Some RC4 test vectors. */ | 103 /** Some RC4 test vectors. */ |
104 version (UnitTest) { | 104 debug (UnitTest) { |
105 unittest { | 105 unittest { |
106 static const char[][] test_keys = [ | 106 static const char[][] test_keys = [ |
107 "0123456789abcdef", | 107 "0123456789abcdef", |
108 "0123456789abcdef", | 108 "0123456789abcdef", |
109 "0000000000000000", | 109 "0000000000000000", |