Skip to main content

Module params

Module params 

Source
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.