diff dcrypt/crypto/ciphers/RC4.d @ 28:ad687db713a4

Further reworked the code for hash padding. Replaced all instances of 'char[]' with 'string' and removed a few 'const' modifiers as per Glenn Haecker's patch for D2 compatibility. Updated CONTRIBUTORS file.
author Thomas Dixon <reikon@reikon.us>
date Sun, 10 May 2009 22:38:48 -0400
parents 8b5eaf3c2979
children
line wrap: on
line diff
--- a/dcrypt/crypto/ciphers/RC4.d	Sat May 09 23:29:20 2009 -0400
+++ b/dcrypt/crypto/ciphers/RC4.d	Sun May 10 22:38:48 2009 -0400
@@ -47,7 +47,7 @@
         _encrypt = _initialized = true;
     }
     
-    char[] name()
+    string name()
     {
         return "RC4";
     }
@@ -116,7 +116,7 @@
     {
         unittest
         {
-            static const char[][] test_keys = [
+            static string[] test_keys = [
                 "0123456789abcdef",
                 "0123456789abcdef",
                 "0000000000000000",
@@ -124,7 +124,7 @@
                 "0123456789abcdef"
             ];
                  
-            static const char[][] test_plaintexts = [
+            static string[] test_plaintexts = [
                 "0123456789abcdef",
                 "0000000000000000",
                 "0000000000000000",
@@ -163,7 +163,7 @@
                 "01010101010101010101010101010101"
             ];
                  
-            static const char[][] test_ciphertexts = [
+            static string[] test_ciphertexts = [
                 "75b7878099e0c596",
                 "7494c2e7104b0879",
                 "de188941a3375d3a",
@@ -203,10 +203,10 @@
             ];
     
             RC4 r = new RC4();
-            foreach (uint i, char[] test_key; test_keys)
+            foreach (uint i, string test_key; test_keys)
             {
                 ubyte[] buffer = new ubyte[test_plaintexts[i].length>>1];
-                char[] result;
+                string result;
                 
                 r.init(true, new SymmetricKey(ByteConverter.hexDecode(test_key)));