Modulus

Trait Modulus 

Source
pub trait Modulus {
    const Q: u32;
    const N: usize;
    const BARRETT_MU: u128 = 0u128;
    const BARRETT_K: u32 = 0u32;
}
Expand description

Basic trait defining the modulus and degree for a polynomial ring

Required Associated Constants§

Source

const Q: u32

The primary modulus Q for coefficient arithmetic

Source

const N: usize

The polynomial degree N (number of coefficients)

Provided Associated Constants§

Source

const BARRETT_MU: u128 = 0u128

Barrett reduction constant mu = floor(2^k / Q) Set to 0 for dynamic computation

Source

const BARRETT_K: u32 = 0u32

Barrett reduction shift amount k Set to 0 for dynamic computation

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.

Implementors§

Source§

impl Modulus for Dilithium2Params

Source§

const Q: u32 = 8_380_417u32

Source§

const N: usize = 256usize

Source§

const BARRETT_MU: u128 = 4_299_165_187u128

Source§

const BARRETT_K: u32 = 55u32

Source§

impl Modulus for DilithiumParams

Source§

const Q: u32 = 8_380_417u32

Source§

const N: usize = 256usize

Source§

const BARRETT_MU: u128 = 4_299_165_187u128

Source§

const BARRETT_K: u32 = 55u32

Source§

impl Modulus for DilithiumParamsMont

Source§

const Q: u32 = 8_380_417u32

Source§

const N: usize = 256usize

Source§

const BARRETT_MU: u128 = 4_299_165_187u128

Source§

const BARRETT_K: u32 = 55u32

Source§

impl Modulus for Kyber256Params

Source§

const Q: u32 = 3_329u32

Source§

const N: usize = 256usize

Source§

const BARRETT_MU: u128 = 10_569_051_393u128

Source§

const BARRETT_K: u32 = 45u32