diff dcrypt/crypto/modes/CBC.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/modes/CBC.d	Sat May 09 23:29:20 2009 -0400
+++ b/dcrypt/crypto/modes/CBC.d	Sun May 10 22:38:48 2009 -0400
@@ -44,7 +44,7 @@
         return wrappedCipher;
     }
     
-    char[] name()
+    string name()
     {
         return wrappedCipher.name~"/CBC";
     }
@@ -138,13 +138,13 @@
     {
         unittest
         {
-            static const char[][] test_keys = [
+            static const string[] test_keys = [
                 "00000000000000000000000000000000",            
                 "00000000000000000000000000000000",
                 "0123456789abcdef0123456789abcdef"
             ];
                  
-            static const char[][] test_plaintexts = [
+            static const string[] test_plaintexts = [
                 "00000000000000000000000000000000"~
                 "00000000000000000000000000000000",
                  
@@ -154,8 +154,8 @@
                 "01010101010101010101010101010101"~
                 "01010101010101010101010101010101"
             ];
-                 
-            static const char[][] test_ciphertexts = [
+
+            static const string[] test_ciphertexts = [
                 "dee9d4d8f7131ed9b0e40a036a85d2c4"~
                 "4602d6e67f0c603738197998166ef281",
                  
@@ -169,7 +169,7 @@
             CBC c = new CBC(new XTEA);
             ubyte[] iv = new ubyte[c.blockSize], // Initialized to 0
                     buffer = new ubyte[32];
-            char[] result;
+            string result;
             for (int i = 0; i < test_keys.length; i++)
             {
                 SymmetricKey key = new SymmetricKey(ByteConverter.hexDecode(test_keys[i]));