Mercurial > projects > dcrypt
diff dcrypt/crypto/ciphers/RC4.d @ 23:4589f8c5eb3c
Replaced dcrypt.crypto.Util with dcrypt.misc.Bitwise and dcrypt.misc.ByteConverter. Altered all dependent files to reflect changes.
author | Thomas Dixon <reikon@reikon.us> |
---|---|
date | Sat, 14 Feb 2009 19:58:20 -0500 |
parents | 5ce3012f1def |
children | 6428dfd7fede |
line wrap: on
line diff
--- a/dcrypt/crypto/ciphers/RC4.d Sat Jan 10 13:17:58 2009 -0500 +++ b/dcrypt/crypto/ciphers/RC4.d Sat Feb 14 19:58:20 2009 -0500 @@ -11,7 +11,7 @@ import dcrypt.crypto.StreamCipher; version (UnitTest) { - import dcrypt.misc.Util; + import dcrypt.misc.ByteConverter; } /** Implementation of RC4 designed by Ron Rivest of RSA Security. */ @@ -182,19 +182,19 @@ ubyte[] buffer = new ubyte[test_plaintexts[i].length>>1]; char[] result; - r.init(true, new SymmetricKey(Util.hexToUbytes(test_key))); + r.init(true, new SymmetricKey(ByteConverter.hexDecode(test_key))); // Encryption - r.update(Util.hexToUbytes(test_plaintexts[i]), buffer); - result = Util.ubytesToHex(buffer); + r.update(ByteConverter.hexDecode(test_plaintexts[i]), buffer); + result = ByteConverter.hexEncode(buffer); assert(result == test_ciphertexts[i], r.name~": ("~result~") != ("~test_ciphertexts[i]~")"); r.reset(); // Decryption - r.update(Util.hexToUbytes(test_ciphertexts[i]), buffer); - result = Util.ubytesToHex(buffer); + r.update(ByteConverter.hexDecode(test_ciphertexts[i]), buffer); + result = ByteConverter.hexEncode(buffer); assert(result == test_plaintexts[i], r.name~": ("~result~") != ("~test_plaintexts[i]~")"); }