On Tuesday 07 April 2009 16:04:29 j16sdiz at freenetproject.org wrote: > Author: j16sdiz > Date: 2009-04-07 15:04:29 +0000 (Tue, 07 Apr 2009) > New Revision: 26602 > > Modified: > trunk/freenet/src/freenet/crypt/Yarrow.java > Log: > Aggregate MessageDigest.update() calls > > Modified: trunk/freenet/src/freenet/crypt/Yarrow.java > =================================================================== > --- trunk/freenet/src/freenet/crypt/Yarrow.java 2009-04-07 12:16:53 UTC > (rev 26601) > +++ trunk/freenet/src/freenet/crypt/Yarrow.java 2009-04-07 15:04:29 UTC > (rev 26602) > @@ -488,18 +488,21 @@ > private int accept_entropy(long data, EntropySource source, int actualEntropy) { > > boolean performedPoolReseed = false; > - > + byte[] b = new byte[] { > + (byte) data, > + (byte) (data >> 8), > + (byte) (data >> 16), > + (byte) (data >> 24), > + (byte) (data >> 32), > + (byte) (data >> 40), > + (byte) (data >> 48), > + (byte) (data >> 56) > + }; > + > synchronized(this) { > fast_select = !fast_select; > MessageDigest pool = (fast_select ? fast_pool : > slow_pool); > - pool.update((byte) data); > - pool.update((byte) (data >> 8)); > - pool.update((byte) (data >> 16)); > - pool.update((byte) (data >> 24)); > - pool.update((byte) (data >> 32)); > - pool.update((byte) (data >> 40)); > - pool.update((byte) (data >> 48)); > - pool.update((byte) (data >> 56)); > + pool.update(b); > > if(fast_select) { > fast_entropy += actualEntropy;
Does the hash always read forwards? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 835 bytes Desc: This is a digitally signed message part. URL: <https://emu.freenetproject.org/pipermail/devl/attachments/20090407/abda8653/attachment.pgp>