A Rust Rewrite Makes Collision-Detecting SHA-1 Nearly Three Times Faster
Solving for faster SHA-1 collision detection
Sam Reis rebuilt SHA-1 with collision detection in Rust, using a code generator to fit collision tests into SIMD lanes. The new crate, sha1dc, runs at 68–81% of plain SHA-1's speed, compared to 28–29% for the existing sha1-checked crate. It can double the speed of git pack verification, which spends 84% of its time on SHA-1. The solver balances vector prefix groups against a scalar tail to maximize throughput.
On ordinary data about 95% of blocks leave the filter with an empty mask, so the recomputation almost never runs.