When the NTT Stalls: Tracing a Silent ML-KEM Failure to a Memory Contract Nobody Wrote

A lattice engine passed every known-answer test on FPGA. After it moved to an ASIC SRAM macro, it started producing a small, steady stream of failed key exchanges. Nothing crashed and no error flag went up. The decapsulation core returned a well-formed shared secret every time, but the secret was wrong, and ML-KEM's implicit rejection made it look exactly like a correct one.

A failure designed to look like success

The Fujisaki-Okamoto transform inside ML-KEM re-encrypts the decrypted message and compares the result with the received ciphertext. If they don't match, it doesn't raise an error. It outputs a pseudorandom key derived from a secret rejection value. This is deliberate, because an explicit failure flag would give an attacker a chosen-ciphertext oracle. It also means a hardware datapath error looks, cryptographically, exactly like an attacker's malformed ciphertext. The symptom surfaced far above the core, as TLS handshakes failing key confirmation at a rate operations first blamed on middleboxes. By our estimate from field logs, that rate was around one session in several hundred thousand. Layering kept the service up: the comparison guaranteed that a corrupted decapsulation never produced a key the peer could also derive, and key confirmation plus client retry turned a silent arithmetic fault into a session failure the client could recover from.

The trigger

A firmware revision raised the priority of SHAKE-based matrix expansion on the shared Keccak accelerator. As a result, the sampler occasionally applied backpressure to the NTT pipeline in the middle of a stage. That froze the address generator for one clock cycle while the write-back path, one pipeline register ahead, kept committing results. During that one-cycle window, the dual-port coefficient RAM received a read and a write to the same address on opposite ports. The FPGA block RAM used during verification resolved that collision read-first, returning the old coefficient, which happened to be the value the butterfly needed. The ASIC compiler macro documented the read output as undefined on collision, and in silicon it returned bit patterns that varied with voltage and temperature. The firmware change was reasonable, reviewed, and correct for its own purpose. It exposed a window that had been in the design from the start.

The assumption that stopped holding

The root cause predates the firmware revision. The NTT schedule had been proven collision-free on the premise that the pipeline never stalls between stages, and that premise was recorded in a timing diagram, not in the memory interface contract. Once the Keccak core became a shared resource with variable latency, the premise stopped holding, and the macro's default collision behaviour quietly became part of the arithmetic. Formal checks covered the butterfly datapath and the constant-time behaviour of the control logic. They treated the RAM as an ideal model with read-first semantics carried over from the FPGA library. The known-answer vectors that come with NIST's post-quantum standards for key establishment and signatures could not catch it either, because they run on an idle accelerator where the stall never happens. Reverting the arbitration priority would remove the trigger and leave the hazard in place for the next scheduler change.

The rule that replaces the premise

The rule we now apply: any memory shared by producers whose latency can vary must declare its collision semantics in its interface contract and must be verified under injected stalls of at least one clock cycle at every stage boundary, which costs a write-forwarding mux or a forced bubble on each port and a measurable slice of NTT throughput, a price well below the cost of a fault that the cryptography itself is built to hide.

If implicit rejection masks datapath errors, shouldn't the core expose a rejection counter so health monitoring can see them?

Yes, but only on a privileged management interface. The counter must be unreachable from the protocol path and coarse in time, so it reports a trend rather than per-ciphertext outcomes. Exposed per operation, it rebuilds the oracle that implicit rejection exists to remove. Aggregated and rate-limited, it would have turned this months-long field mystery into an alarm on the first day of deployment.

Back to PQCInside · Domains

← Back to PQCInside
Engineering & Architecture Brief

When the NTT Stalls: Tracing a Silent ML-KEM Failure to a Memory Contract Nobody Wrote

A lattice engine passed every known-answer test on FPGA. After it moved to an ASIC SRAM macro, it started producing a small, steady stream of failed key exchanges. Nothing crashed and no error flag went up. The decapsulation core returned a well-formed shared secret every time, but the secret was wrong, and ML-KEM's implicit rejection made it look exactly like a correct one.

A failure designed to look like success

The Fujisaki-Okamoto transform inside ML-KEM re-encrypts the decrypted message and compares the result with the received ciphertext. If they don't match, it doesn't raise an error. It outputs a pseudorandom key derived from a secret rejection value. This is deliberate, because an explicit failure flag would give an attacker a chosen-ciphertext oracle. It also means a hardware datapath error looks, cryptographically, exactly like an attacker's malformed ciphertext. The symptom surfaced far above the core, as TLS handshakes failing key confirmation at a rate operations first blamed on middleboxes. By our estimate from field logs, that rate was around one session in several hundred thousand. Layering kept the service up: the comparison guaranteed that a corrupted decapsulation never produced a key the peer could also derive, and key confirmation plus client retry turned a silent arithmetic fault into a session failure the client could recover from.

The trigger

A firmware revision raised the priority of SHAKE-based matrix expansion on the shared Keccak accelerator. As a result, the sampler occasionally applied backpressure to the NTT pipeline in the middle of a stage. That froze the address generator for one clock cycle while the write-back path, one pipeline register ahead, kept committing results. During that one-cycle window, the dual-port coefficient RAM received a read and a write to the same address on opposite ports. The FPGA block RAM used during verification resolved that collision read-first, returning the old coefficient, which happened to be the value the butterfly needed. The ASIC compiler macro documented the read output as undefined on collision, and in silicon it returned bit patterns that varied with voltage and temperature. The firmware change was reasonable, reviewed, and correct for its own purpose. It exposed a window that had been in the design from the start.

The assumption that stopped holding

The root cause predates the firmware revision. The NTT schedule had been proven collision-free on the premise that the pipeline never stalls between stages, and that premise was recorded in a timing diagram, not in the memory interface contract. Once the Keccak core became a shared resource with variable latency, the premise stopped holding, and the macro's default collision behaviour quietly became part of the arithmetic. Formal checks covered the butterfly datapath and the constant-time behaviour of the control logic. They treated the RAM as an ideal model with read-first semantics carried over from the FPGA library. The known-answer vectors that come with NIST's post-quantum standards for key establishment and signatures could not catch it either, because they run on an idle accelerator where the stall never happens. Reverting the arbitration priority would remove the trigger and leave the hazard in place for the next scheduler change.

The rule that replaces the premise

The rule we now apply: any memory shared by producers whose latency can vary must declare its collision semantics in its interface contract and must be verified under injected stalls of at least one clock cycle at every stage boundary, which costs a write-forwarding mux or a forced bubble on each port and a measurable slice of NTT throughput, a price well below the cost of a fault that the cryptography itself is built to hide.

Technical FAQ: If implicit rejection masks datapath errors, shouldn't the core expose a rejection counter so health monitoring can see them?

Yes, but only on a privileged management interface. The counter must be unreachable from the protocol path and coarse in time, so it reports a trend rather than per-ciphertext outcomes. Exposed per operation, it rebuilds the oracle that implicit rejection exists to remove. Aggregated and rate-limited, it would have turned this months-long field mystery into an alarm on the first day of deployment.

Related Architecture Specifications (PQCECOSYSTEM): mlkemsec.com · otacrypt.com · pqcroute.com

More Technical Articles on pqcinside.com

Build vs Buy: The Engineering Economics of Licensing Post-Quantum Semiconductor IP →Silicon Portability: Migrating PQCInside IP Across TSMC, GlobalFoundries, and Intel Foundries →When the SRAM Macro Changed and the NTT Engine Stopped Agreeing With Itself →