KyberConstants

Constants for ML-KEM.

This class contains precomputed values for optimization purposes.

Author

Ron Lauren Hombre

Properties

Link copied to clipboard
const val BARRETT_APPROX: Short = 20159

Approximation of Q for Barrett Reduction

Link copied to clipboard
const val ENCODE_SIZE: Int

Encoding size for encoding coefficients and terms.

Link copied to clipboard
const val MONT_R2: Short = 1353

2^16 * 2^16 (mod Q) for Montgomery Reduction.

Link copied to clipboard
const val N: Int = 256

Number of coefficients in the polynomial.

Link copied to clipboard
const val N_BYTES: Int

The byte size of the number of coefficients in bits.

Link copied to clipboard

Pre-generated Gamma values according to the formula 17^(2 * bitReverse(n)) mod Q and converted to Montgomery Form.

Link copied to clipboard

Pre-generated Zeta values according to the formula 17^bitReverse(n) mod Q and converted to Montgomery Form.

Link copied to clipboard
const val Q: Int = 3329

Prime Integer composed of (2^8 * 13) + 1.

Link copied to clipboard
const val Q_HALF: Int = 1665

Half of Q rounded to the closest whole integer.

Link copied to clipboard
const val Q_INV: Int

Negated modular inverse of Q base 2^16

Link copied to clipboard

The length of the Shared Secret Key in bytes.