Roger Kapsi
2004-06-30 11:50:51 UTC
Hi
I'm currently experimenting with Philippe's SHA1 code and NIO Buffers
with the ability to access memory directly (well, lets say I'll start
the experiments at the end of next week when the exams are over :))
But as the first step I've already prepared the computeBlock() for the
C transition with some surprising results!
What I did is to change blocks like...
d += ((e << 5) | (e >>> 27)) + 0x5a827999 // K16
+ ((a & ((b = (b << 30) | (b >>> 2)) ^ c)) ^ c) // Ch(a,b,c)
+ (i00 = ((i00 ^= i02 ^ i08 ^ i13) << 1) | (i00 >>> 31)); // W16
... to ...
b = (b << 30) | (b >>> 2);
i00 ^= i02 ^ i08 ^ i13;
i00 = (i00 << 1) | (i00 >>> 31);
d += ((e << 5) | (e >>> 27)) + 0x5a827999 // K16
+ ((a & (b ^ c)) ^ c) // Ch(a,b,c)
+ (i00); // W16
And here are the results:
- G3 500MHz: the hash rate drops from 17MB/s to 16MB/s
- G4 450MHz: the hash rate drops from 16MB/s to 15MB/s
- G5 2GHz: the hash rate rose from 75MB/s to 85MB/s! =)
I'm wondering now if the latest and greatest P4/Athlon systems can
benefit from this as well? Oh, and you may try this version on
10.2/Java 1.4.1 to check if it's a workaround for the wrong hash
computation problem...
Cheers!
Roger
I'm currently experimenting with Philippe's SHA1 code and NIO Buffers
with the ability to access memory directly (well, lets say I'll start
the experiments at the end of next week when the exams are over :))
But as the first step I've already prepared the computeBlock() for the
C transition with some surprising results!
What I did is to change blocks like...
d += ((e << 5) | (e >>> 27)) + 0x5a827999 // K16
+ ((a & ((b = (b << 30) | (b >>> 2)) ^ c)) ^ c) // Ch(a,b,c)
+ (i00 = ((i00 ^= i02 ^ i08 ^ i13) << 1) | (i00 >>> 31)); // W16
... to ...
b = (b << 30) | (b >>> 2);
i00 ^= i02 ^ i08 ^ i13;
i00 = (i00 << 1) | (i00 >>> 31);
d += ((e << 5) | (e >>> 27)) + 0x5a827999 // K16
+ ((a & (b ^ c)) ^ c) // Ch(a,b,c)
+ (i00); // W16
And here are the results:
- G3 500MHz: the hash rate drops from 17MB/s to 16MB/s
- G4 450MHz: the hash rate drops from 16MB/s to 15MB/s
- G5 2GHz: the hash rate rose from 75MB/s to 85MB/s! =)
I'm wondering now if the latest and greatest P4/Athlon systems can
benefit from this as well? Oh, and you may try this version on
10.2/Java 1.4.1 to check if it's a workaround for the wrong hash
computation problem...
Cheers!
Roger