ML-KEM: keygen/encaps/decaps and the KEM.KEM instance #
keygen/encaps/decaps are FIPS 203 Algorithms 19-21, written against Primitives.primitives
so that variants such as hedged encapsulation can change them locally.
Reliable s states that the draw from s decapsulates correctly. It is not characterized in
terms of the sampled noise.
ML-KEM.KeyGen_internal.
Equations
- One or more equations did not get rendered due to their size.
Instances For
ML-KEM.Encaps_internal.
Equations
- One or more equations did not get rendered due to their size.
Instances For
ML-KEM.Decaps_internal. Compares ciphertexts by their ByteArray encodings.
Equations
- One or more equations did not get rendered due to their size.
Instances For
FIPS 203 §7.2/§7.3 input-validation checks #
The internal algorithms above do not validate keys; callers run these checks first.
FIPS 203 §7.2 modulus check: tHatEncoded survives a decode/encode round trip.
Equations
- One or more equations did not get rendered due to their size.
Instances For
FIPS 203 §7.3 hash check: dk.ekHash = H(ekPKE).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The i-th 32-byte block derived from seed.
Equations
- Cryptlib.Primitives.KEM.FIPS203.seedBlock seed i = Cryptlib.Util.Bytes.toVecN 32 (SLHDSA.Concrete.Keccak.shake256 ((Cryptlib.Util.Bytes.ofVector seed).push i.toUInt8) 32)
Instances For
Counter plus the original seed.
Instances For
Equations
- Cryptlib.Primitives.KEM.FIPS203.nextDraw (i, seed) = EStateM.Result.ok (Cryptlib.Primitives.KEM.FIPS203.seedBlock seed i) (i + 1, seed)
Instances For
Equations
- Cryptlib.Primitives.KEM.FIPS203.stateFromSeed seed = (0, seed)
Instances For
The KEM.KEM instance #
The next draw from s, encapsulated against any key pair, decapsulates correctly.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Cryptlib.Primitives.KEM.FIPS203.decapM ps sk c = pure (Cryptlib.Primitives.KEM.FIPS203.decaps ps ↑sk ↑c)
Instances For
Equations
- Cryptlib.Primitives.KEM.FIPS203.derivePublicKeyM ps sk = ⟨(↑sk).ekPKE, ⋯⟩
Instances For
Round trip from a Reliable state. Uses simp only on hc; injection times out on the
CT subtype.
Equations
Instances For
Equations
Instances For
Equations
Instances For
Equations
Instances For
ML-KEM with the expanded FIPS 203 private key.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Seed-format private keys #
kemSeed stores the private key as the seed (d, z), encoded ek ‖ d ‖ z, and re-expands it on
use. Everything else is as in kem.
Equations
- Cryptlib.Primitives.KEM.FIPS203.SeedPrivateKey = (MLKEM.Seed32 × MLKEM.Seed32)
Instances For
Equations
- Cryptlib.Primitives.KEM.FIPS203.derivePublicKeyFromSeed ps sk = ⟨(Cryptlib.Primitives.KEM.FIPS203.keygen ps sk.1 sk.2).1, ⋯⟩
Instances For
The expanded decapsulation key for a seed, recomputed on every call.
Equations
- Cryptlib.Primitives.KEM.FIPS203.expandSeed ps sk = ⟨(Cryptlib.Primitives.KEM.FIPS203.keygen ps sk.1 sk.2).2, ⋯⟩
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
ML-KEM with the ek ‖ d ‖ z seed private key.
Equations
- One or more equations did not get rendered due to their size.