Implicit Rejection in ML-KEM Decapsulation: The Clause That Deletes Your Error Path

FIPS 203 does not let ML-KEM decapsulation fail when it receives a bad ciphertext. If the re-encrypted ciphertext does not match the one received, the algorithm must still return a 32-byte key, derived from the secret seed z and the ciphertext, and it must do so through code whose timing does not reveal which key came out. That one requirement removes the error branch from the Fujisaki-Okamoto core. It also changes how you write the comparison, how you select the key, what your tests cover and what evidence you give a reviewer.

Three families of standards, three different questions

Compliance evidence for an ML-KEM module answers three separate questions, and the standards fall into three groups to match. The algorithm specification, FIPS 203 together with NIST's KEM usage guidance, says what the outputs must be. Conformance validation, meaning algorithm testing through the ACVP harness and then module validation under the FIPS 140 programme, shows that your outputs match the specification on vectors you did not choose. Side-channel assessment, which follows non-invasive test methods such as the leakage detection approach in ISO/IEC 17825, shows that how the output is produced reveals nothing the output itself does not. The version matters in one place. Code derived from the round 3 Kyber submission hashed the ciphertext into the final shared secret and derived the rejection key differently, so a codebase that was "ported from Kyber" will produce wrong keys on both the accept and reject paths until the key derivation is rewritten to the final FIPS 203 form.

What the clause forces into the code

Decapsulation decrypts to m', re-encrypts to c', and has to choose between the genuine key K' and the rejection key computed as J(z || c). The only defensible way to choose is to compute both every time and pick one with a mask built from a constant-time comparison over the full ciphertext, which for ML-KEM-768 is 1088 bytes. The classic failure is a memcmp that stops at the first differing byte, or a branchless mask that an optimising compiler quietly turns back into a conditional jump. Either one gives an attacker a timing signal that separates valid ciphertexts from invalid ones, and that is exactly the chosen-ciphertext oracle the Fujisaki-Okamoto transform exists to remove. Computing J unconditionally costs very little, a few percent of decapsulation time by estimate, because the re-encryption with its matrix expansion and vectorised NTT dominates. So there is no performance argument for a fast path, and a reviewer should treat any fast path as a finding.

Failures that get absorbed, and failures that should hide nothing

Implicit rejection keeps a deployed system running when one party sends garbage: the receiver returns a pseudorandom key, the protocol moves on, and the handshake fails later at key confirmation, where failure is already public and carries no information about the secret key. The same property hides your own bugs. A lane misordering in the AVX-512 NTT, or a Barrett reduction that leaves coefficients in the range [0, 2q) before compression, makes c' differ from c on every call, so every decapsulation silently rejects and the only symptom is an interop failure two layers up. That is why the evidence file needs known-answer tests that exercise both paths: ACVP decapsulation vectors with modified ciphertexts that must produce the exact rejection key, plus a differential check running the vectorised build against a portable reference on the same random inputs. Keep explicit errors separate from implicit rejection. The encapsulation key modulus check, the decapsulation key hash check and ciphertext length validation are all allowed to return errors, because they depend on public lengths or on key material the caller controls, never on whether an attacker's ciphertext happened to decrypt cleanly.

The decision rule for the review: every call that receives a correctly sized ciphertext and a key that passed its checks must return 32 bytes, in time that does not depend on whether c equals c', and any error the module can raise must be traceable to a length or a key check, never to the contents of the ciphertext.

Should the module count or log implicit rejections for operational monitoring?

Not inside the cryptographic boundary. A counter, log line or return flag that the caller can see rebuilds the valid versus invalid oracle that implicit rejection removed, and even a log write that changes timing can leak it. For telemetry, use the key confirmation failure the protocol layer already reports. The cost you accept is that a corrupted peer and a buggy local NTT look the same in production, which is why differential testing before release has to carry that weight instead.

Back to MLKEMCipher · Domains

← Back to MLKEMCipher
Engineering & Architecture Brief

Implicit Rejection in ML-KEM Decapsulation: The Clause That Deletes Your Error Path

FIPS 203 does not let ML-KEM decapsulation fail when it receives a bad ciphertext. If the re-encrypted ciphertext does not match the one received, the algorithm must still return a 32-byte key, derived from the secret seed z and the ciphertext, and it must do so through code whose timing does not reveal which key came out. That one requirement removes the error branch from the Fujisaki-Okamoto core. It also changes how you write the comparison, how you select the key, what your tests cover and what evidence you give a reviewer.

Three families of standards, three different questions

Compliance evidence for an ML-KEM module answers three separate questions, and the standards fall into three groups to match. The algorithm specification, FIPS 203 together with NIST's KEM usage guidance, says what the outputs must be. Conformance validation, meaning algorithm testing through the ACVP harness and then module validation under the FIPS 140 programme, shows that your outputs match the specification on vectors you did not choose. Side-channel assessment, which follows non-invasive test methods such as the leakage detection approach in ISO/IEC 17825, shows that how the output is produced reveals nothing the output itself does not. The version matters in one place. Code derived from the round 3 Kyber submission hashed the ciphertext into the final shared secret and derived the rejection key differently, so a codebase that was "ported from Kyber" will produce wrong keys on both the accept and reject paths until the key derivation is rewritten to the final FIPS 203 form.

What the clause forces into the code

Decapsulation decrypts to m', re-encrypts to c', and has to choose between the genuine key K' and the rejection key computed as J(z || c). The only defensible way to choose is to compute both every time and pick one with a mask built from a constant-time comparison over the full ciphertext, which for ML-KEM-768 is 1088 bytes. The classic failure is a memcmp that stops at the first differing byte, or a branchless mask that an optimising compiler quietly turns back into a conditional jump. Either one gives an attacker a timing signal that separates valid ciphertexts from invalid ones, and that is exactly the chosen-ciphertext oracle the Fujisaki-Okamoto transform exists to remove. Computing J unconditionally costs very little, a few percent of decapsulation time by estimate, because the re-encryption with its matrix expansion and vectorised NTT dominates. So there is no performance argument for a fast path, and a reviewer should treat any fast path as a finding.

Failures that get absorbed, and failures that should hide nothing

Implicit rejection keeps a deployed system running when one party sends garbage: the receiver returns a pseudorandom key, the protocol moves on, and the handshake fails later at key confirmation, where failure is already public and carries no information about the secret key. The same property hides your own bugs. A lane misordering in the AVX-512 NTT, or a Barrett reduction that leaves coefficients in the range [0, 2q) before compression, makes c' differ from c on every call, so every decapsulation silently rejects and the only symptom is an interop failure two layers up. That is why the evidence file needs known-answer tests that exercise both paths: ACVP decapsulation vectors with modified ciphertexts that must produce the exact rejection key, plus a differential check running the vectorised build against a portable reference on the same random inputs. Keep explicit errors separate from implicit rejection. The encapsulation key modulus check, the decapsulation key hash check and ciphertext length validation are all allowed to return errors, because they depend on public lengths or on key material the caller controls, never on whether an attacker's ciphertext happened to decrypt cleanly.

The decision rule for the review: every call that receives a correctly sized ciphertext and a key that passed its checks must return 32 bytes, in time that does not depend on whether c equals c', and any error the module can raise must be traceable to a length or a key check, never to the contents of the ciphertext.

Technical FAQ: Should the module count or log implicit rejections for operational monitoring?

Not inside the cryptographic boundary. A counter, log line or return flag that the caller can see rebuilds the valid versus invalid oracle that implicit rejection removed, and even a log write that changes timing can leak it. For telemetry, use the key confirmation failure the protocol layer already reports. The cost you accept is that a corrupted peer and a buggy local NTT look the same in production, which is why differential testing before release has to carry that weight instead.

Related Architecture Specifications (PQCECOSYSTEM): militarytpm.com · mlkemprotocol.com · mlkemvault.com

More Technical Articles on mlkemcipher.com

Mathematical Foundations of Module Learning with Errors (M-LWE) →Assembly-Level Vectorization: Benchmarking AVX-512 vs ARM NEON in ML-KEM →