Mercurial > projects > dcrypt
changeset 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 | 3a57367afe34 |
children | 74303a717032 |
files | dcrypt/crypto/ciphers/Blowfish.d dcrypt/crypto/ciphers/RC6.d |
diffstat | 2 files changed, 3 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/dcrypt/crypto/ciphers/Blowfish.d Fri Jan 09 01:24:45 2009 -0500 +++ b/dcrypt/crypto/ciphers/Blowfish.d Sat Jan 10 13:15:14 2009 -0500 @@ -344,7 +344,6 @@ "1111111111111111", "0123456789abcdef", "1111111111111111", - "0000000000000000", "fedcba9876543210" ]; @@ -355,7 +354,6 @@ "1111111111111111", "1111111111111111", "0123456789abcdef", - "0000000000000000", "0123456789abcdef" ]; @@ -366,7 +364,6 @@ "2466dd878b963c9d", "61f9c3802281b096", "7d0cc630afda1ec7", - "4ef997456198dd78", "0aceab0fc6a0a28d" ];
--- 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" ];