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. 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: 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>
type EncodedSize = <D as EncodingSize>::EncodedPolynomialSize
fn encode(&self) -> Array<u8, Self::EncodedSize>
fn decode(enc: &Array<u8, Self::EncodedSize>) -> Self
Source§impl Mul<&NttPolynomial<BaseField>> for &NttPolynomial<BaseField>
impl Mul<&NttPolynomial<BaseField>> for &NttPolynomial<BaseField>
Source§type Output = NttPolynomial<BaseField>
type Output = NttPolynomial<BaseField>
The resulting type after applying the
* operator.Source§fn mul(self, rhs: &NttPolynomial<BaseField>) -> NttPolynomial<BaseField>
fn mul(self, rhs: &NttPolynomial<BaseField>) -> NttPolynomial<BaseField>
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 NttInverse for NttPolynomial<BaseField>
impl NttInverse for NttPolynomial<BaseField>
type Output = Polynomial<BaseField>
fn ntt_inverse(&self) -> Self::Output
Source§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 moreimpl<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