ML-KEM: the FIPS 203 implicit-rejection wrapper #
ML-KEM turns K-PKE into a key-encapsulation mechanism by a Fujisaki–Okamoto-style transform with implicit rejection (NIST, Section 6, Algorithms 16–18):
- key generation stores the decapsulation key
dk = (dk_PKE, ek, H(ek), z)with a secret seedz; - encapsulation samples
m, derives(K, r) = G(m ‖ H(ek))and outputsc = Enc(ek, m; r)and the shared keyK; - decapsulation decrypts
m' = Dec(dk_PKE, c), derives(K', r') = G(m' ‖ h), and returnsK'ifEnc(ek, m'; r') = cand the rejection keyJ(z ‖ c)otherwise.
The wrapper is stated for any ExplicitCoinPKE, and the re-encryption check is the existing
FujisakiOkamoto.decT with coin function m ↦ (G(m ‖ h)).2 (decapsWith_eq). Unlike
FujisakiOkamoto.Scheme.decapsNotBot, which derives keys as H(m, c) and rejection keys
from a message-space seed, ML-KEM takes the shared key from G without hashing c, binds the
public key into G through H(ek), and derives rejection keys from an independent seed z.
G, H and J are arbitrary functions; no random-oracle security statement is made here. G
returns the encryption coins directly, where FIPS 203 returns a seed expanded by PRF and
SamplePolyCBD. The input checks of FIPS 203, Section 7 (encapsulation-key modulus check,
decapsulation-key hash check H(ek) = h, length checks) are not modelled; the typed keys make the
length and modulus checks vacuous, but the hash check is simply omitted.
Main definitions #
Cslib.Crypto.Protocols.MLKEMTransform.DecapsKey: decapsulation keys(sk, pk, H(pk), z).Cslib.Crypto.Protocols.MLKEMTransform.keyGenWith,Cslib.Crypto.Protocols.MLKEMTransform.encapsWith,Cslib.Crypto.Protocols.MLKEMTransform.decapsWith: the transform over anExplicitCoinPKE.Cslib.Crypto.MLKEM.kemKeyGen,Cslib.Crypto.MLKEM.kemEncaps,Cslib.Crypto.MLKEM.kemDecaps: ML-KEM, the transform applied to K-PKE with uniformn-bit messages (n = 256for the standard sets) and 256-bit seeds.
Main results #
Cslib.Crypto.Protocols.MLKEMTransform.decapsWith_encT: honest decapsulation returns the encapsulated key whenever the underlying decryption is correct.Cslib.Crypto.Protocols.MLKEMTransform.decapsWith_of_reencrypt_ne: implicit rejection.Cslib.Crypto.MLKEM.kemDecaps_encrypt_of_noise_le: ML-KEM correctness from the bounded-noise correctness of K-PKE.
References #
- NIST, Module-Lattice-Based Key-Encapsulation Mechanism Standard, Sections 6 and 7
- [Hofheinz, Hövelmanns, Kiltz, A Modular Analysis of the Fujisaki–Okamoto Transformation] [HHK17]
An ML-KEM decapsulation key: the PKE secret key, the public key, its hash H(pk) and the
implicit-rejection seed z.
- sk : SK
PKE secret key
dk_PKE. - pk : PK
Public (encapsulation) key
ek, kept for the re-encryption check. - pkHash : Hk
Stored hash
h = H(ek). - seed : Z
Implicit-rejection seed
z.
Key generation: run the PKE key generation, sample the seed z, and store H(pk).
Encapsulation: sample m, derive (K, r) = G(m ‖ H(pk)), and output (Enc(pk, m; r), K).
Decapsulation with implicit rejection: accept m' through the re-encryption check decT with
coins (G(m' ‖ h)).2 and return (G(m' ‖ h)).1, or return J(z ‖ c) on rejection.
FIPS 203 form of decapsulation (NIST, Section 6, Algorithm 18): after
m' = Dec(sk, c), return K' if re-encrypting m' with r' gives c, and J(z ‖ c)
otherwise, where (K', r') = G(m' ‖ h).
Correctness: if the PKE decrypts the honest ciphertext Enc(pk, m; (G(m ‖ h)).2), then
decapsulation returns the encapsulated key (G(m ‖ h)).1.
Implicit rejection: a ciphertext that fails the re-encryption check decapsulates to the
rejection key J(z ‖ c).
Every key pair produced by keyGenWith stores the public key and its hash.
ML-KEM decapsulation keys over K-PKE, with 256-bit public-key hashes and seeds.
Correctness of ML-KEM: for an honest key pk = (A, A s + e) and a message m whose
derived coins (G(m ‖ H(pk))).2 = (r, e₁, e₂) keep every coefficient of the K-PKE decryption
noise within B, where 4 * B + 2 < q, decapsulating the honest ciphertext
Enc(pk, m; (G(m ‖ H(pk))).2) produced by kemEncaps on message m returns its key.