pub trait NttModulus: Modulus {
const ZETA: u32;
const ZETAS: &'static [u32];
const N_INV: u32;
const MONT_R: u32;
const NEG_QINV: u32;
const PSIS: &'static [u32];
const INV_PSIS: &'static [u32];
const POST_INVNTT_MODE: PostInvNtt = PostInvNtt::Standard;
}
Expand description
Extended trait for NTT-enabled moduli
Required Associated Constants§
Sourceconst ZETAS: &'static [u32]
const ZETAS: &'static [u32]
Precomputed twiddle factors for forward NTT CRITICAL: For Dilithium, these are stored in MONTGOMERY domain (ζ·R mod q) exactly as in the FIPS-204 reference implementation. Do NOT convert them again - that would give ζ·R² mod q!
Sourceconst N_INV: u32
const N_INV: u32
N^-1 mod Q for final scaling in inverse NTT This should be in Montgomery form: (N^-1 * R) mod Q
Sourceconst NEG_QINV: u32
const NEG_QINV: u32
-Q^-1 mod 2^32 for Montgomery reduction (sometimes called NEG_QINV or MONT_QINV)
Provided Associated Constants§
Sourceconst POST_INVNTT_MODE: PostInvNtt = PostInvNtt::Standard
const POST_INVNTT_MODE: PostInvNtt = PostInvNtt::Standard
How the coefficients should be post-processed after the inverse NTT.
Standard
→ Kyber / Saber styleMontgomery
→ Dilithium style (invntt_tomont
)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.