On Thursday 15 May 2008 17:01, Daniel Cheng wrote: > On Thu, May 15, 2008 at 10:30 PM, Matthew Toseland > <toad at amphibian.dyndns.org> wrote: > > On Tuesday 13 May 2008 17:10, j16sdiz at freenetproject.org wrote: > >> Author: j16sdiz > >> Date: 2008-05-13 16:10:32 +0000 (Tue, 13 May 2008) > >> New Revision: 19912 > >> > >> Modified: > >> trunk/freenet/src/freenet/crypt/ciphers/Rijndael.java > >> Log: > >> No Monte Carlo test for Rijndael > > > > Huh? > > The test output the monte carlo test result, it is supposed to be compared > with ecb_e_m.txt in the FIPS standard. > > Our implementation is the original Rijndael (not the one in FIPS standard), > the output does not match ecb_e_m.txt.
Is that bad? Presumably changes during the standardisation process were to improve security? > > >> Modified: trunk/freenet/src/freenet/crypt/ciphers/Rijndael.java > >> =================================================================== > >> --- trunk/freenet/src/freenet/crypt/ciphers/Rijndael.java 2008-05-13 > > 12:11:24 UTC (rev 19911) > >> +++ trunk/freenet/src/freenet/crypt/ciphers/Rijndael.java 2008-05-13 > > 16:10:32 UTC (rev 19912) > >> @@ -102,65 +102,6 @@ > >> throw new IllegalArgumentException(); > >> Rijndael_Algorithm.blockDecrypt(block, result, 0, sessionKey, > > blocksize/8); > >> } > >> - > >> - public static void main(String[] args) throws UnsupportedCipherException { > >> - // Perform the Monte Carlo test > >> - > >> - System.out.println("KEYSIZE=128\n"); > >> - monteCarlo(128); > >> - System.out.println("=========================\n"); > >> - System.out.println("KEYSIZE=192\n"); > >> - monteCarlo(192); > >> - System.out.println("=========================\n"); > >> - System.out.println("KEYSIZE=256\n"); > >> - monteCarlo(256); > >> - } > >> - > >> - static void monteCarlo(int keySize) throws UnsupportedCipherException { > >> - Rijndael ctx=new Rijndael(keySize); > >> - int kb=keySize/8; > >> - byte[] P=new byte[16], C=new byte[16], > >> - CL=new byte[16], KEY=new byte[kb]; > >> - > >> - for (int i=0; i<400; i++) { > >> - System.out.println("I="+i); > >> - System.out.println("KEY="+HexUtil.bytesToHex(KEY,0,kb)); > >> - > >> - System.out.println("PT="+HexUtil.bytesToHex(P,0,16)); > >> - > >> - ctx.initialize(KEY); > >> - for (int j=0; j<10000; j++) { > >> - System.arraycopy(C, 0, CL, 0, C.length); > >> - ctx.encipher(P, C); > >> - System.arraycopy(C, 0, P, 0, P.length); > >> - } > >> - System.out.println("CT="+HexUtil.bytesToHex(C,0,16)); > >> - > >> - > >> - for (int x=0; x<kb; x++) { > >> - if (keySize==192) > >> - if (x<8) > >> - KEY[x]^=CL[8+x]; > >> - else > >> - KEY[x]^=C[x-8]; > >> - else if (keySize==256) > >> - if (x<16) > >> - KEY[x]^=CL[x]; > >> - else > >> - KEY[x]^=C[x-16]; > >> - else KEY[x]^=C[x]; > >> - } > >> - > >> - if (keySize==192) > >> - for (int x=0; x<8; x++) > >> - KEY[x+16]^=CL[x+8]; > >> - else if (keySize==256) > >> - for (int x=0; x<16; x++) > >> - KEY[x+16]^=CL[x]; > >> - > >> - System.out.println(); > >> - } > >> - } > >> } > >> > >> > >> > >> _______________________________________________ > >> cvs mailing list > >> cvs at freenetproject.org > >> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs > >> > >> > > > > _______________________________________________ > > Devl mailing list > > Devl at freenetproject.org > > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl > > > _______________________________________________ > Devl mailing list > Devl at freenetproject.org > http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl > > -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <https://emu.freenetproject.org/pipermail/devl/attachments/20080515/c0c8f147/attachment.pgp>