pub struct FieldElementCore(/* private fields */);
Trait Implementations§
Source§impl<'r> Add<&'r FieldElementCore> for FieldElementCore
impl<'r> Add<&'r FieldElementCore> for FieldElementCore
Source§type Output = FieldElementCore
type Output = FieldElementCore
The resulting type after applying the
+
operator.Source§fn add(self, other: &FieldElementCore) -> FieldElementCore
fn add(self, other: &FieldElementCore) -> FieldElementCore
Performs the
+
operation. Read moreSource§impl Add for FieldElementCore
impl Add for FieldElementCore
Source§type Output = FieldElementCore
type Output = FieldElementCore
The resulting type after applying the
+
operator.Source§fn add(self, other: FieldElementCore) -> Self
fn add(self, other: FieldElementCore) -> Self
Performs the
+
operation. Read moreSource§impl<'r> AddAssign<&'r FieldElementCore> for FieldElementCore
impl<'r> AddAssign<&'r FieldElementCore> for FieldElementCore
Source§fn add_assign(&mut self, other: &FieldElementCore)
fn add_assign(&mut self, other: &FieldElementCore)
Performs the
+=
operation. Read moreSource§impl AddAssign for FieldElementCore
impl AddAssign for FieldElementCore
Source§fn add_assign(&mut self, other: FieldElementCore)
fn add_assign(&mut self, other: FieldElementCore)
Performs the
+=
operation. Read moreSource§impl Clone for FieldElementCore
impl Clone for FieldElementCore
Source§fn clone(&self) -> FieldElementCore
fn clone(&self) -> FieldElementCore
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 ConditionallySelectable for FieldElementCore
impl ConditionallySelectable for FieldElementCore
Source§fn conditional_select(
a: &FieldElementCore,
b: &FieldElementCore,
choice: Choice,
) -> FieldElementCore
fn conditional_select( a: &FieldElementCore, b: &FieldElementCore, choice: Choice, ) -> FieldElementCore
Source§fn conditional_assign(&mut self, other: &Self, choice: Choice)
fn conditional_assign(&mut self, other: &Self, choice: Choice)
Source§fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
Conditionally swap
self
and other
if choice == 1
; otherwise,
reassign both unto themselves. Read moreSource§impl ConstantTimeEq for FieldElementCore
impl ConstantTimeEq for FieldElementCore
Source§impl Debug for FieldElementCore
impl Debug for FieldElementCore
Source§impl Default for FieldElementCore
impl Default for FieldElementCore
Source§fn default() -> FieldElementCore
fn default() -> FieldElementCore
Returns the “default value” for a type. Read more
Source§impl Field for FieldElementCore
impl Field for FieldElementCore
Source§fn random(rng: impl RngCore) -> Self
fn random(rng: impl RngCore) -> Self
Computes a uniformly random element using rejection sampling.
Source§fn is_zero_vartime(&self) -> bool
fn is_zero_vartime(&self) -> bool
Returns true iff this element is zero. Read more
Source§fn invert(&self) -> CtOption<Self>
fn invert(&self) -> CtOption<Self>
Computes the multiplicative inverse of this element,
failing if the element is zero.
Source§fn sqrt_ratio(num: &Self, div: &Self) -> (Choice, Self)
fn sqrt_ratio(num: &Self, div: &Self) -> (Choice, Self)
Computes: Read more
Source§fn sqrt(&self) -> CtOption<Self>
fn sqrt(&self) -> CtOption<Self>
Returns the square root of the field element, if it is
quadratic residue. Read more
Source§impl<'a> From<&'a FieldElementCore> for FieldElementCoreRepr
impl<'a> From<&'a FieldElementCore> for FieldElementCoreRepr
Source§fn from(e: &'a FieldElementCore) -> FieldElementCoreRepr
fn from(e: &'a FieldElementCore) -> FieldElementCoreRepr
Converts to this type from the input type.
Source§impl From<FieldElementCore> for FieldElementCoreRepr
impl From<FieldElementCore> for FieldElementCoreRepr
Source§fn from(e: FieldElementCore) -> FieldElementCoreRepr
fn from(e: FieldElementCore) -> FieldElementCoreRepr
Converts to this type from the input type.
Source§impl From<u64> for FieldElementCore
impl From<u64> for FieldElementCore
Source§fn from(val: u64) -> FieldElementCore
fn from(val: u64) -> FieldElementCore
Converts to this type from the input type.
Source§impl<'r> Mul<&'r FieldElementCore> for FieldElementCore
impl<'r> Mul<&'r FieldElementCore> for FieldElementCore
Source§type Output = FieldElementCore
type Output = FieldElementCore
The resulting type after applying the
*
operator.Source§fn mul(self, other: &FieldElementCore) -> Self
fn mul(self, other: &FieldElementCore) -> Self
Performs the
*
operation. Read moreSource§impl Mul for FieldElementCore
impl Mul for FieldElementCore
Source§type Output = FieldElementCore
type Output = FieldElementCore
The resulting type after applying the
*
operator.Source§fn mul(self, other: FieldElementCore) -> Self
fn mul(self, other: FieldElementCore) -> Self
Performs the
*
operation. Read moreSource§impl<'r> MulAssign<&'r FieldElementCore> for FieldElementCore
impl<'r> MulAssign<&'r FieldElementCore> for FieldElementCore
Source§fn mul_assign(&mut self, other: &FieldElementCore)
fn mul_assign(&mut self, other: &FieldElementCore)
Performs the
*=
operation. Read moreSource§impl MulAssign for FieldElementCore
impl MulAssign for FieldElementCore
Source§fn mul_assign(&mut self, other: FieldElementCore)
fn mul_assign(&mut self, other: FieldElementCore)
Performs the
*=
operation. Read moreSource§impl Neg for FieldElementCore
impl Neg for FieldElementCore
Source§type Output = FieldElementCore
type Output = FieldElementCore
The resulting type after applying the
-
operator.Source§fn neg(self) -> FieldElementCore
fn neg(self) -> FieldElementCore
Performs the unary
-
operation. Read moreSource§impl Ord for FieldElementCore
Elements are ordered lexicographically.
impl Ord for FieldElementCore
Elements are ordered lexicographically.
Source§fn cmp(&self, other: &FieldElementCore) -> Ordering
fn cmp(&self, other: &FieldElementCore) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for FieldElementCore
impl PartialEq for FieldElementCore
Source§impl PartialOrd for FieldElementCore
impl PartialOrd for FieldElementCore
Source§impl PrimeField for FieldElementCore
impl PrimeField for FieldElementCore
Source§const MODULUS: &'static str = MODULUS_STR
const MODULUS: &'static str = MODULUS_STR
Modulus of the field written as a string for debugging purposes. Read more
Source§const CAPACITY: u32 = 251u32
const CAPACITY: u32 = 251u32
How many bits of information can be reliably stored in the field element. Read more
Source§const MULTIPLICATIVE_GENERATOR: Self = GENERATOR
const MULTIPLICATIVE_GENERATOR: Self = GENERATOR
A fixed multiplicative generator of
modulus - 1
order. This element must also be
a quadratic nonresidue. Read moreSource§const ROOT_OF_UNITY: Self = ROOT_OF_UNITY
const ROOT_OF_UNITY: Self = ROOT_OF_UNITY
The
2^s
root of unity. Read moreSource§const ROOT_OF_UNITY_INV: Self = ROOT_OF_UNITY_INV
const ROOT_OF_UNITY_INV: Self = ROOT_OF_UNITY_INV
Inverse of
Self::ROOT_OF_UNITY
.Source§type Repr = FieldElementCoreRepr
type Repr = FieldElementCoreRepr
The prime field can be converted back and forth into this binary
representation.
Source§fn from_repr(r: FieldElementCoreRepr) -> CtOption<FieldElementCore>
fn from_repr(r: FieldElementCoreRepr) -> CtOption<FieldElementCore>
Attempts to convert a byte representation of a field element into an element of
this prime field, failing if the input is not canonical (is not smaller than the
field’s modulus). Read more
Source§fn from_repr_vartime(r: FieldElementCoreRepr) -> Option<FieldElementCore>
fn from_repr_vartime(r: FieldElementCoreRepr) -> Option<FieldElementCore>
Attempts to convert a byte representation of a field element into an element of
this prime field, failing if the input is not canonical (is not smaller than the
field’s modulus). Read more
Source§fn to_repr(&self) -> FieldElementCoreRepr
fn to_repr(&self) -> FieldElementCoreRepr
Converts an element of the prime field into the standard byte representation for
this field. Read more
Source§impl<T: Borrow<FieldElementCore>> Product<T> for FieldElementCore
impl<T: Borrow<FieldElementCore>> Product<T> for FieldElementCore
Source§impl<'r> Sub<&'r FieldElementCore> for FieldElementCore
impl<'r> Sub<&'r FieldElementCore> for FieldElementCore
Source§type Output = FieldElementCore
type Output = FieldElementCore
The resulting type after applying the
-
operator.Source§fn sub(self, other: &FieldElementCore) -> Self
fn sub(self, other: &FieldElementCore) -> Self
Performs the
-
operation. Read moreSource§impl Sub for FieldElementCore
impl Sub for FieldElementCore
Source§type Output = FieldElementCore
type Output = FieldElementCore
The resulting type after applying the
-
operator.Source§fn sub(self, other: FieldElementCore) -> Self
fn sub(self, other: FieldElementCore) -> Self
Performs the
-
operation. Read moreSource§impl<'r> SubAssign<&'r FieldElementCore> for FieldElementCore
impl<'r> SubAssign<&'r FieldElementCore> for FieldElementCore
Source§fn sub_assign(&mut self, other: &FieldElementCore)
fn sub_assign(&mut self, other: &FieldElementCore)
Performs the
-=
operation. Read moreSource§impl SubAssign for FieldElementCore
impl SubAssign for FieldElementCore
Source§fn sub_assign(&mut self, other: FieldElementCore)
fn sub_assign(&mut self, other: FieldElementCore)
Performs the
-=
operation. Read moreSource§impl<T: Borrow<FieldElementCore>> Sum<T> for FieldElementCore
impl<T: Borrow<FieldElementCore>> Sum<T> for FieldElementCore
impl Copy for FieldElementCore
impl Eq for FieldElementCore
Auto Trait Implementations§
impl Freeze for FieldElementCore
impl RefUnwindSafe for FieldElementCore
impl Send for FieldElementCore
impl Sync for FieldElementCore
impl Unpin for FieldElementCore
impl UnwindSafe for FieldElementCore
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