Struct lambdaworks_math::field::element::FieldElement

source ·
pub struct FieldElement<F: IsField> { /* private fields */ }
Expand description

A field element with operations algorithms defined in F

Implementations§

source§

impl FieldElement<FqField>

source

pub fn new_base(a_hex: &str) -> Self

source§

impl FieldElement<BLS12377PrimeField>

source

pub fn new_base(a_hex: &str) -> Self

source§

impl FieldElement<BLS12381PrimeField>

source

pub fn new_base(a_hex: &str) -> Self

source§

impl FieldElement<Degree2ExtensionField>

source

pub fn new_base(a_hex: &str) -> Self

source

pub fn conjugate(&self) -> Self

source§

impl FieldElement<Degree6ExtensionField>

source

pub fn new_base(a_hex: &str) -> Self

source§

impl FieldElement<Degree12ExtensionField>

source

pub fn new_base(a_hex: &str) -> Self

source

pub fn from_coefficients(coefficients: &[&str; 12]) -> Self

source§

impl FieldElement<BN254PrimeField>

source

pub fn new_base(a_hex: &str) -> Self

source§

impl FieldElement<Degree2ExtensionField>

source

pub fn new_base(a_hex: &str) -> Self

source§

impl FieldElement<Degree6ExtensionField>

source

pub fn new_base(a_hex: &str) -> Self

source§

impl FieldElement<Degree12ExtensionField>

source

pub fn new_base(a_hex: &str) -> Self

source

pub fn from_coefficients(coefficients: &[&str; 12]) -> Self

source§

impl FieldElement<GrumpkinPrimeField>

source

pub fn new_base(a_hex: &str) -> Self

source§

impl<F: IsField> FieldElement<F>

source

pub fn inplace_batch_inverse(numbers: &mut [Self]) -> Result<(), FieldError>

source

pub fn to_subfield_vec<S>(self) -> Vec<FieldElement<S>>
where S: IsSubFieldOf<F>,

source§

impl<F> FieldElement<F>
where F::BaseType: Clone, F: IsField,

source

pub fn from_raw(value: F::BaseType) -> Self

source

pub const fn const_from_raw(value: F::BaseType) -> Self

source§

impl<F> FieldElement<F>
where F: IsField,

FieldElement general implementation Most of this is delegated to the trait F that implements the field operations.

source

pub fn new(value: F::BaseType) -> Self

Creates a field element from value

source

pub fn value(&self) -> &F::BaseType

Returns the underlying value

source

pub fn inv(&self) -> Result<Self, FieldError>

Returns the multiplicative inverse of self

source

pub fn square(&self) -> Self

Returns the square of self

source

pub fn double(&self) -> Self

Returns the double of self

source

pub fn pow<T>(&self, exponent: T) -> Self

Returns self raised to the power of exponent

source

pub fn one() -> Self

Returns the multiplicative neutral element of the field.

source

pub fn zero() -> Self

Returns the additive neutral element of the field.

source

pub fn to_raw(self) -> F::BaseType

Returns the raw base type

source

pub fn to_extension<L: IsField>(self) -> FieldElement<L>
where F: IsSubFieldOf<L>,

source§

impl<F: IsPrimeField> FieldElement<F>

source

pub fn representative(&self) -> F::RepresentativeType

source

pub fn sqrt(&self) -> Option<(Self, Self)>

source

pub fn legendre_symbol(&self) -> LegendreSymbol

source

pub fn from_hex(hex_string: &str) -> Result<Self, CreationError>

Creates a FieldElement from a hexstring. It can contain 0x or not. Returns an CreationError::InvalidHexStringif the value is not a hexstring. Returns a CreationError::EmptyString if the input string is empty. Returns a CreationError::HexStringIsTooBig if the the input hex string is bigger than the maximum amount of characters for this element.

source

pub fn to_hex(&self) -> String

Creates a hexstring from a FieldElement without 0x.

source§

impl<M, const NUM_LIMBS: usize> FieldElement<MontgomeryBackendPrimeField<M, NUM_LIMBS>>
where M: IsModulus<UnsignedInteger<NUM_LIMBS>> + Clone + Debug,

source

pub const fn from_hex_unchecked(hex: &str) -> Self

Creates a FieldElement from a hexstring. It can contain 0x or not.

§Panics

Panics if value is not a hexstring

source§

impl<F, Q> FieldElement<QuadraticExtensionField<F, Q>>

source

pub fn conjugate(&self) -> Self

source§

impl FieldElement<Babybear31PrimeField>

source

pub fn to_bytes_le(&self) -> [u8; 8]

source

pub fn to_bytes_be(&self) -> [u8; 8]

source§

impl FieldElement<Stark252PrimeField>

source

pub fn to_bytes_le(&self) -> [u8; 32]

No std version of to_bytes_le from ByteConversion trait This follows the convention used by Starkware and Lambdaclass Cairo VM It’s the same as ByteConversion to_bytes_le.

source

pub fn to_bits_le(&self) -> [bool; 256]

This follows the convention used by starknet-rs

source

pub fn to_bytes_be(&self) -> [u8; 32]

No std version of to_bytes_be from ByteConversion trait This follows the convention used by Starkware and Lambdaclass Cairo VM It’s the same as ByteConversion to_bytes_be.

source§

impl FieldElement<U64GoldilocksPrimeField>

source

pub fn to_bytes_le(&self) -> [u8; 8]

source

pub fn to_bytes_be(&self) -> [u8; 8]

source§

impl FieldElement<Mersenne31MontgomeryPrimeField>

source

pub fn to_bytes_le(&self) -> [u8; 8]

source

pub fn to_bytes_be(&self) -> [u8; 8]

source§

impl FieldElement<Mersenne31Field>

source

pub fn to_bytes_le(&self) -> Vec<u8>

source

pub fn to_bytes_be(&self) -> Vec<u8>

Trait Implementations§

source§

impl<F, L> Add<&FieldElement<F>> for &Polynomial<FieldElement<L>>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the + operator.
source§

fn add(self, other: &FieldElement<F>) -> Polynomial<FieldElement<L>>

Performs the + operation. Read more
source§

impl<F, L> Add<&FieldElement<F>> for Polynomial<FieldElement<L>>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the + operator.
source§

fn add(self, other: &FieldElement<F>) -> Polynomial<FieldElement<L>>

Performs the + operation. Read more
source§

impl<F, L> Add<&FieldElement<L>> for &FieldElement<F>
where F: IsSubFieldOf<L>, L: IsField,

Addition operator overloading for field elements

source§

type Output = FieldElement<L>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &FieldElement<L>) -> Self::Output

Performs the + operation. Read more
source§

impl<F, L> Add<&FieldElement<L>> for FieldElement<F>
where F: IsSubFieldOf<L>, L: IsField,

source§

type Output = FieldElement<L>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &FieldElement<L>) -> Self::Output

Performs the + operation. Read more
source§

impl<F, L> Add<&Polynomial<FieldElement<L>>> for &FieldElement<F>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the + operator.
source§

fn add(self, other: &Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>

Performs the + operation. Read more
source§

impl<F, L> Add<&Polynomial<FieldElement<L>>> for FieldElement<F>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the + operator.
source§

fn add(self, other: &Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>

Performs the + operation. Read more
source§

impl<F, L> Add<FieldElement<F>> for &Polynomial<FieldElement<L>>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the + operator.
source§

fn add(self, other: FieldElement<F>) -> Polynomial<FieldElement<L>>

Performs the + operation. Read more
source§

impl<F, L> Add<FieldElement<F>> for Polynomial<FieldElement<L>>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the + operator.
source§

fn add(self, other: FieldElement<F>) -> Polynomial<FieldElement<L>>

Performs the + operation. Read more
source§

impl<F, L> Add<FieldElement<L>> for &FieldElement<F>
where F: IsSubFieldOf<L>, L: IsField,

source§

type Output = FieldElement<L>

The resulting type after applying the + operator.
source§

fn add(self, rhs: FieldElement<L>) -> Self::Output

Performs the + operation. Read more
source§

impl<F, L> Add<FieldElement<L>> for FieldElement<F>
where F: IsSubFieldOf<L>, L: IsField,

source§

type Output = FieldElement<L>

The resulting type after applying the + operator.
source§

fn add(self, rhs: FieldElement<L>) -> Self::Output

Performs the + operation. Read more
source§

impl<F, L> Add<Polynomial<FieldElement<L>>> for &FieldElement<F>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the + operator.
source§

fn add(self, other: Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>

Performs the + operation. Read more
source§

impl<F, L> Add<Polynomial<FieldElement<L>>> for FieldElement<F>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the + operator.
source§

fn add(self, other: Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>

Performs the + operation. Read more
source§

impl<F, L> AddAssign<FieldElement<F>> for FieldElement<L>
where F: IsSubFieldOf<L>, L: IsField,

AddAssign operator overloading for field elements

source§

fn add_assign(&mut self, rhs: FieldElement<F>)

Performs the += operation. Read more
source§

impl<M, const NUM_LIMBS: usize> AsBytes for FieldElement<MontgomeryBackendPrimeField<M, NUM_LIMBS>>
where M: IsModulus<UnsignedInteger<NUM_LIMBS>> + Clone + Debug,

source§

fn as_bytes(&self) -> Vec<u8>

Default serialize without args
source§

impl ByteConversion for FieldElement<Degree2ExtensionField>

source§

fn to_bytes_be(&self) -> Vec<u8>

Returns the byte representation of the element in big-endian order.}
source§

fn to_bytes_le(&self) -> Vec<u8>

Returns the byte representation of the element in little-endian order.
source§

fn from_bytes_be(bytes: &[u8]) -> Result<Self, ByteConversionError>
where Self: Sized,

Returns the element from its byte representation in big-endian order.
source§

fn from_bytes_le(bytes: &[u8]) -> Result<Self, ByteConversionError>
where Self: Sized,

Returns the element from its byte representation in little-endian order.
source§

impl<M, const NUM_LIMBS: usize> ByteConversion for FieldElement<MontgomeryBackendPrimeField<M, NUM_LIMBS>>
where M: IsModulus<UnsignedInteger<NUM_LIMBS>> + Clone + Debug,

source§

fn to_bytes_be(&self) -> Vec<u8>

Returns the byte representation of the element in big-endian order.}
source§

fn to_bytes_le(&self) -> Vec<u8>

Returns the byte representation of the element in little-endian order.
source§

fn from_bytes_be(bytes: &[u8]) -> Result<Self, ByteConversionError>

Returns the element from its byte representation in big-endian order.
source§

fn from_bytes_le(bytes: &[u8]) -> Result<Self, ByteConversionError>

Returns the element from its byte representation in little-endian order.
source§

impl ByteConversion for FieldElement<Degree2ExtensionField>

source§

fn to_bytes_be(&self) -> Vec<u8>

Returns the byte representation of the element in big-endian order.}
source§

fn to_bytes_le(&self) -> Vec<u8>

Returns the byte representation of the element in little-endian order.
source§

fn from_bytes_be(bytes: &[u8]) -> Result<Self, ByteConversionError>
where Self: Sized,

Returns the element from its byte representation in big-endian order.
source§

fn from_bytes_le(bytes: &[u8]) -> Result<Self, ByteConversionError>
where Self: Sized,

Returns the element from its byte representation in little-endian order.
source§

impl<F: Clone + IsField> Clone for FieldElement<F>
where F::BaseType: Clone,

source§

fn clone(&self) -> FieldElement<F>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<F: Debug + IsField> Debug for FieldElement<F>
where F::BaseType: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<F> Default for FieldElement<F>
where F: IsField,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<const MODULUS: u64> Deserializable for FieldElement<U64PrimeField<MODULUS>>

source§

fn deserialize(bytes: &[u8]) -> Result<Self, DeserializationError>
where Self: Sized,

source§

impl Display for FieldElement<Goldilocks64Field>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for FieldElement<Mersenne31Field>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<M, const NUM_LIMBS: usize> Display for FieldElement<MontgomeryBackendPrimeField<M, NUM_LIMBS>>
where M: IsModulus<UnsignedInteger<NUM_LIMBS>> + Clone + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<F, L> Div<&FieldElement<L>> for &FieldElement<F>
where F: IsSubFieldOf<L>, L: IsField,

Division operator overloading for field elements*/

source§

type Output = FieldElement<L>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &FieldElement<L>) -> Self::Output

Performs the / operation. Read more
source§

impl<F, L> Div<&FieldElement<L>> for FieldElement<F>
where F: IsSubFieldOf<L>, L: IsField,

source§

type Output = FieldElement<L>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &FieldElement<L>) -> Self::Output

Performs the / operation. Read more
source§

impl<F, L> Div<FieldElement<L>> for &FieldElement<F>
where F: IsSubFieldOf<L>, L: IsField,

source§

type Output = FieldElement<L>

The resulting type after applying the / operator.
source§

fn div(self, rhs: FieldElement<L>) -> Self::Output

Performs the / operation. Read more
source§

impl<F, L> Div<FieldElement<L>> for FieldElement<F>
where F: IsSubFieldOf<L>, L: IsField,

source§

type Output = FieldElement<L>

The resulting type after applying the / operator.
source§

fn div(self, rhs: FieldElement<L>) -> Self::Output

Performs the / operation. Read more
source§

impl<F> From<&<F as IsField>::BaseType> for FieldElement<F>
where F::BaseType: Clone, F: IsField,

From overloading for field elements

source§

fn from(value: &F::BaseType) -> Self

Converts to this type from the input type.
source§

impl<M, const NUM_LIMBS: usize> From<FieldElement<MontgomeryBackendPrimeField<M, NUM_LIMBS>>> for Vec<u8>
where M: IsModulus<UnsignedInteger<NUM_LIMBS>> + Clone + Debug,

source§

fn from( value: FieldElement<MontgomeryBackendPrimeField<M, NUM_LIMBS>>, ) -> Vec<u8>

Converts to this type from the input type.
source§

impl<F> From<u64> for FieldElement<F>
where F: IsField,

From overloading for U64

source§

fn from(value: u64) -> Self

Converts to this type from the input type.
source§

impl<F: Hash + IsField> Hash for FieldElement<F>
where F::BaseType: Hash,

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<F, L> Mul<&FieldElement<F>> for &Polynomial<FieldElement<L>>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the * operator.
source§

fn mul(self, multiplicand: &FieldElement<F>) -> Polynomial<FieldElement<L>>

Performs the * operation. Read more
source§

impl<F: IsField> Mul<&FieldElement<F>> for DenseMultilinearPolynomial<F>
where <F as IsField>::BaseType: Send + Sync,

source§

type Output = DenseMultilinearPolynomial<F>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &FieldElement<F>) -> Self::Output

Performs the * operation. Read more
source§

impl<F, L> Mul<&FieldElement<F>> for Polynomial<FieldElement<L>>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the * operator.
source§

fn mul(self, multiplicand: &FieldElement<F>) -> Polynomial<FieldElement<L>>

Performs the * operation. Read more
source§

impl<F, L> Mul<&FieldElement<L>> for &FieldElement<F>
where F: IsSubFieldOf<L>, L: IsField,

Multiplication operator overloading for field elements*/

source§

type Output = FieldElement<L>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &FieldElement<L>) -> Self::Output

Performs the * operation. Read more
source§

impl<F, L> Mul<&FieldElement<L>> for FieldElement<F>
where F: IsSubFieldOf<L>, L: IsField,

source§

type Output = FieldElement<L>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &FieldElement<L>) -> Self::Output

Performs the * operation. Read more
source§

impl<F, L> Mul<&Polynomial<FieldElement<L>>> for &FieldElement<F>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the * operator.
source§

fn mul( self, multiplicand: &Polynomial<FieldElement<L>>, ) -> Polynomial<FieldElement<L>>

Performs the * operation. Read more
source§

impl<F, L> Mul<&Polynomial<FieldElement<L>>> for FieldElement<F>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the * operator.
source§

fn mul( self, multiplicand: &Polynomial<FieldElement<L>>, ) -> Polynomial<FieldElement<L>>

Performs the * operation. Read more
source§

impl<F, L> Mul<FieldElement<F>> for &Polynomial<FieldElement<L>>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the * operator.
source§

fn mul(self, multiplicand: FieldElement<F>) -> Polynomial<FieldElement<L>>

Performs the * operation. Read more
source§

impl<F: IsField> Mul<FieldElement<F>> for DenseMultilinearPolynomial<F>
where <F as IsField>::BaseType: Send + Sync,

source§

type Output = DenseMultilinearPolynomial<F>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: FieldElement<F>) -> Self::Output

Performs the * operation. Read more
source§

impl<F, L> Mul<FieldElement<F>> for Polynomial<FieldElement<L>>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the * operator.
source§

fn mul(self, multiplicand: FieldElement<F>) -> Polynomial<FieldElement<L>>

Performs the * operation. Read more
source§

impl<F, L> Mul<FieldElement<L>> for &FieldElement<F>
where F: IsSubFieldOf<L>, L: IsField,

source§

type Output = FieldElement<L>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: FieldElement<L>) -> Self::Output

Performs the * operation. Read more
source§

impl<F, L> Mul<FieldElement<L>> for FieldElement<F>
where F: IsSubFieldOf<L>, L: IsField,

source§

type Output = FieldElement<L>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: FieldElement<L>) -> Self::Output

Performs the * operation. Read more
source§

impl<F, L> Mul<Polynomial<FieldElement<L>>> for &FieldElement<F>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the * operator.
source§

fn mul( self, multiplicand: Polynomial<FieldElement<L>>, ) -> Polynomial<FieldElement<L>>

Performs the * operation. Read more
source§

impl<F, L> Mul<Polynomial<FieldElement<L>>> for FieldElement<F>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the * operator.
source§

fn mul( self, multiplicand: Polynomial<FieldElement<L>>, ) -> Polynomial<FieldElement<L>>

Performs the * operation. Read more
source§

impl<F, L> MulAssign<&FieldElement<F>> for FieldElement<L>
where F: IsSubFieldOf<L>, L: IsField,

MulAssign operator overloading for field elements

source§

fn mul_assign(&mut self, rhs: &FieldElement<F>)

Performs the *= operation. Read more
source§

impl<F, L> MulAssign<FieldElement<F>> for FieldElement<L>
where F: IsSubFieldOf<L>, L: IsField,

MulAssign operator overloading for field elements

source§

fn mul_assign(&mut self, rhs: FieldElement<F>)

Performs the *= operation. Read more
source§

impl<F> Neg for &FieldElement<F>
where F: IsField,

Negation operator overloading for field elements*/

source§

type Output = FieldElement<F>

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl<F> Neg for FieldElement<F>
where F: IsField,

source§

type Output = FieldElement<F>

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl Ord for FieldElement<Mersenne31MontgomeryPrimeField>

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl Ord for FieldElement<Stark252PrimeField>

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl Ord for FieldElement<U64GoldilocksPrimeField>

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<F> PartialEq for FieldElement<F>
where F: IsField,

Equality operator overloading for field elements

source§

fn eq(&self, other: &FieldElement<F>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for FieldElement<Mersenne31MontgomeryPrimeField>

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd for FieldElement<Stark252PrimeField>

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl PartialOrd for FieldElement<U64GoldilocksPrimeField>

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<F, L> Sub<&FieldElement<F>> for &Polynomial<FieldElement<L>>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the - operator.
source§

fn sub(self, other: &FieldElement<F>) -> Polynomial<FieldElement<L>>

Performs the - operation. Read more
source§

impl<F, L> Sub<&FieldElement<F>> for Polynomial<FieldElement<L>>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the - operator.
source§

fn sub(self, other: &FieldElement<F>) -> Polynomial<FieldElement<L>>

Performs the - operation. Read more
source§

impl<F, L> Sub<&FieldElement<L>> for &FieldElement<F>
where F: IsSubFieldOf<L>, L: IsField,

Subtraction operator overloading for field elements*/

source§

type Output = FieldElement<L>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &FieldElement<L>) -> Self::Output

Performs the - operation. Read more
source§

impl<F, L> Sub<&FieldElement<L>> for FieldElement<F>
where F: IsSubFieldOf<L>, L: IsField,

source§

type Output = FieldElement<L>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &FieldElement<L>) -> Self::Output

Performs the - operation. Read more
source§

impl<F, L> Sub<&Polynomial<FieldElement<L>>> for &FieldElement<F>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the - operator.
source§

fn sub(self, other: &Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>

Performs the - operation. Read more
source§

impl<F, L> Sub<&Polynomial<FieldElement<L>>> for FieldElement<F>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the - operator.
source§

fn sub(self, other: &Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>

Performs the - operation. Read more
source§

impl<F, L> Sub<FieldElement<F>> for &Polynomial<FieldElement<L>>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the - operator.
source§

fn sub(self, other: FieldElement<F>) -> Polynomial<FieldElement<L>>

Performs the - operation. Read more
source§

impl<F, L> Sub<FieldElement<F>> for Polynomial<FieldElement<L>>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the - operator.
source§

fn sub(self, other: FieldElement<F>) -> Polynomial<FieldElement<L>>

Performs the - operation. Read more
source§

impl<F, L> Sub<FieldElement<L>> for &FieldElement<F>
where F: IsSubFieldOf<L>, L: IsField,

source§

type Output = FieldElement<L>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: FieldElement<L>) -> Self::Output

Performs the - operation. Read more
source§

impl<F, L> Sub<FieldElement<L>> for FieldElement<F>
where F: IsSubFieldOf<L>, L: IsField,

source§

type Output = FieldElement<L>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: FieldElement<L>) -> Self::Output

Performs the - operation. Read more
source§

impl<F, L> Sub<Polynomial<FieldElement<L>>> for &FieldElement<F>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the - operator.
source§

fn sub(self, other: Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>

Performs the - operation. Read more
source§

impl<F, L> Sub<Polynomial<FieldElement<L>>> for FieldElement<F>
where L: IsField, F: IsSubFieldOf<L>,

source§

type Output = Polynomial<FieldElement<L>>

The resulting type after applying the - operator.
source§

fn sub(self, other: Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>

Performs the - operation. Read more
source§

impl<F> Sum for FieldElement<F>
where F: IsField,

Sum operator for field elements

source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
source§

impl<F: Copy + IsField> Copy for FieldElement<F>
where F::BaseType: Copy,

source§

impl<F> Eq for FieldElement<F>
where F: IsField,

Auto Trait Implementations§

§

impl<F> Freeze for FieldElement<F>
where <F as IsField>::BaseType: Freeze,

§

impl<F> RefUnwindSafe for FieldElement<F>

§

impl<F> Send for FieldElement<F>
where <F as IsField>::BaseType: Send,

§

impl<F> Sync for FieldElement<F>
where <F as IsField>::BaseType: Sync,

§

impl<F> Unpin for FieldElement<F>

§

impl<F> UnwindSafe for FieldElement<F>
where <F as IsField>::BaseType: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
source§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.