Core engineering and protocols for Formal Verification with HACSpec & Coq.
Complex lattice algorithms involve hundreds of intricate modular reductions, bit-packing routines, and polynomial permutations. Even minor logic errors can compromise security or create interoperability failures with standard implementations. MLKEMSafe models the complete FIPS 203 standard in HACSpec, a formal specification language embedded in Rust.
Using the Coq interactive theorem prover, we prove that our vectorized polynomial multiplication routines produce outputs identical to the formal mathematical definition of polynomial ring multiplication over R_q. The resulting proofs are machine-checked and verifiable by independent auditors.