diff dcrypt/crypto/ciphers/RC6.d @ 21:ec23779ee794

Removed redundant test vector from Blowfish unittest.
author Thomas Dixon <reikon@reikon.us>
date Sat, 10 Jan 2009 13:15:14 -0500
parents 5ce3012f1def
children 4589f8c5eb3c
line wrap: on
line diff
--- a/dcrypt/crypto/ciphers/RC6.d	Fri Jan 09 01:24:45 2009 -0500
+++ b/dcrypt/crypto/ciphers/RC6.d	Sat Jan 10 13:15:14 2009 -0500
@@ -134,10 +134,12 @@
         uint[] L = new uint[c];
         for (int i = 0, j = 0; i < c; i++, j+=4)
             L[i] = Util.ubytesToUintLittle(key, j);
+            
         S[0] = P;
         for (int i = 1; i <= 2*ROUNDS+3; i++)
             S[i] = S[i-1] + Q;
-        uint A, B, i, j, v = 3*(2*ROUNDS+4); // Relying on ints initializing to 0
+            
+        uint A, B, i, j, v = 3*(2*ROUNDS+4); // Relying on ints initializing to 0   
         for (int s = 1; s <= v; s++) {
             A = S[i] = Util.rotateLeft(S[i]+A+B, 3);
             B = L[j] = Util.rotateLeft(L[j]+A+B, A+B);
@@ -151,18 +153,13 @@
         unittest {
             static const char[][] test_keys = [
                 "00000000000000000000000000000000",
-                
                 "0123456789abcdef0112233445566778",
-                
                 "00000000000000000000000000000000"~
                 "0000000000000000",
-                
                 "0123456789abcdef0112233445566778"~
                 "899aabbccddeeff0",
-                
                 "00000000000000000000000000000000"~
                 "00000000000000000000000000000000",
-                
                 "0123456789abcdef0112233445566778"~
                 "899aabbccddeeff01032547698badcfe"
             ];