pub struct Poly {
pub coeffs: [FieldElement; 256],
}Expand description
Polynomial in the time (coefficient) domain, canonical representatives mod q.
Fields§
§coeffs: [FieldElement; 256]Coefficients c[0] + c[1] X + … + c[255] X^{255}.
Implementations§
Source§impl Poly
impl Poly
Sourcepub const fn from_coeffs(coeffs: [FieldElement; 256]) -> Self
pub const fn from_coeffs(coeffs: [FieldElement; 256]) -> Self
Construct from canonical coefficients (already reduced mod q is recommended).
Sourcepub fn add_assign(&mut self, rhs: &Self)
pub fn add_assign(&mut self, rhs: &Self)
Coefficient-wise addition mod q (Barrett reduction).
Sourcepub fn sub_assign(&mut self, rhs: &Self)
pub fn sub_assign(&mut self, rhs: &Self)
Coefficient-wise subtraction mod q.
Sourcepub fn scalar_mul_assign(&mut self, k: i32)
pub fn scalar_mul_assign(&mut self, k: i32)
Multiply every coefficient by a small integer, then reduce mod q.
Sourcepub fn mul_negacyclic(&self, rhs: &Self) -> Self
pub fn mul_negacyclic(&self, rhs: &Self) -> Self
Negacyclic convolution mod (X^256 + 1) via schoolbook (O(n^2)) (test / reference).
Sourcepub fn infinity_norm(&self) -> i32
pub fn infinity_norm(&self) -> i32
Infinity norm on absolute representatives in ([-q/2, q/2])-style range.
Sourcepub fn to_simd(&self) -> [Coefficients; 32]
pub fn to_simd(&self) -> [Coefficients; 32]
SIMD lane layout (ML-DSA coefficient order).
Trait Implementations§
impl Eq for Poly
impl StructuralPartialEq for Poly
Auto Trait Implementations§
impl Freeze for Poly
impl RefUnwindSafe for Poly
impl Send for Poly
impl Sync for Poly
impl Unpin for Poly
impl UnsafeUnpin for Poly
impl UnwindSafe for Poly
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