pub struct FieldElement<F: FieldExtension>(/* private fields */);Expand description
A field element wrapper.
Implementations§
Source§impl<F: FieldExtension> FieldElement<F>
impl<F: FieldExtension> FieldElement<F>
Sourcepub fn from_be_bytes(
bytes: &[u8],
) -> Result<FieldElement<F>, SerializationError>
pub fn from_be_bytes( bytes: &[u8], ) -> Result<FieldElement<F>, SerializationError>
Construct a field element from the given bytes
pub fn from_le_bytes( bytes: &[u8], ) -> Result<FieldElement<F>, SerializationError>
Sourcepub fn to_le_bytes(&self) -> impl IntoIterator<Item = u8> + '_
pub fn to_le_bytes(&self) -> impl IntoIterator<Item = u8> + '_
Convert the field element to little-endian bytes
Sourcepub fn to_be_bytes(&self) -> impl IntoIterator<Item = u8>
pub fn to_be_bytes(&self) -> impl IntoIterator<Item = u8>
Convert the field element to big-endian bytes
pub fn to_biguint(&self) -> BigUint
Trait Implementations§
Source§impl<F: FieldExtension> Add<&FieldElement<F>> for &FieldElement<F>
impl<F: FieldExtension> Add<&FieldElement<F>> for &FieldElement<F>
Source§type Output = FieldElement<F>
type Output = FieldElement<F>
The resulting type after applying the
+ operator.Source§impl<'a, F: FieldExtension> Add<&'a FieldElement<F>> for FieldElement<F>
lhs owned, rhs borrowed
impl<'a, F: FieldExtension> Add<&'a FieldElement<F>> for FieldElement<F>
lhs owned, rhs borrowed
Source§type Output = FieldElement<F>
type Output = FieldElement<F>
The resulting type after applying the
+ operator.Source§impl<'a, F: FieldExtension> Add<FieldElement<F>> for &'a FieldElement<F>
lhs borrowed, rhs owned
impl<'a, F: FieldExtension> Add<FieldElement<F>> for &'a FieldElement<F>
lhs borrowed, rhs owned
Source§type Output = FieldElement<F>
type Output = FieldElement<F>
The resulting type after applying the
+ operator.Source§impl<F: FieldExtension> Add for FieldElement<F>
lhs owned, rhs owned
impl<F: FieldExtension> Add for FieldElement<F>
lhs owned, rhs owned
Source§type Output = FieldElement<F>
type Output = FieldElement<F>
The resulting type after applying the
+ operator.Source§impl<'a, F: FieldExtension> AddAssign<&'a FieldElement<F>> for FieldElement<F>
impl<'a, F: FieldExtension> AddAssign<&'a FieldElement<F>> for FieldElement<F>
Source§fn add_assign(&mut self, rhs: &'a FieldElement<F>)
fn add_assign(&mut self, rhs: &'a FieldElement<F>)
Performs the
+= operation. Read moreSource§impl<F: FieldExtension> AddAssign for FieldElement<F>
impl<F: FieldExtension> AddAssign for FieldElement<F>
Source§fn add_assign(&mut self, rhs: FieldElement<F>)
fn add_assign(&mut self, rhs: FieldElement<F>)
Performs the
+= operation. Read moreSplit a secret into
n additive shares.Reconstruct a secret from
n additive shares.Source§impl<F: Clone + FieldExtension> Clone for FieldElement<F>
impl<F: Clone + FieldExtension> Clone for FieldElement<F>
Source§fn clone(&self) -> FieldElement<F>
fn clone(&self) -> FieldElement<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<C: Curve> CommitmentScheme<FieldElement<<C as Curve>::Scalar>> for PedersenCommitment<C>
impl<C: Curve> CommitmentScheme<FieldElement<<C as Curve>::Scalar>> for PedersenCommitment<C>
type Commitment = Point<C>
type Witness = FieldElement<<C as Curve>::Scalar>
fn commit<R: CryptoRngCore>( &self, input: &ScalarAsExtension<C>, rng: R, ) -> (Self::Commitment, Self::Witness)
fn open( &self, c: &Self::Commitment, w: &Self::Witness, input: &ScalarAsExtension<C>, ) -> Result<(), PrimitiveError>
Source§impl<F: FieldExtension> ConditionallySelectable for FieldElement<F>
impl<F: FieldExtension> ConditionallySelectable for FieldElement<F>
Source§fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
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<F: FieldExtension> ConstantTimeEq for FieldElement<F>
impl<F: FieldExtension> ConstantTimeEq for FieldElement<F>
Source§impl<F: Debug + FieldExtension> Debug for FieldElement<F>
impl<F: Debug + FieldExtension> Debug for FieldElement<F>
Source§impl<F: FieldExtension> Default for FieldElement<F>
impl<F: FieldExtension> Default for FieldElement<F>
Source§impl<'de, F: FieldExtension> Deserialize<'de> for FieldElement<F>
impl<'de, F: FieldExtension> Deserialize<'de> for FieldElement<F>
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl<F: FieldExtension> Display for FieldElement<F>
impl<F: FieldExtension> Display for FieldElement<F>
Source§impl<F: FieldExtension> Distribution<FieldElement<F>> for Standard
impl<F: FieldExtension> Distribution<FieldElement<F>> for Standard
Source§fn sample<R: RngCore + ?Sized>(&self, rng: &mut R) -> FieldElement<F>
fn sample<R: RngCore + ?Sized>(&self, rng: &mut R) -> FieldElement<F>
Generate a random value of
T, using rng as the source of randomness.Source§fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
Create an iterator that generates random values of
T, using rng as
the source of randomness. Read moreSource§impl<F: FieldExtension> Div<&FieldElement<F>> for &FieldElement<F>
impl<F: FieldExtension> Div<&FieldElement<F>> for &FieldElement<F>
Source§impl<F: FieldExtension> Div<&FieldElement<F>> for FieldElement<F>
impl<F: FieldExtension> Div<&FieldElement<F>> for FieldElement<F>
Source§impl<F: FieldExtension> Div<FieldElement<F>> for &FieldElement<F>
impl<F: FieldExtension> Div<FieldElement<F>> for &FieldElement<F>
Source§impl<F: FieldExtension> Div for FieldElement<F>
impl<F: FieldExtension> Div for FieldElement<F>
Source§impl<F: FieldExtension> Field for FieldElement<F>
impl<F: FieldExtension> Field for FieldElement<F>
Source§fn random(rng: impl RngCore) -> Self
fn random(rng: impl RngCore) -> Self
Returns an element chosen uniformly at random using a user-provided RNG.
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 is_zero_vartime(&self) -> bool
fn is_zero_vartime(&self) -> bool
Returns true iff this element is zero. 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<F: FieldExtension> From<FieldElement<F>> for GlobalFieldKey<F>
impl<F: FieldExtension> From<FieldElement<F>> for GlobalFieldKey<F>
Source§fn from(value: FieldElement<F>) -> Self
fn from(value: FieldElement<F>) -> Self
Converts to this type from the input type.
Source§impl<F: PrimeFieldExtension> From<FieldElement<F>> for SubfieldElement<F>
impl<F: PrimeFieldExtension> From<FieldElement<F>> for SubfieldElement<F>
Source§fn from(value: FieldElement<F>) -> Self
fn from(value: FieldElement<F>) -> Self
Converts to this type from the input type.
Source§impl<F: PrimeFieldExtension> From<SubfieldElement<F>> for FieldElement<F>
impl<F: PrimeFieldExtension> From<SubfieldElement<F>> for FieldElement<F>
Source§fn from(value: SubfieldElement<F>) -> Self
fn from(value: SubfieldElement<F>) -> Self
Converts to this type from the input type.
Source§impl<F: FieldExtension> From<bool> for FieldElement<F>
impl<F: FieldExtension> From<bool> for FieldElement<F>
Source§impl<F: FieldExtension> From<u128> for FieldElement<F>
impl<F: FieldExtension> From<u128> for FieldElement<F>
Source§impl<F: FieldExtension> From<u16> for FieldElement<F>
impl<F: FieldExtension> From<u16> for FieldElement<F>
Source§impl<F: FieldExtension> From<u32> for FieldElement<F>
impl<F: FieldExtension> From<u32> for FieldElement<F>
Source§impl<F: FieldExtension> From<u64> for FieldElement<F>
impl<F: FieldExtension> From<u64> for FieldElement<F>
Source§impl<F: FieldExtension> From<u8> for FieldElement<F>
impl<F: FieldExtension> From<u8> for FieldElement<F>
Source§impl<F: FieldExtension> FromUniformBytes for FieldElement<F>
impl<F: FieldExtension> FromUniformBytes for FieldElement<F>
type UniformBytes = <F as FromUniformBytes>::UniformBytes
fn from_uniform_bytes(bytes: &Array<u8, Self::UniformBytes>) -> Self
Source§impl<F: Hash + FieldExtension> Hash for FieldElement<F>
impl<F: Hash + FieldExtension> Hash for FieldElement<F>
Source§impl<F: FieldExtension> IntoWide<<F as MulAccReduce>::WideType> for FieldElement<F>
impl<F: FieldExtension> IntoWide<<F as MulAccReduce>::WideType> for FieldElement<F>
fn to_wide(&self) -> <F as MulAccReduce>::WideType
fn zero_wide() -> <F as MulAccReduce>::WideType
Source§impl<'a, C: Curve, M: Positive> Mul<&'a FieldElement<<C as Curve>::Scalar>> for &'a CurveKeys<C, M>
impl<'a, C: Curve, M: Positive> Mul<&'a FieldElement<<C as Curve>::Scalar>> for &'a CurveKeys<C, M>
Source§impl<'a, C: Curve, M: Positive> Mul<&'a FieldElement<<C as Curve>::Scalar>> for &'a CurvePoints<C, M>
impl<'a, C: Curve, M: Positive> Mul<&'a FieldElement<<C as Curve>::Scalar>> for &'a CurvePoints<C, M>
Source§type Output = PointShare<C>
type Output = PointShare<C>
The resulting type after applying the
* operator.Source§type Output = PointShares<C, M>
type Output = PointShares<C, M>
The resulting type after applying the
* operator.Source§impl<'a, C: Curve, M: Positive> Mul<&'a FieldElement<<C as Curve>::Scalar>> for CurveKeys<C, M>
impl<'a, C: Curve, M: Positive> Mul<&'a FieldElement<<C as Curve>::Scalar>> for CurveKeys<C, M>
Source§impl<'a, C: Curve, M: Positive> Mul<&'a FieldElement<<C as Curve>::Scalar>> for CurvePoints<C, M>
impl<'a, C: Curve, M: Positive> Mul<&'a FieldElement<<C as Curve>::Scalar>> for CurvePoints<C, M>
Source§impl<'a, C: Curve> Mul<&'a FieldElement<<C as Curve>::Scalar>> for Point<C>
lhs owned, rhs borrowed
impl<'a, C: Curve> Mul<&'a FieldElement<<C as Curve>::Scalar>> for Point<C>
lhs owned, rhs borrowed
Source§type Output = PointShare<C>
type Output = PointShare<C>
The resulting type after applying the
* operator.Source§type Output = PointShares<C, M>
type Output = PointShares<C, M>
The resulting type after applying the
* operator.Source§impl<F: FieldExtension> Mul<&FieldElement<F>> for &FieldElement<F>
impl<F: FieldExtension> Mul<&FieldElement<F>> for &FieldElement<F>
Source§type Output = FieldElement<F>
type Output = FieldElement<F>
The resulting type after applying the
* operator.Source§type Output = FieldShareKey<F>
type Output = FieldShareKey<F>
The resulting type after applying the
* operator.Source§impl<'a, F: FieldExtension> Mul<&'a FieldElement<F>> for &'a SubfieldElement<F>
lhs borrowed, rhs borrowed
impl<'a, F: FieldExtension> Mul<&'a FieldElement<F>> for &'a SubfieldElement<F>
lhs borrowed, rhs borrowed
Source§type Output = FieldElement<F>
type Output = FieldElement<F>
The resulting type after applying the
* operator.Source§impl<'a, F: FieldExtension> Mul<&'a FieldElement<F>> for FieldElement<F>
lhs owned, rhs borrowed
impl<'a, F: FieldExtension> Mul<&'a FieldElement<F>> for FieldElement<F>
lhs owned, rhs borrowed
Source§type Output = FieldElement<F>
type Output = FieldElement<F>
The resulting type after applying the
* operator.Source§type Output = FieldShareKey<F>
type Output = FieldShareKey<F>
The resulting type after applying the
* operator.Source§type Output = FieldShareKeys<F, M>
type Output = FieldShareKeys<F, M>
The resulting type after applying the
* operator.Source§impl<'a, F: FieldExtension, M: Positive> Mul<&'a FieldElement<F>> for SubfieldElements<F, M>
impl<'a, F: FieldExtension, M: Positive> Mul<&'a FieldElement<F>> for SubfieldElements<F, M>
Source§impl<'a, F: FieldExtension> Mul<&'a FieldElement<F>> for SubfieldElement<F>
lhs owned, rhs borrowed
impl<'a, F: FieldExtension> Mul<&'a FieldElement<F>> for SubfieldElement<F>
lhs owned, rhs borrowed
Source§type Output = FieldElement<F>
type Output = FieldElement<F>
The resulting type after applying the
* operator.Source§impl<F: FieldExtension> Mul<&SubfieldElement<F>> for &FieldElement<F>
impl<F: FieldExtension> Mul<&SubfieldElement<F>> for &FieldElement<F>
Source§type Output = FieldElement<F>
type Output = FieldElement<F>
The resulting type after applying the
* operator.Source§impl<'a, F: FieldExtension> Mul<&'a SubfieldElement<F>> for FieldElement<F>
lhs owned, rhs borrowed
impl<'a, F: FieldExtension> Mul<&'a SubfieldElement<F>> for FieldElement<F>
lhs owned, rhs borrowed
Source§type Output = FieldElement<F>
type Output = FieldElement<F>
The resulting type after applying the
* operator.Source§impl<C: Curve, M: Positive> Mul<FieldElement<<C as Curve>::Scalar>> for &CurvePoints<C, M>
impl<C: Curve, M: Positive> Mul<FieldElement<<C as Curve>::Scalar>> for &CurvePoints<C, M>
Source§impl<'a, C: Curve> Mul<FieldElement<<C as Curve>::Scalar>> for &'a Point<C>
lhs borrowed, rhs owned
impl<'a, C: Curve> Mul<FieldElement<<C as Curve>::Scalar>> for &'a Point<C>
lhs borrowed, rhs owned
Source§type Output = PointShare<C>
type Output = PointShare<C>
The resulting type after applying the
* operator.Source§impl<C: Curve, M: Positive> Mul<FieldElement<<C as Curve>::Scalar>> for CurvePoints<C, M>
impl<C: Curve, M: Positive> Mul<FieldElement<<C as Curve>::Scalar>> for CurvePoints<C, M>
Source§type Output = PointShare<C>
type Output = PointShare<C>
The resulting type after applying the
* operator.Source§impl<'a, F: FieldExtension> Mul<FieldElement<F>> for &'a FieldElement<F>
lhs borrowed, rhs owned
impl<'a, F: FieldExtension> Mul<FieldElement<F>> for &'a FieldElement<F>
lhs borrowed, rhs owned
Source§type Output = FieldElement<F>
type Output = FieldElement<F>
The resulting type after applying the
* operator.Source§type Output = FieldShareKey<F>
type Output = FieldShareKey<F>
The resulting type after applying the
* operator.Source§impl<'a, F: FieldExtension> Mul<FieldElement<F>> for &'a SubfieldElement<F>
lhs borrowed, rhs owned
impl<'a, F: FieldExtension> Mul<FieldElement<F>> for &'a SubfieldElement<F>
lhs borrowed, rhs owned
Source§type Output = FieldElement<F>
type Output = FieldElement<F>
The resulting type after applying the
* operator.Source§type Output = FieldShareKey<F>
type Output = FieldShareKey<F>
The resulting type after applying the
* operator.Source§type Output = FieldShareKeys<F, M>
type Output = FieldShareKeys<F, M>
The resulting type after applying the
* operator.Source§impl<F: FieldExtension, M: Positive> Mul<FieldElement<F>> for SubfieldElements<F, M>
impl<F: FieldExtension, M: Positive> Mul<FieldElement<F>> for SubfieldElements<F, M>
Source§impl<F: FieldExtension> Mul<FieldElement<F>> for SubfieldElement<F>
lhs owned, rhs owned
impl<F: FieldExtension> Mul<FieldElement<F>> for SubfieldElement<F>
lhs owned, rhs owned
Source§type Output = FieldElement<F>
type Output = FieldElement<F>
The resulting type after applying the
* operator.Source§impl<'a, F: FieldExtension> Mul<SubfieldElement<F>> for &'a FieldElement<F>
lhs borrowed, rhs owned
impl<'a, F: FieldExtension> Mul<SubfieldElement<F>> for &'a FieldElement<F>
lhs borrowed, rhs owned
Source§type Output = FieldElement<F>
type Output = FieldElement<F>
The resulting type after applying the
* operator.Source§impl<F: FieldExtension> Mul<SubfieldElement<F>> for FieldElement<F>
lhs owned, rhs owned
impl<F: FieldExtension> Mul<SubfieldElement<F>> for FieldElement<F>
lhs owned, rhs owned
Source§type Output = FieldElement<F>
type Output = FieldElement<F>
The resulting type after applying the
* operator.Source§impl<F: FieldExtension> Mul for FieldElement<F>
lhs owned, rhs owned
impl<F: FieldExtension> Mul for FieldElement<F>
lhs owned, rhs owned
Source§type Output = FieldElement<F>
type Output = FieldElement<F>
The resulting type after applying the
* operator.Source§impl<'a, F: FieldExtension> MulAccReduce<&'a FieldElement<F>> for FieldElement<F>
impl<'a, F: FieldExtension> MulAccReduce<&'a FieldElement<F>> for FieldElement<F>
Source§impl<'a, 'b, F: FieldExtension> MulAccReduce<&'a FieldElement<F>, &'b FieldElement<F>> for FieldElement<F>
impl<'a, 'b, F: FieldExtension> MulAccReduce<&'a FieldElement<F>, &'b FieldElement<F>> for FieldElement<F>
Source§impl<'a, F: FieldExtension> MulAccReduce<FieldElement<F>, &'a FieldElement<F>> for FieldElement<F>
impl<'a, F: FieldExtension> MulAccReduce<FieldElement<F>, &'a FieldElement<F>> for FieldElement<F>
Source§impl<F: FieldExtension> MulAccReduce for FieldElement<F>
impl<F: FieldExtension> MulAccReduce for FieldElement<F>
Source§impl<'a, C: Curve> MulAssign<&'a FieldElement<<C as Curve>::Scalar>> for CurveKey<C>
impl<'a, C: Curve> MulAssign<&'a FieldElement<<C as Curve>::Scalar>> for CurveKey<C>
Source§fn mul_assign(&mut self, rhs: &'a ScalarAsExtension<C>)
fn mul_assign(&mut self, rhs: &'a ScalarAsExtension<C>)
Performs the
*= operation. Read moreSource§impl<'a, C: Curve, M: Positive> MulAssign<&'a FieldElement<<C as Curve>::Scalar>> for CurveKeys<C, M>
impl<'a, C: Curve, M: Positive> MulAssign<&'a FieldElement<<C as Curve>::Scalar>> for CurveKeys<C, M>
Source§fn mul_assign(&mut self, rhs: &'a ScalarAsExtension<C>)
fn mul_assign(&mut self, rhs: &'a ScalarAsExtension<C>)
Performs the
*= operation. Read moreSource§impl<'a, C: Curve, M: Positive> MulAssign<&'a FieldElement<<C as Curve>::Scalar>> for CurvePoints<C, M>
impl<'a, C: Curve, M: Positive> MulAssign<&'a FieldElement<<C as Curve>::Scalar>> for CurvePoints<C, M>
Source§fn mul_assign(&mut self, other: &'a ScalarAsExtension<C>)
fn mul_assign(&mut self, other: &'a ScalarAsExtension<C>)
Performs the
*= operation. Read moreSource§impl<C: Curve> MulAssign<&FieldElement<<C as Curve>::Scalar>> for Point<C>
impl<C: Curve> MulAssign<&FieldElement<<C as Curve>::Scalar>> for Point<C>
Source§fn mul_assign(&mut self, rhs: &ScalarAsExtension<C>)
fn mul_assign(&mut self, rhs: &ScalarAsExtension<C>)
Performs the
*= operation. Read moreSource§fn mul_assign(&mut self, other: &'a ScalarAsExtension<C>)
fn mul_assign(&mut self, other: &'a ScalarAsExtension<C>)
Performs the
*= operation. Read moreSource§fn mul_assign(&mut self, other: &'a ScalarAsExtension<C>)
fn mul_assign(&mut self, other: &'a ScalarAsExtension<C>)
Performs the
*= operation. Read moreSource§impl<'a, F: FieldExtension> MulAssign<&'a FieldElement<F>> for FieldElement<F>
impl<'a, F: FieldExtension> MulAssign<&'a FieldElement<F>> for FieldElement<F>
Source§fn mul_assign(&mut self, rhs: &'a FieldElement<F>)
fn mul_assign(&mut self, rhs: &'a FieldElement<F>)
Performs the
*= operation. Read moreSource§fn mul_assign(&mut self, other: &'a FieldElement<F>)
fn mul_assign(&mut self, other: &'a FieldElement<F>)
Performs the
*= operation. Read moreSource§fn mul_assign(&mut self, other: &'a FieldElement<F>)
fn mul_assign(&mut self, other: &'a FieldElement<F>)
Performs the
*= operation. Read moreSource§impl<'a, F: FieldExtension> MulAssign<&'a SubfieldElement<F>> for FieldElement<F>
impl<'a, F: FieldExtension> MulAssign<&'a SubfieldElement<F>> for FieldElement<F>
Source§fn mul_assign(&mut self, rhs: &'a SubfieldElement<F>)
fn mul_assign(&mut self, rhs: &'a SubfieldElement<F>)
Performs the
*= operation. Read moreSource§impl<C: Curve> MulAssign<FieldElement<<C as Curve>::Scalar>> for CurveKey<C>
impl<C: Curve> MulAssign<FieldElement<<C as Curve>::Scalar>> for CurveKey<C>
Source§fn mul_assign(&mut self, rhs: ScalarAsExtension<C>)
fn mul_assign(&mut self, rhs: ScalarAsExtension<C>)
Performs the
*= operation. Read moreSource§impl<C: Curve, M: Positive> MulAssign<FieldElement<<C as Curve>::Scalar>> for CurvePoints<C, M>
impl<C: Curve, M: Positive> MulAssign<FieldElement<<C as Curve>::Scalar>> for CurvePoints<C, M>
Source§fn mul_assign(&mut self, other: ScalarAsExtension<C>)
fn mul_assign(&mut self, other: ScalarAsExtension<C>)
Performs the
*= operation. Read moreSource§impl<C: Curve> MulAssign<FieldElement<<C as Curve>::Scalar>> for Point<C>
impl<C: Curve> MulAssign<FieldElement<<C as Curve>::Scalar>> for Point<C>
Source§fn mul_assign(&mut self, rhs: ScalarAsExtension<C>)
fn mul_assign(&mut self, rhs: ScalarAsExtension<C>)
Performs the
*= operation. Read moreSource§fn mul_assign(&mut self, other: FieldElement<F>)
fn mul_assign(&mut self, other: FieldElement<F>)
Performs the
*= operation. Read moreSource§impl<F: FieldExtension> MulAssign<SubfieldElement<F>> for FieldElement<F>
impl<F: FieldExtension> MulAssign<SubfieldElement<F>> for FieldElement<F>
Source§fn mul_assign(&mut self, rhs: SubfieldElement<F>)
fn mul_assign(&mut self, rhs: SubfieldElement<F>)
Performs the
*= operation. Read moreSource§impl<F: FieldExtension> MulAssign for FieldElement<F>
impl<F: FieldExtension> MulAssign for FieldElement<F>
Source§fn mul_assign(&mut self, rhs: FieldElement<F>)
fn mul_assign(&mut self, rhs: FieldElement<F>)
Performs the
*= operation. Read moreSource§impl<F: FieldExtension> Neg for &FieldElement<F>
impl<F: FieldExtension> Neg for &FieldElement<F>
Source§impl<F: FieldExtension> Neg for FieldElement<F>
impl<F: FieldExtension> Neg for FieldElement<F>
Source§impl<F: FieldExtension> One for FieldElement<F>
impl<F: FieldExtension> One for FieldElement<F>
Source§impl<F: PartialEq + FieldExtension> PartialEq for FieldElement<F>
impl<F: PartialEq + FieldExtension> PartialEq for FieldElement<F>
Source§impl<F: PartialOrd + FieldExtension> PartialOrd for FieldElement<F>
impl<F: PartialOrd + FieldExtension> PartialOrd for FieldElement<F>
Source§impl<'a, F: FieldExtension> Product<&'a FieldElement<F>> for FieldElement<F>
impl<'a, F: FieldExtension> Product<&'a FieldElement<F>> for FieldElement<F>
Source§fn product<I: Iterator<Item = &'a FieldElement<F>>>(iter: I) -> Self
fn product<I: Iterator<Item = &'a FieldElement<F>>>(iter: I) -> Self
Takes an iterator and generates
Self from the elements by multiplying
the items.Source§impl<F: FieldExtension> Product for FieldElement<F>
impl<F: FieldExtension> Product for FieldElement<F>
Source§fn product<I: Iterator<Item = FieldElement<F>>>(iter: I) -> Self
fn product<I: Iterator<Item = FieldElement<F>>>(iter: I) -> Self
Takes an iterator and generates
Self from the elements by multiplying
the items.Source§impl<F: FieldExtension> ReduceWide<<F as MulAccReduce>::WideType> for FieldElement<F>
impl<F: FieldExtension> ReduceWide<<F as MulAccReduce>::WideType> for FieldElement<F>
fn reduce_mod_order(a: <F as MulAccReduce>::WideType) -> Self
Source§impl<F: FieldExtension> Serialize for FieldElement<F>
impl<F: FieldExtension> Serialize for FieldElement<F>
Source§impl<F: FieldExtension> Sub<&FieldElement<F>> for &FieldElement<F>
impl<F: FieldExtension> Sub<&FieldElement<F>> for &FieldElement<F>
Source§type Output = FieldElement<F>
type Output = FieldElement<F>
The resulting type after applying the
- operator.Source§impl<'a, F: FieldExtension> Sub<&'a FieldElement<F>> for FieldElement<F>
lhs owned, rhs borrowed
impl<'a, F: FieldExtension> Sub<&'a FieldElement<F>> for FieldElement<F>
lhs owned, rhs borrowed
Source§type Output = FieldElement<F>
type Output = FieldElement<F>
The resulting type after applying the
- operator.Source§impl<'a, F: FieldExtension> Sub<FieldElement<F>> for &'a FieldElement<F>
lhs borrowed, rhs owned
impl<'a, F: FieldExtension> Sub<FieldElement<F>> for &'a FieldElement<F>
lhs borrowed, rhs owned
Source§type Output = FieldElement<F>
type Output = FieldElement<F>
The resulting type after applying the
- operator.Source§impl<F: FieldExtension> Sub for FieldElement<F>
lhs owned, rhs owned
impl<F: FieldExtension> Sub for FieldElement<F>
lhs owned, rhs owned
Source§type Output = FieldElement<F>
type Output = FieldElement<F>
The resulting type after applying the
- operator.Source§impl<'a, F: FieldExtension> SubAssign<&'a FieldElement<F>> for FieldElement<F>
impl<'a, F: FieldExtension> SubAssign<&'a FieldElement<F>> for FieldElement<F>
Source§fn sub_assign(&mut self, rhs: &'a FieldElement<F>)
fn sub_assign(&mut self, rhs: &'a FieldElement<F>)
Performs the
-= operation. Read moreSource§impl<F: FieldExtension> SubAssign for FieldElement<F>
impl<F: FieldExtension> SubAssign for FieldElement<F>
Source§fn sub_assign(&mut self, rhs: FieldElement<F>)
fn sub_assign(&mut self, rhs: FieldElement<F>)
Performs the
-= operation. Read moreSource§impl<'a, F: FieldExtension> Sum<&'a FieldElement<F>> for FieldElement<F>
impl<'a, F: FieldExtension> Sum<&'a FieldElement<F>> for FieldElement<F>
Source§fn sum<I: Iterator<Item = &'a FieldElement<F>>>(iter: I) -> Self
fn sum<I: Iterator<Item = &'a FieldElement<F>>>(iter: I) -> Self
Takes an iterator and generates
Self from the elements by “summing up”
the items.Source§impl<F: FieldExtension> Sum for FieldElement<F>
impl<F: FieldExtension> Sum for FieldElement<F>
Source§fn sum<I: Iterator<Item = FieldElement<F>>>(iter: I) -> Self
fn sum<I: Iterator<Item = FieldElement<F>>>(iter: I) -> Self
Takes an iterator and generates
Self from the elements by “summing up”
the items.Source§impl<F: FieldExtension> Zero for FieldElement<F>
impl<F: FieldExtension> Zero for FieldElement<F>
impl<F: Copy + FieldExtension> Copy for FieldElement<F>
impl<F: FieldExtension> DefaultDotProduct<&FieldElement<F>, &FieldElement<F>> for FieldElement<F>
impl<F: FieldExtension> DefaultDotProduct<&FieldElement<F>, FieldElement<F>> for FieldElement<F>
impl<F: FieldExtension> DefaultDotProduct<FieldElement<F>, &FieldElement<F>> for FieldElement<F>
impl<F: FieldExtension> DefaultDotProduct for FieldElement<F>
impl<F: Eq + FieldExtension> Eq for FieldElement<F>
impl<F: FieldExtension> StructuralPartialEq for FieldElement<F>
Auto Trait Implementations§
impl<F> Freeze for FieldElement<F>where
F: Freeze,
impl<F> RefUnwindSafe for FieldElement<F>where
F: RefUnwindSafe,
impl<F> Send for FieldElement<F>
impl<F> Sync for FieldElement<F>
impl<F> Unpin for FieldElement<F>
impl<F> UnwindSafe for FieldElement<F>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ConditionallyNegatable for T
impl<T> ConditionallyNegatable for T
Source§fn conditional_negate(&mut self, choice: Choice)
fn conditional_negate(&mut self, choice: Choice)
Source§impl<T> ConditionallySelectable for Twhere
T: ConditionallySelectable,
impl<T> ConditionallySelectable for Twhere
T: ConditionallySelectable,
Source§impl<T> ConstantTimeSelect for Twhere
T: ConditionallySelectable,
impl<T> ConstantTimeSelect for Twhere
T: ConditionallySelectable,
Source§impl<T, T1, T2> DotProduct<T1, T2> for Twhere
T: DefaultDotProduct<T1, T2>,
impl<T, T1, T2> DotProduct<T1, T2> for Twhere
T: DefaultDotProduct<T1, T2>,
fn dot<I1, I2>(a: I1, b: I2) -> Twhere
I1: IntoExactSizeIterator<Item = T1>,
I2: IntoExactSizeIterator<Item = T2>,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Random for Twhere
Standard: Distribution<T>,
impl<T> Random for Twhere
Standard: Distribution<T>,
fn random(source: impl CryptoRngCore) -> T
fn random_n<Container: FromIterator<Self>>( rng: impl CryptoRngCore, size: usize, ) -> Container
Source§impl<T> Reconstructible for T
impl<T> Reconstructible for T
Source§fn open_to(
&self,
_peer_index: usize,
) -> Result<<T as Reconstructible>::Opening, PrimitiveError>
fn open_to( &self, _peer_index: usize, ) -> Result<<T as Reconstructible>::Opening, PrimitiveError>
Open the share towards another peer.
Source§fn open_to_all_others(&self) -> impl ExactSizeIterator
fn open_to_all_others(&self) -> impl ExactSizeIterator
Open the share towards all other peers. Returns an iterator with either one opening for
each peer or a single opening for all peers.
Source§fn reconstruct(
&self,
openings: &[<T as Reconstructible>::Opening],
) -> Result<<T as Reconstructible>::Secret, PrimitiveError>
fn reconstruct( &self, openings: &[<T as Reconstructible>::Opening], ) -> Result<<T as Reconstructible>::Secret, PrimitiveError>
Reconstruct a secret from openings coming from all other parties.
Source§fn reconstruct_all<S>(
shares: &[S],
) -> Result<<T as Reconstructible>::Secret, PrimitiveError>where
S: Borrow<T>,
fn reconstruct_all<S>(
shares: &[S],
) -> Result<<T as Reconstructible>::Secret, PrimitiveError>where
S: Borrow<T>,
Reconstruct a secret from a collection of shares, by opening each share
towards all other peers, reconstructing
n secrets from the openings and
checking that they are all equal.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref() only in debug builds, and is erased in release
builds.