Skip to main content

byte_decode

Function byte_decode 

Source
pub fn byte_decode(d: usize, input: &[u8], f: &mut [u16; 256])
Expand description

Unpack 32*d bytes into 256 integers (Algorithm 6: ByteDecode_d).

The inverse of byte_encode. Each coefficient is extracted from d consecutive bits and reduced modulo 2^d (for d < 12) or modulo q = 3329 (for d = 12).

§Arguments

  • d - The bit-width per coefficient (1..=12).
  • input - Input buffer of exactly 32 * d bytes.
  • f - Output array of 256 unsigned 16-bit coefficients.

§Panics

Debug-asserts that input.len() == 32 * d.