Ring
, PolynomialRing
, Module
Sampler
Ring , Quotient Ring , Module , Matrix () and matrix multiplication.
Polynomial ring with polynomial modulo operation.
See Kyber spec.
Idea behind is simple: since , let's use every 12 bits from a uniform random bytes string to generate a coeff in the NTT form of .
Furthermore, when the 12-bit value , reject it.
Every 2 12-bit = 3 bytes, thus every 3 bytes can product at most 2 elements subject the sample rejection.
To sample a value from : Sample , outputs .
To sample a , just sample each coeff from .
Namely Encoding/Decoding in Kyber Spec.
All available in RustCryto
FLPS-202 | 90s variant | |
---|---|---|
PRF | SHAKE-256 | AES-256-CTR |
XOF | SHAKE-128 | AES-256-CTR |
KDF | SHAKE-256 | SHA-256 |
Hash.H | SHA3-256 | SHA-256 |
Hash.G | SHA3-512 | SHA-512 |
See Algorithm 4~9 in Kyber's spec.