pub struct DilithiumParamsMont;
Expand description
Optional: Dilithium parameters with Montgomery output Use this when you need coefficients to stay in Montgomery domain after inverse NTT
Trait Implementations§
Source§impl Clone for DilithiumParamsMont
impl Clone for DilithiumParamsMont
Source§fn clone(&self) -> DilithiumParamsMont
fn clone(&self) -> DilithiumParamsMont
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DilithiumParamsMont
impl Debug for DilithiumParamsMont
Source§impl Modulus for DilithiumParamsMont
impl Modulus for DilithiumParamsMont
Source§const BARRETT_MU: u128 = 4_299_165_187u128
const BARRETT_MU: u128 = 4_299_165_187u128
Barrett reduction constant mu = floor(2^k / Q)
Set to 0 for dynamic computation
Source§impl NttModulus for DilithiumParamsMont
impl NttModulus for DilithiumParamsMont
Source§const 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!
Source§const N_INV: u32 = 16_382u32
const N_INV: u32 = 16_382u32
N^-1 mod Q for final scaling in inverse NTT
This should be in Montgomery form: (N^-1 * R) mod Q
Source§const NEG_QINV: u32 = 4_236_238_847u32
const NEG_QINV: u32 = 4_236_238_847u32
-Q^-1 mod 2^32 for Montgomery reduction (sometimes called NEG_QINV or MONT_QINV)
Source§const PSIS: &'static [u32]
const PSIS: &'static [u32]
Twist factors ψ_i = ω^(bitrev(i)) in STANDARD domain (length N)
These are the N-th roots of the primitive 2N-th root of unity
Required for twisted/negacyclic NTT (Dilithium)
NOTE: FIPS-204 reference implementation does NOT use these!
Source§const INV_PSIS: &'static [u32]
const INV_PSIS: &'static [u32]
Inverse twist factors ψ_i^(-1) in STANDARD domain (length N)
Required for inverse twisted/negacyclic NTT (Dilithium)
NOTE: FIPS-204 reference implementation does NOT use these!
Source§const POST_INVNTT_MODE: PostInvNtt = PostInvNtt::Montgomery
const POST_INVNTT_MODE: PostInvNtt = PostInvNtt::Montgomery
How the coefficients should be post-processed after the inverse NTT. Read more
Auto Trait Implementations§
impl Freeze for DilithiumParamsMont
impl RefUnwindSafe for DilithiumParamsMont
impl Send for DilithiumParamsMont
impl Sync for DilithiumParamsMont
impl Unpin for DilithiumParamsMont
impl UnwindSafe for DilithiumParamsMont
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more