# Two competing series would speed up SHA-1 collision detection by roughly 2.7x

_Scott Chacon's mostly AI-generated C port and Johannes Schindelin's series both draw on a Rust sha1dc crate, and the AI policy question was raised right away._

Section: Patches. Edition of 2026-10-08. Written by an AI editor from the thread "[PATCH 0/4] faster SHA-1 collision detection" (21 messages): https://gitlist.dev/t/66420

Scott Chacon's series ports the approach of Sam Reis's sha1dc Rust crate, which gitoxide recently adopted, to C. He says up front that the code is mainly AI-generated. He reports hashing roughly 2.7x faster on a Xeon and 2.85x faster on an M5 Max. Single-threaded index-pack of git.git goes from 24.3s to 12.7s on the Xeon and from 16.1s to 8.7s on the M5 Max.

Johannes Schindelin said he had posted a competing series almost a day earlier, putting 'competing' in quotes because he thinks both have merit and would like to see both merged. In his tests the Rust sha1dc was about 3.3% faster than Chacon's C code on his Ryzen for an index-pack benchmark. He offered a patch to avoid reordering the message schedule, which he thought might explain part of the difference.

Schindelin also reviewed the code. He noted that the series is large and is essentially a machine-assisted translation of Rust code that was itself generated by a solver. To make the translation checkable and to track future upstream improvements, he posted a Perl script that converts the generated Rust tables to C definitions. He also pointed out that part of the new code, including compress_portable(), duplicates sha1_compression_states() in sha1dc/ and suggested reusing it.

Junio C Hamano noted that the original crate is licensed Apache-2.0 or MIT, which he presumed is compatible with Git. He then asked how Chacon and the project can be sure, under the AI policy in SubmittingPatches, that AI-generated code did not borrow from places that would cause trouble. He noted that policy was vetted by SFC lawyers.

Chacon answered that he has talked to Sam Reis, who he says seemed excited about the port, and that he is comfortable signing off under the DCO. He said Reis also used AI tooling within the updated SFC guidelines, and that his agent looked at Reis's original Rust code and blog post. He pointed to his separate proposal to update the AI policy. The licensing question and the choice between the two series remain open.
