int16_t MLKEM_POLY_scalar_decompress_d10(uint16_t u)
Scalar decompression with d=10.
void MLKEM_POLY_sub(poly *r, const poly *b)
Subtracts polynomial b from polynomial r in place.
int16_t MLKEM_POLY_fqmul(int16_t a, int16_t b)
Multiplication in the NTT domain followed by Montgomery reduction.
int16_t MLKEM_POLY_scalar_decompress_d4(uint8_t u)
Scalar decompression with d=4.
void MLKEM_POLY_decompress_d5(poly *r, const uint8_t *a)
Decompresses a polynomial from bytes with dv=5.
void MLKEM_POLY_decompress_d4(poly *r, const uint8_t *a)
Decompresses a polynomial from bytes with dv=4.
void MLKEM_POLY_basemul_acc_montgomery(poly *r, const poly *a, const poly *b, int32_t first)
Pointwise multiplication of two polynomials in NTT domain with accumulation.
void MLKEM_POLY_tomont(poly *r)
Converts a polynomial to Montgomery domain.
void MLKEM_POLY_reduce(poly *r)
Applies Barrett reduction to all coefficients and map to [0, q-1].
uint8_t MLKEM_POLY_scalar_compress_d4(int16_t u)
Scalar compression with d=4.
uint8_t MLKEM_POLY_scalar_compress_d5(int16_t u)
Scalar compression with d=5.
void MLKEM_POLY_ntt(poly *p)
Computes the NTT of a polynomial in place.
void MLKEM_POLY_tobytes(uint8_t *r, const poly *a)
Serializes a polynomial to bytes (12 bits per coefficient).
int16_t MLKEM_POLY_signed_to_unsigned_q(int16_t c)
Maps a signed representative to an unsigned one in [0, q-1].
void MLKEM_POLY_compress_d5(uint8_t *r, const poly *a)
Compresses a polynomial with dv=5 and serialize to bytes.
uint8_t MLKEM_POLY_scalar_compress_d1(int16_t u)
Scalar compression with d=1.
int16_t MLKEM_POLY_barrett_reduce(int16_t a)
Barrett reduction of a coefficient modulo q.
void MLKEM_POLY_tomsg(uint8_t *msg, const poly *a)
Encodes a polynomial into a 32-byte message.
int16_t MLKEM_POLY_montgomery_reduce(int32_t a)
Montgomery reduction of a 32-bit integer.
void MLKEM_POLY_compress_d11(uint8_t *r, const poly *a)
Compresses a polynomial with du=11 and serialize to bytes.
void MLKEM_POLY_invntt_tomont(poly *p)
Computes the inverse NTT and multiply by Montgomery factor.
void MLKEM_POLY_decompress_d11(poly *r, const uint8_t *a)
Decompresses a polynomial from bytes with du=11.
void MLKEM_POLY_decompress_d10(poly *r, const uint8_t *a)
Decompresses a polynomial from bytes with du=10.
void MLKEM_POLY_frombytes(poly *r, const uint8_t *a)
Deserializes a polynomial from bytes (12 bits per coefficient).
int16_t MLKEM_POLY_scalar_decompress_d5(uint8_t u)
Scalar decompression with d=5.
uint16_t MLKEM_POLY_scalar_compress_d11(int16_t u)
Scalar compression with d=11.
void MLKEM_POLY_add(poly *r, const poly *b)
Adds polynomial b to polynomial r in place.
uint16_t MLKEM_POLY_scalar_compress_d10(int16_t u)
Scalar compression with d=10.
void MLKEM_POLY_frommsg(poly *r, const uint8_t *msg)
Decodes a 32-byte message into a polynomial.
void MLKEM_POLY_compress_d4(uint8_t *r, const poly *a)
Compresses a polynomial with dv=4 and serialize to bytes.
int16_t MLKEM_POLY_scalar_decompress_d11(uint16_t u)
Scalar decompression with d=11.
void MLKEM_POLY_compress_d10(uint8_t *r, const poly *a)
Compresses a polynomial with du=10 and serialize to bytes.
ML-KEM (Module-Lattice Key Encapsulation Mechanism) public API.
Polynomial with MLKEM_N coefficients.