SynCrypto: SSE4 x64 optimized asm for SHA-256
We have just included some optimized x64 assembler to our Open
Source SynCrypto.pas unit
so that SHA-256 hashing will perform at best speed.
It is an adaptation from tuned Intel's assembly macros, which makes use of the SSE4 instruction set, if available.
Numbers are talking:
- under Win32, with a Core i7 CPU: pure pascal: 152ms - x86: 112ms
- under Win64, with a Core i7 CPU: pure pascal: 202ms - SSE4: 78ms
When executing the following test code:
for i := 1 to 100000 do begin s := SHA256('123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); assert(s='f816ca413da6f2881c0cf16cb6d5bbc5d4189f5a9f185855c8bfd6423e099e52'); end;
Your feedback is welcome, as usual!