pub struct Fr(/* private fields */);
Implementations§
Source§impl Fr
impl Fr
pub const ZERO: Self = _
pub const ONE: Self = _
pub fn to_bytes_le(&self) -> [u8; 32]
pub fn square(&self) -> Fr
pub fn inverse(&self) -> Option<Fr>
pub fn add(self, other: &Fr) -> Fr
pub fn sub(self, other: &Fr) -> Fr
pub fn mul(self, other: &Fr) -> Fr
pub fn neg(self) -> Fr
Source§impl Fr
impl Fr
pub const MODULUS_LIMBS: [u64; 4] = _
pub const MODULUS_MINUS_ONE_DIV_TWO_LIMBS: [u64; 4] = _
pub const MODULUS_BIT_SIZE: u32 = 251u32
pub const TRACE_LIMBS: [u64; 4] = _
pub const TRACE_MINUS_ONE_DIV_TWO_LIMBS: [u64; 4] = _
pub const TWO_ADICITY: u32 = 1u32
pub const MULTIPLICATIVE_GENERATOR: Self = _
pub const TWO_ADIC_ROOT_OF_UNITY: Self = _
pub const FIELD_SIZE_POWER_OF_TWO: Self = _
pub fn from_le_bytes_mod_order(bytes: &[u8]) -> Self
Sourcepub fn from_bytes_checked(bytes: &[u8; 32]) -> Result<Self, EncodingError>
pub fn from_bytes_checked(bytes: &[u8; 32]) -> Result<Self, EncodingError>
Convert bytes into an Fr element, returning None if these bytes are not already reduced.
This means that values that cannot be produced by encoding a field element will return None, enforcing canonical serialization.
pub fn to_bytes(&self) -> [u8; 32]
Sourcepub fn rand<R: CryptoRngCore>(rng: &mut R) -> Self
pub fn rand<R: CryptoRngCore>(rng: &mut R) -> Self
Sample a random field element uniformly.
Trait Implementations§
Source§impl<'a> AddAssign<&'a Fr> for Fr
impl<'a> AddAssign<&'a Fr> for Fr
Source§fn add_assign(&mut self, other: &Self)
fn add_assign(&mut self, other: &Self)
Performs the
+=
operation. Read moreSource§impl<'a> AddAssign<&'a mut Fr> for Fr
impl<'a> AddAssign<&'a mut Fr> for Fr
Source§fn add_assign(&mut self, other: &'a mut Self)
fn add_assign(&mut self, other: &'a mut Self)
Performs the
+=
operation. Read moreSource§impl Distribution<Fr> for Standard
impl Distribution<Fr> for Standard
Source§impl<'a> DivAssign<&'a Fr> for Fr
impl<'a> DivAssign<&'a Fr> for Fr
Source§fn div_assign(&mut self, other: &Self)
fn div_assign(&mut self, other: &Self)
Performs the
/=
operation. Read moreSource§impl<'a> DivAssign<&'a mut Fr> for Fr
impl<'a> DivAssign<&'a mut Fr> for Fr
Source§fn div_assign(&mut self, other: &'a mut Self)
fn div_assign(&mut self, other: &'a mut Self)
Performs the
/=
operation. Read moreSource§impl<'b> MulAssign<&'b Fr> for Element
impl<'b> MulAssign<&'b Fr> for Element
Source§fn mul_assign(&mut self, point: &'b Fr)
fn mul_assign(&mut self, point: &'b Fr)
Performs the
*=
operation. Read moreSource§impl<'a> MulAssign<&'a Fr> for Fr
impl<'a> MulAssign<&'a Fr> for Fr
Source§fn mul_assign(&mut self, other: &Self)
fn mul_assign(&mut self, other: &Self)
Performs the
*=
operation. Read moreSource§impl<'a> MulAssign<&'a mut Fr> for Fr
impl<'a> MulAssign<&'a mut Fr> for Fr
Source§fn mul_assign(&mut self, other: &'a mut Self)
fn mul_assign(&mut self, other: &'a mut Self)
Performs the
*=
operation. Read moreSource§impl MulAssign<Fr> for Element
impl MulAssign<Fr> for Element
Source§fn mul_assign(&mut self, other: Fr)
fn mul_assign(&mut self, other: Fr)
Performs the
*=
operation. Read moreSource§impl<'a> SubAssign<&'a Fr> for Fr
impl<'a> SubAssign<&'a Fr> for Fr
Source§fn sub_assign(&mut self, other: &Self)
fn sub_assign(&mut self, other: &Self)
Performs the
-=
operation. Read moreSource§impl<'a> SubAssign<&'a mut Fr> for Fr
impl<'a> SubAssign<&'a mut Fr> for Fr
Source§fn sub_assign(&mut self, other: &'a mut Self)
fn sub_assign(&mut self, other: &'a mut Self)
Performs the
-=
operation. Read moreimpl Copy for Fr
impl Eq for Fr
Auto Trait Implementations§
impl Freeze for Fr
impl RefUnwindSafe for Fr
impl Send for Fr
impl Sync for Fr
impl Unpin for Fr
impl UnwindSafe for Fr
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
Source§impl<T> CanonicalSerializeHashExt for Twhere
T: CanonicalSerialize,
impl<T> CanonicalSerializeHashExt for Twhere
T: CanonicalSerialize,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more