Moving Decapsulation Off ECDH Without Losing the Floor Under It

The blinding that protected your ECDH scalar multiplication does nothing for ML-KEM decapsulation. In ML-KEM the secret is a polynomial vector that passes through the NTT, a decoding step and a full re-encryption before a single comparison decides the output. Each of those stages leaks in its own way, and the comparison is also where one well-timed glitch turns the KEM into an oracle. Treat the migration as a new physical security budget, not a library swap, and spend it first on whatever keeps the handshake safe when a specific component misbehaves.

Hybrid first, because it is the cheap insurance

Run X25519 and ML-KEM side by side and feed both shared secrets into the key schedule. That way a broken lattice implementation drops you back to today's classical security, not to zero. The cost is measurable: about one extra kilobyte of ciphertext on the wire per handshake (estimate) and a second key exchange in the latency path. That is what you pay to avoid betting every session on a codebase no lab has evaluated yet. The hybrid also buys time, because you can ship constant-time ML-KEM now and harden it in place without a flag day. It does not protect long-lived ML-KEM private keys, though: an attacker who extracts one through power analysis gets every future session that key touches, hybrid or not.

Where the old countermeasures stop

Scalar blinding and point randomization were arithmetic tricks applied to one group operation. ML-KEM needs Boolean and arithmetic masking carried through sampling, the NTT, compression and the comparison, and the conversions between those two domains take most of the extra cycles. Masking the centered binomial sampler and the compress function is where those cycles go, and a first-order masked decapsulation usually costs several times the unmasked cycle count (estimate). On an HSM with a 2 ms per-decapsulation service budget, that multiplier decides whether you buy new hardware or ship on what you have. Fault resistance adds more on top: redundant re-encryption, consistency checks on the NTT output, and a comparison written so that a skipped instruction cannot return success. Your existing module certifications under schemes such as FIPS 140 and Common Criteria will not carry over either, so budget the lab cycle as its own line item instead of hoping it folds into the next renewal.

The failure that justifies the spend

A single glitch that skips the ciphertext comparison makes decapsulation return the real shared secret for malformed ciphertexts instead of the implicit rejection value, and a modest number of chosen queries against that oracle recovers the long-term key, which is why the comparison and the rejection path get redundancy before anything else gets masked.

A rule for deciding what to harden

Mask and fault-protect decapsulation only where a private key lives longer than one session and someone other than you can physically reach the device: HSMs, smart cards, vehicle ECUs and field gateways. Everywhere else, constant-time code, ephemeral keys and the hybrid fallback cover the realistic threat. Every fault check should fail closed: return the implicit rejection value, increment a counter, and rate-limit the key after repeated detections, so a glitching campaign uses up the attacker's attempts instead of your availability. That counter is also your field evidence. If it never moves, the redundancy cost you cycles and nothing else, and if it spikes on one device class, that tells you where next quarter's money goes. Rate limiting does turn an attack into a denial of service, so decide now whether those devices fall back to the classical leg alone or refuse service, because there will be no time to argue it during the incident.

Can we ship unmasked ML-KEM on our HSMs during the transition?

Yes, as long as those ML-KEM keys are ephemeral and the session stays hybrid, because a leaked ephemeral key exposes one session that the classical leg still protects. Once static ML-KEM keys are used for identity or key transport, masking stops being optional and becomes part of the migration budget.

Back to MLKEMGuard · Domains

← Back to MLKEMGuard
Engineering & Architecture Brief

Moving Decapsulation Off ECDH Without Losing the Floor Under It

The blinding that protected your ECDH scalar multiplication does nothing for ML-KEM decapsulation. In ML-KEM the secret is a polynomial vector that passes through the NTT, a decoding step and a full re-encryption before a single comparison decides the output. Each of those stages leaks in its own way, and the comparison is also where one well-timed glitch turns the KEM into an oracle. Treat the migration as a new physical security budget, not a library swap, and spend it first on whatever keeps the handshake safe when a specific component misbehaves.

Hybrid first, because it is the cheap insurance

Run X25519 and ML-KEM side by side and feed both shared secrets into the key schedule. That way a broken lattice implementation drops you back to today's classical security, not to zero. The cost is measurable: about one extra kilobyte of ciphertext on the wire per handshake (estimate) and a second key exchange in the latency path. That is what you pay to avoid betting every session on a codebase no lab has evaluated yet. The hybrid also buys time, because you can ship constant-time ML-KEM now and harden it in place without a flag day. It does not protect long-lived ML-KEM private keys, though: an attacker who extracts one through power analysis gets every future session that key touches, hybrid or not.

Where the old countermeasures stop

Scalar blinding and point randomization were arithmetic tricks applied to one group operation. ML-KEM needs Boolean and arithmetic masking carried through sampling, the NTT, compression and the comparison, and the conversions between those two domains take most of the extra cycles. Masking the centered binomial sampler and the compress function is where those cycles go, and a first-order masked decapsulation usually costs several times the unmasked cycle count (estimate). On an HSM with a 2 ms per-decapsulation service budget, that multiplier decides whether you buy new hardware or ship on what you have. Fault resistance adds more on top: redundant re-encryption, consistency checks on the NTT output, and a comparison written so that a skipped instruction cannot return success. Your existing module certifications under schemes such as FIPS 140 and Common Criteria will not carry over either, so budget the lab cycle as its own line item instead of hoping it folds into the next renewal.

The failure that justifies the spend

A single glitch that skips the ciphertext comparison makes decapsulation return the real shared secret for malformed ciphertexts instead of the implicit rejection value, and a modest number of chosen queries against that oracle recovers the long-term key, which is why the comparison and the rejection path get redundancy before anything else gets masked.

A rule for deciding what to harden

Mask and fault-protect decapsulation only where a private key lives longer than one session and someone other than you can physically reach the device: HSMs, smart cards, vehicle ECUs and field gateways. Everywhere else, constant-time code, ephemeral keys and the hybrid fallback cover the realistic threat. Every fault check should fail closed: return the implicit rejection value, increment a counter, and rate-limit the key after repeated detections, so a glitching campaign uses up the attacker's attempts instead of your availability. That counter is also your field evidence. If it never moves, the redundancy cost you cycles and nothing else, and if it spikes on one device class, that tells you where next quarter's money goes. Rate limiting does turn an attack into a denial of service, so decide now whether those devices fall back to the classical leg alone or refuse service, because there will be no time to argue it during the incident.

Technical FAQ: Can we ship unmasked ML-KEM on our HSMs during the transition?

Yes, as long as those ML-KEM keys are ephemeral and the session stays hybrid, because a leaked ephemeral key exposes one session that the classical leg still protects. Once static ML-KEM keys are used for identity or key transport, masking stops being optional and becomes part of the migration budget.

Related Architecture Specifications (PQCECOSYSTEM): mlkemcompliant.com · mlkemshield.com · pqcecosystem.com

More Technical Articles on mlkemguard.com

Combating Machine-Learning-Driven Man-in-the-Middle Cryptographic Downgrade Attacks →Tuning Memory Buffers and Epoll Workers for 4KB+ Post-Quantum TLS Handshakes →