Skip to main content

rej_ntt_poly

Function rej_ntt_poly 

Source
pub fn rej_ntt_poly(rho: &[u8; 32], j1: u8, j2: u8) -> [i32; 256]
Expand description

Generate an NTT-domain polynomial via rejection sampling.

Implements Algorithm 30 of FIPS 204 (RejNTTPoly). Samples coefficients uniformly from [0, q) by reading 3 bytes at a time from a SHAKE128 stream seeded with rho || j1 || j2. Candidates >= q are rejected.

  • rho: 32-byte public seed.
  • j1: column index of the matrix entry (s index).
  • j2: row index of the matrix entry (r index).

Returns a polynomial in NTT domain with coefficients in [0, q-1].