Skip to main content

Module encode

Module encode 

Source
Expand description

Byte encoding/decoding and compression/decompression (Algorithms 3-6).

Functionsยง

byte_decode
Unpack 32*d bytes into 256 integers (Algorithm 6: ByteDecode_d).
byte_encode
Bit-pack 256 integers into 32*d bytes (Algorithm 5: ByteEncode_d).
compress
Lossy compression from Z_q to Z_{2^d} (FIPS 203 eq. 4.7).
compress_poly
Compress all 256 coefficients of a polynomial from Z_q to Z_{2^d}.
decompress
Decompression from Z_{2^d} back to Z_q (FIPS 203 eq. 4.8).
decompress_poly
Decompress all 256 coefficients of a polynomial from Z_{2^d} to Z_q.