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<F: IsField> FieldElement<F>
impl<F: IsField> FieldElement<F>
pub fn inplace_batch_inverse(numbers: &mut [Self]) -> Result<(), FieldError>
pub fn to_subfield_vec<S>(self) -> Vec<FieldElement<S>>where
S: IsSubFieldOf<F>,
source§impl<F> FieldElement<F>
impl<F> FieldElement<F>
source§impl<F> FieldElement<F>where
F: IsField,
impl<F> FieldElement<F>where
F: IsField,
FieldElement general implementation
Most of this is delegated to the trait F
that
implements the field operations.
sourcepub fn inv(&self) -> Result<Self, FieldError>
pub fn inv(&self) -> Result<Self, FieldError>
Returns the multiplicative inverse of self
sourcepub fn pow<T>(&self, exponent: T) -> Selfwhere
T: IsUnsignedInteger,
pub fn pow<T>(&self, exponent: T) -> Selfwhere
T: IsUnsignedInteger,
Returns self
raised to the power of exponent
pub fn to_extension<L: IsField>(self) -> FieldElement<L>where
F: IsSubFieldOf<L>,
source§impl<F: IsPrimeField> FieldElement<F>
impl<F: IsPrimeField> FieldElement<F>
pub fn representative(&self) -> F::RepresentativeType
pub fn sqrt(&self) -> Option<(Self, Self)>
pub fn legendre_symbol(&self) -> LegendreSymbol
sourcepub fn from_hex(hex_string: &str) -> Result<Self, CreationError>
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::InvalidHexString
if the value is not a hexstring.
Returns a CreationError::EmptyString
if the input string is empty.
source§impl<M, const NUM_LIMBS: usize> FieldElement<MontgomeryBackendPrimeField<M, NUM_LIMBS>>
impl<M, const NUM_LIMBS: usize> FieldElement<MontgomeryBackendPrimeField<M, NUM_LIMBS>>
sourcepub const fn from_hex_unchecked(hex: &str) -> Self
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>>
impl<F, Q> FieldElement<QuadraticExtensionField<F, Q>>
source§impl FieldElement<Babybear31PrimeField>
impl FieldElement<Babybear31PrimeField>
pub fn to_bytes_le(&self) -> [u8; 8]
pub fn to_bytes_be(&self) -> [u8; 8]
source§impl FieldElement<Stark252PrimeField>
impl FieldElement<Stark252PrimeField>
sourcepub fn to_bytes_le(&self) -> [u8; 32]
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.
sourcepub fn to_bits_le(&self) -> [bool; 256]
pub fn to_bits_le(&self) -> [bool; 256]
This follows the convention used by starknet-rs
sourcepub fn to_bytes_be(&self) -> [u8; 32]
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>
impl FieldElement<U64GoldilocksPrimeField>
pub fn to_bytes_le(&self) -> [u8; 8]
pub fn to_bytes_be(&self) -> [u8; 8]
source§impl FieldElement<Mersenne31MontgomeryPrimeField>
impl FieldElement<Mersenne31MontgomeryPrimeField>
pub fn to_bytes_le(&self) -> [u8; 8]
pub fn to_bytes_be(&self) -> [u8; 8]
source§impl FieldElement<Mersenne31Field>
impl FieldElement<Mersenne31Field>
pub fn to_bytes_le(&self) -> Vec<u8>
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>,
impl<F, L> Add<&FieldElement<F>> for &Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
+
operator.source§fn add(self, other: &FieldElement<F>) -> Polynomial<FieldElement<L>>
fn add(self, other: &FieldElement<F>) -> Polynomial<FieldElement<L>>
+
operation. Read moresource§impl<F, L> Add<&FieldElement<F>> for Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Add<&FieldElement<F>> for Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
+
operator.source§fn add(self, other: &FieldElement<F>) -> Polynomial<FieldElement<L>>
fn add(self, other: &FieldElement<F>) -> Polynomial<FieldElement<L>>
+
operation. Read moresource§impl<F, L> Add<&FieldElement<L>> for &FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
impl<F, L> Add<&FieldElement<L>> for &FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
Addition operator overloading for field elements
§type Output = FieldElement<L>
type Output = FieldElement<L>
+
operator.source§impl<F, L> Add<&FieldElement<L>> for FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
impl<F, L> Add<&FieldElement<L>> for FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
§type Output = FieldElement<L>
type Output = FieldElement<L>
+
operator.source§impl<F, L> Add<&Polynomial<FieldElement<L>>> for &FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Add<&Polynomial<FieldElement<L>>> for &FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
+
operator.source§fn add(self, other: &Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>
fn add(self, other: &Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>
+
operation. Read moresource§impl<F, L> Add<&Polynomial<FieldElement<L>>> for FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Add<&Polynomial<FieldElement<L>>> for FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
+
operator.source§fn add(self, other: &Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>
fn add(self, other: &Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>
+
operation. Read moresource§impl<F, L> Add<FieldElement<F>> for &Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Add<FieldElement<F>> for &Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
+
operator.source§fn add(self, other: FieldElement<F>) -> Polynomial<FieldElement<L>>
fn add(self, other: FieldElement<F>) -> Polynomial<FieldElement<L>>
+
operation. Read moresource§impl<F, L> Add<FieldElement<F>> for Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Add<FieldElement<F>> for Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
+
operator.source§fn add(self, other: FieldElement<F>) -> Polynomial<FieldElement<L>>
fn add(self, other: FieldElement<F>) -> Polynomial<FieldElement<L>>
+
operation. Read moresource§impl<F, L> Add<FieldElement<L>> for &FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
impl<F, L> Add<FieldElement<L>> for &FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
§type Output = FieldElement<L>
type Output = FieldElement<L>
+
operator.source§impl<F, L> Add<FieldElement<L>> for FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
impl<F, L> Add<FieldElement<L>> for FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
§type Output = FieldElement<L>
type Output = FieldElement<L>
+
operator.source§impl<F, L> Add<Polynomial<FieldElement<L>>> for &FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Add<Polynomial<FieldElement<L>>> for &FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
+
operator.source§fn add(self, other: Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>
fn add(self, other: Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>
+
operation. Read moresource§impl<F, L> Add<Polynomial<FieldElement<L>>> for FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Add<Polynomial<FieldElement<L>>> for FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
+
operator.source§fn add(self, other: Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>
fn add(self, other: Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>
+
operation. Read moresource§impl<F, L> AddAssign<FieldElement<F>> for FieldElement<L>where
F: IsSubFieldOf<L>,
L: IsField,
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>)
fn add_assign(&mut self, rhs: FieldElement<F>)
+=
operation. Read moresource§impl ByteConversion for FieldElement<Degree2ExtensionField>
impl ByteConversion for FieldElement<Degree2ExtensionField>
source§fn to_bytes_be(&self) -> Vec<u8>
fn to_bytes_be(&self) -> Vec<u8>
source§fn to_bytes_le(&self) -> Vec<u8>
fn to_bytes_le(&self) -> Vec<u8>
source§fn from_bytes_be(bytes: &[u8]) -> Result<Self, ByteConversionError>where
Self: Sized,
fn from_bytes_be(bytes: &[u8]) -> Result<Self, ByteConversionError>where
Self: Sized,
source§fn from_bytes_le(bytes: &[u8]) -> Result<Self, ByteConversionError>where
Self: Sized,
fn from_bytes_le(bytes: &[u8]) -> Result<Self, ByteConversionError>where
Self: Sized,
source§impl<M, const NUM_LIMBS: usize> ByteConversion for FieldElement<MontgomeryBackendPrimeField<M, NUM_LIMBS>>
impl<M, const NUM_LIMBS: usize> ByteConversion for FieldElement<MontgomeryBackendPrimeField<M, NUM_LIMBS>>
source§fn to_bytes_be(&self) -> Vec<u8>
fn to_bytes_be(&self) -> Vec<u8>
source§fn to_bytes_le(&self) -> Vec<u8>
fn to_bytes_le(&self) -> Vec<u8>
source§fn from_bytes_be(bytes: &[u8]) -> Result<Self, ByteConversionError>
fn from_bytes_be(bytes: &[u8]) -> Result<Self, ByteConversionError>
source§fn from_bytes_le(bytes: &[u8]) -> Result<Self, ByteConversionError>
fn from_bytes_le(bytes: &[u8]) -> Result<Self, ByteConversionError>
source§impl<F: Clone + IsField> Clone for FieldElement<F>
impl<F: Clone + IsField> Clone for FieldElement<F>
source§fn clone(&self) -> FieldElement<F>
fn clone(&self) -> FieldElement<F>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<F> Default for FieldElement<F>where
F: IsField,
impl<F> Default for FieldElement<F>where
F: IsField,
source§impl<const MODULUS: u64> Deserializable for FieldElement<U64PrimeField<MODULUS>>
impl<const MODULUS: u64> Deserializable for FieldElement<U64PrimeField<MODULUS>>
fn deserialize(bytes: &[u8]) -> Result<Self, DeserializationError>where
Self: Sized,
source§impl Display for FieldElement<Goldilocks64Field>
impl Display for FieldElement<Goldilocks64Field>
source§impl Display for FieldElement<Mersenne31Field>
impl Display for FieldElement<Mersenne31Field>
source§impl<M, const NUM_LIMBS: usize> Display for FieldElement<MontgomeryBackendPrimeField<M, NUM_LIMBS>>
impl<M, const NUM_LIMBS: usize> Display for FieldElement<MontgomeryBackendPrimeField<M, NUM_LIMBS>>
source§impl<F, L> Div<&FieldElement<L>> for &FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
impl<F, L> Div<&FieldElement<L>> for &FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
Division operator overloading for field elements*/
§type Output = FieldElement<L>
type Output = FieldElement<L>
/
operator.source§impl<F, L> Div<&FieldElement<L>> for FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
impl<F, L> Div<&FieldElement<L>> for FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
§type Output = FieldElement<L>
type Output = FieldElement<L>
/
operator.source§impl<F, L> Div<FieldElement<L>> for &FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
impl<F, L> Div<FieldElement<L>> for &FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
§type Output = FieldElement<L>
type Output = FieldElement<L>
/
operator.source§impl<F, L> Div<FieldElement<L>> for FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
impl<F, L> Div<FieldElement<L>> for FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
§type Output = FieldElement<L>
type Output = FieldElement<L>
/
operator.source§impl<F> From<&<F as IsField>::BaseType> for FieldElement<F>
impl<F> From<&<F as IsField>::BaseType> for FieldElement<F>
From overloading for field elements
source§impl<F, L> Mul<&FieldElement<F>> for &Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Mul<&FieldElement<F>> for &Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
*
operator.source§fn mul(self, multiplicand: &FieldElement<F>) -> Polynomial<FieldElement<L>>
fn mul(self, multiplicand: &FieldElement<F>) -> Polynomial<FieldElement<L>>
*
operation. Read moresource§impl<F, L> Mul<&FieldElement<F>> for Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Mul<&FieldElement<F>> for Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
*
operator.source§fn mul(self, multiplicand: &FieldElement<F>) -> Polynomial<FieldElement<L>>
fn mul(self, multiplicand: &FieldElement<F>) -> Polynomial<FieldElement<L>>
*
operation. Read moresource§impl<F, L> Mul<&FieldElement<L>> for &FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
impl<F, L> Mul<&FieldElement<L>> for &FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
Multiplication operator overloading for field elements*/
§type Output = FieldElement<L>
type Output = FieldElement<L>
*
operator.source§impl<F, L> Mul<&FieldElement<L>> for FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
impl<F, L> Mul<&FieldElement<L>> for FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
§type Output = FieldElement<L>
type Output = FieldElement<L>
*
operator.source§impl<F, L> Mul<&Polynomial<FieldElement<L>>> for &FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Mul<&Polynomial<FieldElement<L>>> for &FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
*
operator.source§fn mul(
self,
multiplicand: &Polynomial<FieldElement<L>>
) -> Polynomial<FieldElement<L>>
fn mul( self, multiplicand: &Polynomial<FieldElement<L>> ) -> Polynomial<FieldElement<L>>
*
operation. Read moresource§impl<F, L> Mul<&Polynomial<FieldElement<L>>> for FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Mul<&Polynomial<FieldElement<L>>> for FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
*
operator.source§fn mul(
self,
multiplicand: &Polynomial<FieldElement<L>>
) -> Polynomial<FieldElement<L>>
fn mul( self, multiplicand: &Polynomial<FieldElement<L>> ) -> Polynomial<FieldElement<L>>
*
operation. Read moresource§impl<F, L> Mul<FieldElement<F>> for &Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Mul<FieldElement<F>> for &Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
*
operator.source§fn mul(self, multiplicand: FieldElement<F>) -> Polynomial<FieldElement<L>>
fn mul(self, multiplicand: FieldElement<F>) -> Polynomial<FieldElement<L>>
*
operation. Read moresource§impl<F, L> Mul<FieldElement<F>> for Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Mul<FieldElement<F>> for Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
*
operator.source§fn mul(self, multiplicand: FieldElement<F>) -> Polynomial<FieldElement<L>>
fn mul(self, multiplicand: FieldElement<F>) -> Polynomial<FieldElement<L>>
*
operation. Read moresource§impl<F, L> Mul<FieldElement<L>> for &FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
impl<F, L> Mul<FieldElement<L>> for &FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
§type Output = FieldElement<L>
type Output = FieldElement<L>
*
operator.source§impl<F, L> Mul<FieldElement<L>> for FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
impl<F, L> Mul<FieldElement<L>> for FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
§type Output = FieldElement<L>
type Output = FieldElement<L>
*
operator.source§impl<F, L> Mul<Polynomial<FieldElement<L>>> for &FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Mul<Polynomial<FieldElement<L>>> for &FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
*
operator.source§fn mul(
self,
multiplicand: Polynomial<FieldElement<L>>
) -> Polynomial<FieldElement<L>>
fn mul( self, multiplicand: Polynomial<FieldElement<L>> ) -> Polynomial<FieldElement<L>>
*
operation. Read moresource§impl<F, L> Mul<Polynomial<FieldElement<L>>> for FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Mul<Polynomial<FieldElement<L>>> for FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
*
operator.source§fn mul(
self,
multiplicand: Polynomial<FieldElement<L>>
) -> Polynomial<FieldElement<L>>
fn mul( self, multiplicand: Polynomial<FieldElement<L>> ) -> Polynomial<FieldElement<L>>
*
operation. Read moresource§impl<F> Neg for &FieldElement<F>where
F: IsField,
impl<F> Neg for &FieldElement<F>where
F: IsField,
Negation operator overloading for field elements*/
source§impl<F> Neg for FieldElement<F>where
F: IsField,
impl<F> Neg for FieldElement<F>where
F: IsField,
source§impl Ord for FieldElement<Mersenne31MontgomeryPrimeField>
impl Ord for FieldElement<Mersenne31MontgomeryPrimeField>
source§impl Ord for FieldElement<Stark252PrimeField>
impl Ord for FieldElement<Stark252PrimeField>
source§impl Ord for FieldElement<U64GoldilocksPrimeField>
impl Ord for FieldElement<U64GoldilocksPrimeField>
source§impl<F> PartialEq for FieldElement<F>where
F: IsField,
impl<F> PartialEq for FieldElement<F>where
F: IsField,
Equality operator overloading for field elements
source§fn eq(&self, other: &FieldElement<F>) -> bool
fn eq(&self, other: &FieldElement<F>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for FieldElement<Mersenne31MontgomeryPrimeField>
impl PartialOrd for FieldElement<Mersenne31MontgomeryPrimeField>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl PartialOrd for FieldElement<Stark252PrimeField>
impl PartialOrd for FieldElement<Stark252PrimeField>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl PartialOrd for FieldElement<U64GoldilocksPrimeField>
impl PartialOrd for FieldElement<U64GoldilocksPrimeField>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl<M, const NUM_LIMBS: usize> Serializable for FieldElement<MontgomeryBackendPrimeField<M, NUM_LIMBS>>
impl<M, const NUM_LIMBS: usize> Serializable for FieldElement<MontgomeryBackendPrimeField<M, NUM_LIMBS>>
source§impl<const MODULUS: u64> Serializable for FieldElement<U64PrimeField<MODULUS>>
impl<const MODULUS: u64> Serializable for FieldElement<U64PrimeField<MODULUS>>
source§impl<F, L> Sub<&FieldElement<F>> for &Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Sub<&FieldElement<F>> for &Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
-
operator.source§fn sub(self, other: &FieldElement<F>) -> Polynomial<FieldElement<L>>
fn sub(self, other: &FieldElement<F>) -> Polynomial<FieldElement<L>>
-
operation. Read moresource§impl<F, L> Sub<&FieldElement<F>> for Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Sub<&FieldElement<F>> for Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
-
operator.source§fn sub(self, other: &FieldElement<F>) -> Polynomial<FieldElement<L>>
fn sub(self, other: &FieldElement<F>) -> Polynomial<FieldElement<L>>
-
operation. Read moresource§impl<F, L> Sub<&FieldElement<L>> for &FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
impl<F, L> Sub<&FieldElement<L>> for &FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
Subtraction operator overloading for field elements*/
§type Output = FieldElement<L>
type Output = FieldElement<L>
-
operator.source§impl<F, L> Sub<&FieldElement<L>> for FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
impl<F, L> Sub<&FieldElement<L>> for FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
§type Output = FieldElement<L>
type Output = FieldElement<L>
-
operator.source§impl<F, L> Sub<&Polynomial<FieldElement<L>>> for &FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Sub<&Polynomial<FieldElement<L>>> for &FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
-
operator.source§fn sub(self, other: &Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>
fn sub(self, other: &Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>
-
operation. Read moresource§impl<F, L> Sub<&Polynomial<FieldElement<L>>> for FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Sub<&Polynomial<FieldElement<L>>> for FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
-
operator.source§fn sub(self, other: &Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>
fn sub(self, other: &Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>
-
operation. Read moresource§impl<F, L> Sub<FieldElement<F>> for &Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Sub<FieldElement<F>> for &Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
-
operator.source§fn sub(self, other: FieldElement<F>) -> Polynomial<FieldElement<L>>
fn sub(self, other: FieldElement<F>) -> Polynomial<FieldElement<L>>
-
operation. Read moresource§impl<F, L> Sub<FieldElement<F>> for Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Sub<FieldElement<F>> for Polynomial<FieldElement<L>>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
-
operator.source§fn sub(self, other: FieldElement<F>) -> Polynomial<FieldElement<L>>
fn sub(self, other: FieldElement<F>) -> Polynomial<FieldElement<L>>
-
operation. Read moresource§impl<F, L> Sub<FieldElement<L>> for &FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
impl<F, L> Sub<FieldElement<L>> for &FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
§type Output = FieldElement<L>
type Output = FieldElement<L>
-
operator.source§impl<F, L> Sub<FieldElement<L>> for FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
impl<F, L> Sub<FieldElement<L>> for FieldElement<F>where
F: IsSubFieldOf<L>,
L: IsField,
§type Output = FieldElement<L>
type Output = FieldElement<L>
-
operator.source§impl<F, L> Sub<Polynomial<FieldElement<L>>> for &FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Sub<Polynomial<FieldElement<L>>> for &FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
-
operator.source§fn sub(self, other: Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>
fn sub(self, other: Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>
-
operation. Read moresource§impl<F, L> Sub<Polynomial<FieldElement<L>>> for FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
impl<F, L> Sub<Polynomial<FieldElement<L>>> for FieldElement<F>where
L: IsField,
F: IsSubFieldOf<L>,
§type Output = Polynomial<FieldElement<L>>
type Output = Polynomial<FieldElement<L>>
-
operator.source§fn sub(self, other: Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>
fn sub(self, other: Polynomial<FieldElement<L>>) -> Polynomial<FieldElement<L>>
-
operation. Read moresource§impl<F> Sum for FieldElement<F>where
F: IsField,
impl<F> Sum for FieldElement<F>where
F: IsField,
Sum operator for field elements