On Wed, Apr 8, 2009 at 3:53 AM, Matthew Toseland
<[email protected]> wrote:
> On Tuesday 07 April 2009 16:04:29 [email protected] 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?
>

they are equivalent.

> Devl mailing list
> [email protected]
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
>
_______________________________________________
Devl mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to