RustCrypto / asm-hashes

Assembly implementations of cryptographic hash functions
46 stars 26 forks source link

speedup sha2 x86-64 assembly implementations #8

Closed froydnj closed 4 years ago

froydnj commented 5 years ago

The rearrangement of the sigma functions was suggested in Intel's "Fast SHA-256 Implementations" whitepaper, and the constants for the SHA-256 implementation are taken from there. The constants for the SHA-512 implementation were derived via exhaustive search + random testing.

Performance improves on SHA-256 by ~10% locally, and on SHA-512 by ~15-20%.

newpavlov commented 4 years ago

Sorry for such late merge! I was planning to rework crates based on OpenSSL assembly, but looks like it will not happen in the near future.