New sha1dc library speeds up collision-checked SHA-1 hashing for git
A developer working on the Enroute git server rewrote SHA-1 with collision detection into a new implementation called sha1dc, using a code generator and solver to fit collision checks into SIMD lanes. The new library runs at 68-81% of plain SHA-1 speed, compared with 28-29% for the existing sha1-checked crate, and roughly doubles git pack verification speed in testing.
GoKawiil's interpretation of the reporting above, not reported fact.
Git relies on collision-detecting SHA-1 to guard against maliciously crafted chosen-prefix collisions in untrusted pack data, but that safety check has historically been a major performance bottleneck, in this case consuming 84% of pack verification time. A faster implementation could let git servers validate incoming data more quickly without weakening security, which may matter more as repositories and pack sizes grow.
- sha1dc reaches 68-81% of plain SHA-1 speed versus 28-29% for the existing sha1-checked crate.
- The improvement can roughly double git pack verification speed in real-world testing.
- The work stemmed from optimizing gitoxide-based pack verification for the Enroute git server backend.
Source: sam.dev, 2026-09-21
Published there as: “Solving for faster SHA-1 collision detection”
Read the original report → The summary and analysis above are GoKawiil's own, written from reporting by the source above. Facts and quotes belong to the original publisher.