I'll see your 372 lines of Verilog and raise you five lines of math.
jamesevery.org
jamesevery.org
The final step involves a preimage attack on a homebrew hashing algorithm. Most people bruteforce it or use Z3, but one person, "[ashamed] at not being able to simply solve for the password with math", wrote several hundred lines of SystemVerilog to crack it on an FPGA.
This is how to break it purely with math.