pub struct NttPolynomial<F: Field>(pub Array<Elem<F>, U256>);Expand description
An NttPolynomial is a member of the NTT algebra T_q = Z_q[X]^256 of 256-tuples of field
elements.
NTT polynomials can be added and subtracted, negated, and multiplied by scalars.
We do not define multiplication of NTT polynomials here: that is defined by the downstream
crate using the MultiplyNtt trait.
We also do not define the mappings between normal polynomials and NTT polynomials (i.e., between
R_q and T_q).
Tuple Fields§
§0: Array<Elem<F>, U256>Implementations§
Trait Implementations§
Source§impl<F: Field> Add<&NttPolynomial<F>> for &NttPolynomial<F>
impl<F: Field> Add<&NttPolynomial<F>> for &NttPolynomial<F>
Source§type Output = NttPolynomial<F>
type Output = NttPolynomial<F>
The resulting type after applying the
+ operator.Source§fn add(self, rhs: &NttPolynomial<F>) -> NttPolynomial<F>
fn add(self, rhs: &NttPolynomial<F>) -> NttPolynomial<F>
Performs the
+ operation. Read moreSource§impl<F: Clone + Field> Clone for NttPolynomial<F>
impl<F: Clone + Field> Clone for NttPolynomial<F>
Source§fn clone(&self) -> NttPolynomial<F>
fn clone(&self) -> NttPolynomial<F>
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<F: Field> ConstantTimeEq for NttPolynomial<F>where
F::Int: ConstantTimeEq,
Available on crate feature subtle only.
impl<F: Field> ConstantTimeEq for NttPolynomial<F>where
F::Int: ConstantTimeEq,
Available on crate feature
subtle only.Source§impl<F: Default + Field> Default for NttPolynomial<F>
impl<F: Default + Field> Default for NttPolynomial<F>
Source§fn default() -> NttPolynomial<F>
fn default() -> NttPolynomial<F>
Returns the “default value” for a type. Read more
Source§impl<F: Field, D: EncodingSize> Encode<D> for NttPolynomial<F>
impl<F: Field, D: EncodingSize> Encode<D> for NttPolynomial<F>
Source§type EncodedSize = <D as EncodingSize>::EncodedPolynomialSize
type EncodedSize = <D as EncodingSize>::EncodedPolynomialSize
Size of the encoded object.
Source§impl<F: Field> From<Array<Elem<F>, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>> for NttPolynomial<F>
impl<F: Field> From<Array<Elem<F>, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>> for NttPolynomial<F>
Source§impl<F> Mul<&NttPolynomial<F>> for &NttPolynomial<F>where
F: Field + MultiplyNtt,
impl<F> Mul<&NttPolynomial<F>> for &NttPolynomial<F>where
F: Field + MultiplyNtt,
Source§type Output = NttPolynomial<F>
type Output = NttPolynomial<F>
The resulting type after applying the
* operator.Source§fn mul(self, rhs: &NttPolynomial<F>) -> NttPolynomial<F>
fn mul(self, rhs: &NttPolynomial<F>) -> NttPolynomial<F>
Performs the
* operation. Read moreSource§impl<F: Field> Mul<&NttPolynomial<F>> for Elem<F>
impl<F: Field> Mul<&NttPolynomial<F>> for Elem<F>
Source§type Output = NttPolynomial<F>
type Output = NttPolynomial<F>
The resulting type after applying the
* operator.Source§fn mul(self, rhs: &NttPolynomial<F>) -> NttPolynomial<F>
fn mul(self, rhs: &NttPolynomial<F>) -> NttPolynomial<F>
Performs the
* operation. Read moreSource§impl<F: Field> Neg for &NttPolynomial<F>
impl<F: Field> Neg for &NttPolynomial<F>
Source§type Output = NttPolynomial<F>
type Output = NttPolynomial<F>
The resulting type after applying the
- operator.Source§fn neg(self) -> NttPolynomial<F>
fn neg(self) -> NttPolynomial<F>
Performs the unary
- operation. Read moreSource§impl<F: Field> Sub<&NttPolynomial<F>> for &NttPolynomial<F>
impl<F: Field> Sub<&NttPolynomial<F>> for &NttPolynomial<F>
Source§type Output = NttPolynomial<F>
type Output = NttPolynomial<F>
The resulting type after applying the
- operator.Source§fn sub(self, rhs: &NttPolynomial<F>) -> NttPolynomial<F>
fn sub(self, rhs: &NttPolynomial<F>) -> NttPolynomial<F>
Performs the
- operation. Read moreSource§impl<F: Field> Zeroize for NttPolynomial<F>
Available on crate feature zeroize only.
impl<F: Field> Zeroize for NttPolynomial<F>
Available on crate feature
zeroize only.impl<F: Eq + Field> Eq for NttPolynomial<F>
impl<F: Field> StructuralPartialEq for NttPolynomial<F>
Auto Trait Implementations§
impl<F> Freeze for NttPolynomial<F>
impl<F> RefUnwindSafe for NttPolynomial<F>
impl<F> Send for NttPolynomial<F>
impl<F> Sync for NttPolynomial<F>
impl<F> Unpin for NttPolynomial<F>
impl<F> UnwindSafe for NttPolynomial<F>
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