pub struct ScalarCore(/* private fields */);
Trait Implementations§
Source§impl<'r> Add<&'r ScalarCore> for ScalarCore
impl<'r> Add<&'r ScalarCore> for ScalarCore
Source§type Output = ScalarCore
type Output = ScalarCore
The resulting type after applying the
+
operator.Source§fn add(self, other: &ScalarCore) -> ScalarCore
fn add(self, other: &ScalarCore) -> ScalarCore
Performs the
+
operation. Read moreSource§impl Add for ScalarCore
impl Add for ScalarCore
Source§type Output = ScalarCore
type Output = ScalarCore
The resulting type after applying the
+
operator.Source§fn add(self, other: ScalarCore) -> Self
fn add(self, other: ScalarCore) -> Self
Performs the
+
operation. Read moreSource§impl<'r> AddAssign<&'r ScalarCore> for ScalarCore
impl<'r> AddAssign<&'r ScalarCore> for ScalarCore
Source§fn add_assign(&mut self, other: &ScalarCore)
fn add_assign(&mut self, other: &ScalarCore)
Performs the
+=
operation. Read moreSource§impl AddAssign for ScalarCore
impl AddAssign for ScalarCore
Source§fn add_assign(&mut self, other: ScalarCore)
fn add_assign(&mut self, other: ScalarCore)
Performs the
+=
operation. Read moreSource§impl Clone for ScalarCore
impl Clone for ScalarCore
Source§fn clone(&self) -> ScalarCore
fn clone(&self) -> ScalarCore
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 ScalarCore
impl ConditionallySelectable for ScalarCore
Source§fn conditional_select(
a: &ScalarCore,
b: &ScalarCore,
choice: Choice,
) -> ScalarCore
fn conditional_select( a: &ScalarCore, b: &ScalarCore, choice: Choice, ) -> ScalarCore
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 ScalarCore
impl ConstantTimeEq for ScalarCore
Source§impl Debug for ScalarCore
impl Debug for ScalarCore
Source§impl Default for ScalarCore
impl Default for ScalarCore
Source§fn default() -> ScalarCore
fn default() -> ScalarCore
Returns the “default value” for a type. Read more
Source§impl Field for ScalarCore
impl Field for ScalarCore
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 ScalarCore> for ScalarCoreRepr
impl<'a> From<&'a ScalarCore> for ScalarCoreRepr
Source§fn from(e: &'a ScalarCore) -> ScalarCoreRepr
fn from(e: &'a ScalarCore) -> ScalarCoreRepr
Converts to this type from the input type.
Source§impl From<ScalarCore> for ScalarCoreRepr
impl From<ScalarCore> for ScalarCoreRepr
Source§fn from(e: ScalarCore) -> ScalarCoreRepr
fn from(e: ScalarCore) -> ScalarCoreRepr
Converts to this type from the input type.
Source§impl From<u64> for ScalarCore
impl From<u64> for ScalarCore
Source§fn from(val: u64) -> ScalarCore
fn from(val: u64) -> ScalarCore
Converts to this type from the input type.
Source§impl<'r> Mul<&'r ScalarCore> for ScalarCore
impl<'r> Mul<&'r ScalarCore> for ScalarCore
Source§type Output = ScalarCore
type Output = ScalarCore
The resulting type after applying the
*
operator.Source§fn mul(self, other: &ScalarCore) -> Self
fn mul(self, other: &ScalarCore) -> Self
Performs the
*
operation. Read moreSource§impl Mul for ScalarCore
impl Mul for ScalarCore
Source§type Output = ScalarCore
type Output = ScalarCore
The resulting type after applying the
*
operator.Source§fn mul(self, other: ScalarCore) -> Self
fn mul(self, other: ScalarCore) -> Self
Performs the
*
operation. Read moreSource§impl<'r> MulAssign<&'r ScalarCore> for ScalarCore
impl<'r> MulAssign<&'r ScalarCore> for ScalarCore
Source§fn mul_assign(&mut self, other: &ScalarCore)
fn mul_assign(&mut self, other: &ScalarCore)
Performs the
*=
operation. Read moreSource§impl MulAssign for ScalarCore
impl MulAssign for ScalarCore
Source§fn mul_assign(&mut self, other: ScalarCore)
fn mul_assign(&mut self, other: ScalarCore)
Performs the
*=
operation. Read moreSource§impl Neg for ScalarCore
impl Neg for ScalarCore
Source§type Output = ScalarCore
type Output = ScalarCore
The resulting type after applying the
-
operator.Source§fn neg(self) -> ScalarCore
fn neg(self) -> ScalarCore
Performs the unary
-
operation. Read moreSource§impl Ord for ScalarCore
Elements are ordered lexicographically.
impl Ord for ScalarCore
Elements are ordered lexicographically.
Source§fn cmp(&self, other: &ScalarCore) -> Ordering
fn cmp(&self, other: &ScalarCore) -> 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 ScalarCore
impl PartialEq for ScalarCore
Source§impl PartialOrd for ScalarCore
impl PartialOrd for ScalarCore
Source§impl PrimeField for ScalarCore
impl PrimeField for ScalarCore
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 = ScalarCoreRepr
type Repr = ScalarCoreRepr
The prime field can be converted back and forth into this binary
representation.
Source§fn from_repr(r: ScalarCoreRepr) -> CtOption<ScalarCore>
fn from_repr(r: ScalarCoreRepr) -> CtOption<ScalarCore>
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: ScalarCoreRepr) -> Option<ScalarCore>
fn from_repr_vartime(r: ScalarCoreRepr) -> Option<ScalarCore>
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) -> ScalarCoreRepr
fn to_repr(&self) -> ScalarCoreRepr
Converts an element of the prime field into the standard byte representation for
this field. Read more
Source§impl<T: Borrow<ScalarCore>> Product<T> for ScalarCore
impl<T: Borrow<ScalarCore>> Product<T> for ScalarCore
Source§impl<'r> Sub<&'r ScalarCore> for ScalarCore
impl<'r> Sub<&'r ScalarCore> for ScalarCore
Source§type Output = ScalarCore
type Output = ScalarCore
The resulting type after applying the
-
operator.Source§fn sub(self, other: &ScalarCore) -> Self
fn sub(self, other: &ScalarCore) -> Self
Performs the
-
operation. Read moreSource§impl Sub for ScalarCore
impl Sub for ScalarCore
Source§type Output = ScalarCore
type Output = ScalarCore
The resulting type after applying the
-
operator.Source§fn sub(self, other: ScalarCore) -> Self
fn sub(self, other: ScalarCore) -> Self
Performs the
-
operation. Read moreSource§impl<'r> SubAssign<&'r ScalarCore> for ScalarCore
impl<'r> SubAssign<&'r ScalarCore> for ScalarCore
Source§fn sub_assign(&mut self, other: &ScalarCore)
fn sub_assign(&mut self, other: &ScalarCore)
Performs the
-=
operation. Read moreSource§impl SubAssign for ScalarCore
impl SubAssign for ScalarCore
Source§fn sub_assign(&mut self, other: ScalarCore)
fn sub_assign(&mut self, other: ScalarCore)
Performs the
-=
operation. Read moreSource§impl<T: Borrow<ScalarCore>> Sum<T> for ScalarCore
impl<T: Borrow<ScalarCore>> Sum<T> for ScalarCore
impl Copy for ScalarCore
impl Eq for ScalarCore
Auto Trait Implementations§
impl Freeze for ScalarCore
impl RefUnwindSafe for ScalarCore
impl Send for ScalarCore
impl Sync for ScalarCore
impl Unpin for ScalarCore
impl UnwindSafe for ScalarCore
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