pub struct Elem<F: Field>(pub F::Int);Expand description
An Elem is a member of the specified prime-order field.
Elements can be added, subtracted, multiplied, and negated, and the overloaded operators will ensure both that the integer values remain in the field, and that the reductions are done efficiently.
For addition and subtraction, a simple conditional subtraction is used; for multiplication, Barrett reduction.
Tuple Fields§
§0: F::IntImplementations§
Trait Implementations§
Source§impl<F: Field> ConstantTimeEq for Elem<F>where
F::Int: ConstantTimeEq,
Available on crate feature subtle only.
impl<F: Field> ConstantTimeEq for Elem<F>where
F::Int: ConstantTimeEq,
Available on crate feature
subtle only.Source§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> Mul<&Polynomial<F>> for Elem<F>
impl<F: Field> Mul<&Polynomial<F>> for Elem<F>
Source§type Output = Polynomial<F>
type Output = Polynomial<F>
The resulting type after applying the
* operator.Source§fn mul(self, rhs: &Polynomial<F>) -> Polynomial<F>
fn mul(self, rhs: &Polynomial<F>) -> Polynomial<F>
Performs the
* operation. Read moreimpl<F: Copy + Field> Copy for Elem<F>
impl<F: Eq + Field> Eq for Elem<F>
impl<F: Field> StructuralPartialEq for Elem<F>
Auto Trait Implementations§
impl<F> Freeze for Elem<F>
impl<F> RefUnwindSafe for Elem<F>
impl<F> Send for Elem<F>
impl<F> Sync for Elem<F>
impl<F> Unpin for Elem<F>
impl<F> UnwindSafe for Elem<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