diff dcrypt/crypto/ciphers/ChaCha.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/ChaCha.d	Sat May 09 23:29:20 2009 -0400
+++ b/dcrypt/crypto/ciphers/ChaCha.d	Sun May 10 22:38:48 2009 -0400
@@ -17,7 +17,7 @@
 /** Implementation of ChaCha designed by Daniel J. Bernstein. */
 class ChaCha : Salsa20
 {
-    char[] name()
+    string name()
     {
         return "ChaCha";
     }
@@ -117,7 +117,7 @@
     {
         unittest
         {
-            static const char[][] test_keys = [
+            static string[] test_keys = [
                 "80000000000000000000000000000000", 
                 "0053a6f94c9ff24598eb3e91e4378add",
                 "00002000000000000000000000000000"~
@@ -127,14 +127,14 @@
                 
             ];
             
-            static const char[][] test_ivs = [
+            static string[] test_ivs = [
                 "0000000000000000",            
                 "0d74db42a91077de",
                 "0000000000000000",
                 "288ff65dc42b92f9"
             ];
                  
-            static const char[][] test_plaintexts = [
+            static string[] test_plaintexts = [
                 "00000000000000000000000000000000"~
                 "00000000000000000000000000000000"~
                 "00000000000000000000000000000000"~
@@ -158,7 +158,7 @@
                 
             ];
                  
-            static const char[][] test_ciphertexts = [
+            static string[] test_ciphertexts = [
                 "beb1e81e0f747e43ee51922b3e87fb38"~
                 "d0163907b4ed49336032ab78b67c2457"~
                 "9fe28f751bd3703e51d876c017faa435"~
@@ -182,7 +182,7 @@
 
             ChaCha cc = new ChaCha();
             ubyte[] buffer = new ubyte[64];
-            char[] result;
+            string result;
             for (int i = 0; i < test_keys.length; i++)
             {
                 SymmetricKey key = new SymmetricKey(ByteConverter.hexDecode(test_keys[i]));