The study tested Llama-2-70b-chat-hf, Mistral-7B-Instruct-v0.1 and zephyr-7b-alpha on C code implementing SHA-1. The systems generated 154,433 attempted rewrites; 55,162 could be compiled under all of the tested compiler settings. By combining different rewritten component functions, the researchers identified more than 100,000 distinct versions that produced the expected SHA-1 outputs in their validation checks.

The results also showed how unreliable generated code can be. Some versions were correct for certain test inputs but wrong for others, while others contained memory leaks, integer overflows, out-of-bounds accesses, uninitialized values or behavior that changed with compiler settings. Some incorrect implementations produced outputs with basic features of hash functions without matching SHA-1.