Expand description
Parameters for the KyberLib library. Constants and parameters for the FIPS 203 ML-KEM scheme.
v0.0.7 renames the public constants from KYBER_* to ML_KEM_*
(issue #151). The old names are retained as #[deprecated]
aliases for one release so downstream consumers can migrate at
their own pace.
For per-parameter-set sized constants (ML-KEM-512, ML-KEM-768,
ML-KEM-1024) once #130c lands, prefer the inherent associated
constants on the marker types — e.g. crate::MlKem768::PUBLIC_KEY_BYTES.
The free constants in this module pin to the current build’s
parameter set (currently always ML-KEM-768; kyber512 and
kyber1024 Cargo features are reserved but disabled).
Constants§
- KYBER_
90S - Alias for
ML_KEM_90S. Renamed v0.0.7 (#151). - KYBER_
CIPHERTEXT_ BYTES - Alias for
ML_KEM_CIPHERTEXT_BYTES. Renamed v0.0.7 (#151). - KYBER_
ETA1 - Alias for
ML_KEM_ETA1. Renamed v0.0.7 (#151). - KYBER_
ETA2 - Alias for
ML_KEM_ETA2. Renamed v0.0.7 (#151). - KYBER_
INDCPA_ BYTES - Alias for
ML_KEM_INDCPA_BYTES. Renamed v0.0.7 (#151). - KYBER_
INDCPA_ PUBLIC_ KEY_ BYTES - Alias for
ML_KEM_INDCPA_PUBLIC_KEY_BYTES. Renamed v0.0.7 (#151). - KYBER_
INDCPA_ SECRET_ KEY_ BYTES - Alias for
ML_KEM_INDCPA_SECRET_KEY_BYTES. Renamed v0.0.7 (#151). - KYBER_N
- Alias for
ML_KEM_N. Renamed v0.0.7 (#151). - KYBER_
POLYVEC_ BYTES - Alias for
ML_KEM_POLYVEC_BYTES. Renamed v0.0.7 (#151). - KYBER_
POLYVEC_ COMPRESSED_ BYTES - Alias for
ML_KEM_POLYVEC_COMPRESSED_BYTES. Renamed v0.0.7 (#151). - KYBER_
POLY_ BYTES - Alias for
ML_KEM_POLY_BYTES. Renamed v0.0.7 (#151). - KYBER_
POLY_ COMPRESSED_ BYTES - Alias for
ML_KEM_POLY_COMPRESSED_BYTES. Renamed v0.0.7 (#151). - KYBER_
PUBLIC_ KEY_ BYTES - Alias for
ML_KEM_PUBLIC_KEY_BYTES. Renamed v0.0.7 (#151). - KYBER_Q
- Alias for
ML_KEM_Q. Renamed v0.0.7 (#151). - KYBER_
SECRET_ KEY_ BYTES - Alias for
ML_KEM_SECRET_KEY_BYTES. Renamed v0.0.7 (#151). - KYBER_
SECURITY_ PARAMETER - Alias for
ML_KEM_SECURITY_PARAMETER. Renamed v0.0.7 (#151). - KYBER_
SHARED_ SECRET_ BYTES - Alias for
ML_KEM_SHARED_SECRET_BYTES. Renamed v0.0.7 (#151). - KYBER_
SYM_ BYTES - Alias for
ML_KEM_SYM_BYTES. Renamed v0.0.7 (#151). - ML_
KEM_ 90S - Enables or disables 90’s mode (AES-CTR + SHA2 instead of SHAKE).
- ML_
KEM_ CIPHERTEXT_ BYTES - Size of the IND-CCA ciphertext (same as the IND-CPA ciphertext).
- ML_
KEM_ ETA1 - Noise parameter eta1 — width of the centred binomial distribution for the secret-key sampling.
- ML_
KEM_ ETA2 - Noise parameter eta2 — width of the centred binomial distribution for the ciphertext-noise sampling. Always 2 in FIPS 203.
- ML_
KEM_ INDCPA_ BYTES - Size of the IND-CPA ciphertext.
- ML_
KEM_ INDCPA_ PUBLIC_ KEY_ BYTES - Size of the IND-CPA public key (polynomial vector + 32-byte
publicseed). - ML_
KEM_ INDCPA_ SECRET_ KEY_ BYTES - Size of the IND-CPA secret key (one polynomial vector).
- ML_
KEM_ N - Polynomial degree N — the ring is
R_q = Z_q[X] / (X^256 + 1). - ML_
KEM_ POLYVEC_ BYTES - Serialized size of the polynomial vector (k polynomials).
- ML_
KEM_ POLYVEC_ COMPRESSED_ BYTES - Compressed serialized size of the polynomial vector (for the u half of the ciphertext).
- ML_
KEM_ POLY_ BYTES - Serialized size of a single polynomial in the ring. 384 = 256 * 12 / 8.
- ML_
KEM_ POLY_ COMPRESSED_ BYTES - Compressed serialized size of a single polynomial (for the v half of the ciphertext). 128 bytes for ML-KEM-512/768 (d_v = 4), 160 bytes for ML-KEM-1024 (d_v = 5).
- ML_
KEM_ PUBLIC_ KEY_ BYTES - Size of the public encapsulation key (same as the IND-CPA public key).
- ML_
KEM_ Q - Modulus q for the cyclotomic ring. ML-KEM uses q = 3329 for every parameter set; the value is what enables the NTT to map cleanly to a power-of-two-friendly representation.
- ML_
KEM_ SECRET_ KEY_ BYTES - Size of the secret decapsulation key.
- ML_
KEM_ SECURITY_ PARAMETER - The module rank
k— number of polynomials in the secret-key / public-key polynomial vectors. - ML_
KEM_ SHARED_ SECRET_ BYTES - Size of the shared secret K.
- ML_
KEM_ SYM_ BYTES - Size in bytes of seeds, message inputs, and shared secrets.