Rekey Storms: Testing a PQC Gateway Where It Actually Breaks

An ML-DSA signature that takes twice the median time is not a defect on the bench. It becomes one when every ECU on the bus asks for a handshake in the same second after a gateway reboot. Lattice schemes have long-tailed latency, because signing uses rejection sampling and the large keys and ciphertexts put pressure on memory, and those tails only line up badly when the system is saturated. The qualification plan has to create that saturation on purpose and then break something in the middle of it.

Why the bench lies

ML-DSA signing loops until a candidate passes its norm checks, so the number of iterations is random. At the middle security level the average is roughly four to five attempts (an estimate), and that average hides a tail several times longer. On a lightly loaded core the variance vanishes into idle time. Under load it adds up with other pressures. ML-KEM decapsulation buffers push the stack toward its guard region, HSM command queues serialise every request, and the RTOS scheduler now has to arbitrate between the crypto partition and the control loop. Unit tests and throughput benchmarks report means, while the failure lives in the joint p99.9 of several queues that never saturate on their own.

The failure worth hunting

The mode that matters is a cascade. The gateway restarts and every peer re-handshakes at once. The crypto service overruns, its watchdog fires and the HSM partition resets. Peers caught mid-establishment then retry in lockstep and recreate the storm that caused the reset. None of this is a cryptographic weakness, and functional tests never see it because each step is correct on its own. For fault tolerance, the only question is whether control traffic already protected by established session keys keeps flowing while the handshake path is on fire, which it does when microkernel isolation is genuine and does not when the crypto service shares a queue, a lock or a heap with the authenticated fieldbus path.

The storm test

Build a rig where each peer is an emulated node with a controllable start offset. Power-cycle the gateway and release every handshake inside the same scheduling window, while real control traffic keeps running at its nominal cycle. At the peak, inject the fault. Kill the HSM partition, force a watchdog reset of the crypto task, or flood it with ciphertexts of valid length that decapsulate to garbage under implicit rejection, so each one costs full work before the handshake fails. Measure three things: the end-to-end latency of the authenticated cyclic frames, the stack high-water mark of the crypto partition and the retry timing of peers after the reset. Repeat with randomised offsets and signing seeds until the tail stops moving, since a single pass measures luck, and write down the expected degraded mode before the run, because functional safety standards such as ISO 26262 and IEC 61508 accept fault injection as evidence only when both the fault and the resulting safe state trace back to the safety concept.

Decision rule

With the crypto task under a 100 ms watchdog supervision window, require the p99.9 latency of the crypto service during a synchronised storm to stay below half that window, and if it does not, redesign the gateway to shed or defer new handshakes with jittered backoff instead of queueing them, because a queue that grows faster than the HSM drains it turns load into a reset.

Why not make signing fully deterministic and remove the tail?

Constant-time code removes data-dependent timing inside an iteration, but it does not fix the iteration count, which ML-DSA exposes by design without harm. Padding every signature to the worst case would make timing deterministic, and the storm test would show the cost as lost throughput. The usual trade is to keep signing variable and put a bound on the queue in front of it.

Back to PQCEmbedded · Domains

← Back to PQCEmbedded
Engineering & Architecture Brief

Rekey Storms: Testing a PQC Gateway Where It Actually Breaks

An ML-DSA signature that takes twice the median time is not a defect on the bench. It becomes one when every ECU on the bus asks for a handshake in the same second after a gateway reboot. Lattice schemes have long-tailed latency, because signing uses rejection sampling and the large keys and ciphertexts put pressure on memory, and those tails only line up badly when the system is saturated. The qualification plan has to create that saturation on purpose and then break something in the middle of it.

Why the bench lies

ML-DSA signing loops until a candidate passes its norm checks, so the number of iterations is random. At the middle security level the average is roughly four to five attempts (an estimate), and that average hides a tail several times longer. On a lightly loaded core the variance vanishes into idle time. Under load it adds up with other pressures. ML-KEM decapsulation buffers push the stack toward its guard region, HSM command queues serialise every request, and the RTOS scheduler now has to arbitrate between the crypto partition and the control loop. Unit tests and throughput benchmarks report means, while the failure lives in the joint p99.9 of several queues that never saturate on their own.

The failure worth hunting

The mode that matters is a cascade. The gateway restarts and every peer re-handshakes at once. The crypto service overruns, its watchdog fires and the HSM partition resets. Peers caught mid-establishment then retry in lockstep and recreate the storm that caused the reset. None of this is a cryptographic weakness, and functional tests never see it because each step is correct on its own. For fault tolerance, the only question is whether control traffic already protected by established session keys keeps flowing while the handshake path is on fire, which it does when microkernel isolation is genuine and does not when the crypto service shares a queue, a lock or a heap with the authenticated fieldbus path.

The storm test

Build a rig where each peer is an emulated node with a controllable start offset. Power-cycle the gateway and release every handshake inside the same scheduling window, while real control traffic keeps running at its nominal cycle. At the peak, inject the fault. Kill the HSM partition, force a watchdog reset of the crypto task, or flood it with ciphertexts of valid length that decapsulate to garbage under implicit rejection, so each one costs full work before the handshake fails. Measure three things: the end-to-end latency of the authenticated cyclic frames, the stack high-water mark of the crypto partition and the retry timing of peers after the reset. Repeat with randomised offsets and signing seeds until the tail stops moving, since a single pass measures luck, and write down the expected degraded mode before the run, because functional safety standards such as ISO 26262 and IEC 61508 accept fault injection as evidence only when both the fault and the resulting safe state trace back to the safety concept.

Decision rule

With the crypto task under a 100 ms watchdog supervision window, require the p99.9 latency of the crypto service during a synchronised storm to stay below half that window, and if it does not, redesign the gateway to shed or defer new handshakes with jittered backoff instead of queueing them, because a queue that grows faster than the HSM drains it turns load into a reset.

Technical FAQ: Why not make signing fully deterministic and remove the tail?

Constant-time code removes data-dependent timing inside an iteration, but it does not fix the iteration count, which ML-DSA exposes by design without harm. Padding every signature to the worst case would make timing deterministic, and the storm test would show the cost as lost throughput. The usual trade is to keep signing variable and put a bound on the queue in front of it.

Related Architecture Specifications (PQCECOSYSTEM): pqcaa.com · pqcsmartaccount.com · wcbdcvault.com

More Technical Articles on pqcembedded.com

Benchmarking Embedded Lattice Cryptography: ARM Cortex-M4 vs Custom RISC-V PQC Silicon →Implementing Post-Quantum Secure Firmware Updates on 64KB RAM Microcontrollers →Reference Architecture for Embedded PQC: Layering ML-KEM, ML-DSA and LMS Across Boot, Session and Fieldbus Domains →PQCEmbedded: Reference Architecture, Interoperability & Deterministic Telemetry →