pub struct DilithiumParams;
Expand description
General Dilithium parameter set used by the signature implementation
Trait Implementations§
Source§impl Clone for DilithiumParams
impl Clone for DilithiumParams
Source§fn clone(&self) -> DilithiumParams
fn clone(&self) -> DilithiumParams
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 DilithiumParams
impl Debug for DilithiumParams
Source§impl Modulus for DilithiumParams
impl Modulus for DilithiumParams
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 DilithiumParams
impl NttModulus for DilithiumParams
Source§const N_INV: u32 = 16_382u32
const N_INV: u32 = 16_382u32
N^-1 mod Q in Montgomery form: 256^-1 · R mod Q = 16_382
This is the value used by the reference invntt_tomont
.
Calculation: (8_347_681 * 4_193_792) mod 8_380_417 = 16_382
where 8_347_681 = 256^-1 mod 8_380_417
Source§const NEG_QINV: u32 = 4_236_238_847u32
const NEG_QINV: u32 = 4_236_238_847u32
-Q⁻¹ mod 2³² = 4_236_238_847 Q = 8380417, Q⁻¹ mod 2³² = 58728449 (0x03802001) -Q⁻¹ mod 2³² = 2³² - 58728449 = 4236238847 (0xFC7FDFFF)
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 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::Standard
const POST_INVNTT_MODE: PostInvNtt = PostInvNtt::Standard
How the coefficients should be post-processed after the inverse NTT. Read more
Auto Trait Implementations§
impl Freeze for DilithiumParams
impl RefUnwindSafe for DilithiumParams
impl Send for DilithiumParams
impl Sync for DilithiumParams
impl Unpin for DilithiumParams
impl UnwindSafe for DilithiumParams
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