Skip to main content

simple_bit_pack

Function simple_bit_pack 

Source
pub fn simple_bit_pack(w: &[i32; 256], b: u32, out: &mut [u8])
Expand description

Pack a polynomial whose coefficients lie in [0, b].

Implements Algorithm 16 of FIPS 204 (SimpleBitPack). Each coefficient is stored using bitlen(b) bits in little-endian bit order.

  • w: input polynomial with coefficients in [0, b].
  • b: upper bound on coefficient values.
  • out: output buffer (must have length >= N * bitlen(b) / 8).