hrllo all,
the attached patch --already committed fixes a bug in the DES parity
adjustment which affected also the TripleDES algorithm.
a new Mauve testlet (TestOfTripleDESParityAdjustment in
gnu.testlet.gnu.javax.crypto.jce) highlights the bug and validates the fix.
2006-07-16 Raif S. Naffah <[EMAIL PROTECTED]>
* gnu/javax/crypto/cipher/DES.java (adjustParity): Index limit now takes
offset into consideration.
cheers;
rsn
Index: DES.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/javax/crypto/cipher/DES.java,v
retrieving revision 1.3
diff -u -r1.3 DES.java
--- DES.java 25 Jun 2006 12:01:33 -0000 1.3
+++ DES.java 16 Jul 2006 02:45:45 -0000
@@ -299,7 +299,7 @@
*/
public static void adjustParity(byte[] kb, int offset)
{
- for (int i = offset; i < KEY_SIZE; i++)
+ for (int i = offset; i < offset + KEY_SIZE; i++)
kb[i] ^= (PARITY[kb[i] & 0xff] == 8) ? 1 : 0;
}