pub struct XFieldElement {
pub coefficients: [BFieldElement; 3],
}
Fields§
§coefficients: [BFieldElement; 3]
Implementations§
Source§impl XFieldElement
impl XFieldElement
Sourcepub fn shah_polynomial() -> Polynomial<'static, BFieldElement>
pub fn shah_polynomial() -> Polynomial<'static, BFieldElement>
The quotient defining the field extension over the base field, namely x³ - x + 1.
pub const fn new(coefficients: [BFieldElement; 3]) -> XFieldElement
pub const fn new_const(element: BFieldElement) -> XFieldElement
pub fn unlift(&self) -> Option<BFieldElement>
pub fn increment(&mut self, index: usize)
pub fn decrement(&mut self, index: usize)
Trait Implementations§
Source§impl Add<BFieldElement> for XFieldElement
impl Add<BFieldElement> for XFieldElement
Source§type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
+
operator.Source§fn add(self, other: BFieldElement) -> XFieldElement
fn add(self, other: BFieldElement) -> XFieldElement
Performs the
+
operation. Read moreSource§impl Add<XFieldElement> for BFieldElement
impl Add<XFieldElement> for BFieldElement
The bfe + xfe -> xfe
instance belongs to BFieldElement.
Source§type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
+
operator.Source§fn add(self, other: XFieldElement) -> XFieldElement
fn add(self, other: XFieldElement) -> XFieldElement
Performs the
+
operation. Read moreSource§impl Add for XFieldElement
impl Add for XFieldElement
Source§type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
+
operator.Source§fn add(self, other: XFieldElement) -> XFieldElement
fn add(self, other: XFieldElement) -> XFieldElement
Performs the
+
operation. Read moreSource§impl AddAssign<BFieldElement> for XFieldElement
impl AddAssign<BFieldElement> for XFieldElement
Source§fn add_assign(&mut self, rhs: BFieldElement)
fn add_assign(&mut self, rhs: BFieldElement)
Performs the
+=
operation. Read moreSource§impl AddAssign for XFieldElement
impl AddAssign for XFieldElement
Source§fn add_assign(&mut self, rhs: XFieldElement)
fn add_assign(&mut self, rhs: XFieldElement)
Performs the
+=
operation. Read moreSource§impl<'arbitrary> Arbitrary<'arbitrary> for XFieldElement
impl<'arbitrary> Arbitrary<'arbitrary> for XFieldElement
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<XFieldElement, Error>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<XFieldElement, Error>
Generate an arbitrary value of
Self
from the given unstructured data. Read moreSource§fn arbitrary_take_rest(
u: Unstructured<'arbitrary>,
) -> Result<XFieldElement, Error>
fn arbitrary_take_rest( u: Unstructured<'arbitrary>, ) -> Result<XFieldElement, Error>
Generate an arbitrary value of
Self
from the entirety of the given
unstructured data. Read moreSource§impl BFieldCodec for XFieldElement
impl BFieldCodec for XFieldElement
type Error = XFieldElementBFieldDecodingError
fn decode( sequence: &[BFieldElement], ) -> Result<Box<XFieldElement>, <XFieldElement as BFieldCodec>::Error>
fn encode(&self) -> Vec<BFieldElement>
Source§fn static_length() -> Option<usize>
fn static_length() -> Option<usize>
Returns the length in number of BFieldElements if it is known at compile-time.
Otherwise, None.
Source§impl Clone for XFieldElement
impl Clone for XFieldElement
Source§fn clone(&self) -> XFieldElement
fn clone(&self) -> XFieldElement
Returns a copy 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 ConstOne for XFieldElement
impl ConstOne for XFieldElement
Source§const ONE: XFieldElement = _
const ONE: XFieldElement = _
The multiplicative identity element of
Self
, 1
.Source§impl ConstZero for XFieldElement
impl ConstZero for XFieldElement
Source§const ZERO: XFieldElement = _
const ZERO: XFieldElement = _
The additive identity element of
Self
, 0
.Source§impl CyclicGroupGenerator for XFieldElement
impl CyclicGroupGenerator for XFieldElement
fn get_cyclic_group_elements(&self, max: Option<usize>) -> Vec<XFieldElement>
Source§impl Debug for XFieldElement
impl Debug for XFieldElement
Source§impl<'de> Deserialize<'de> for XFieldElement
impl<'de> Deserialize<'de> for XFieldElement
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<XFieldElement, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<XFieldElement, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for XFieldElement
impl Display for XFieldElement
Source§impl Div for XFieldElement
impl Div for XFieldElement
Source§type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
/
operator.Source§fn div(self, other: XFieldElement) -> XFieldElement
fn div(self, other: XFieldElement) -> XFieldElement
Performs the
/
operation. Read more§impl Evaluable<XFieldElement> for MasterAuxTable
impl Evaluable<XFieldElement> for MasterAuxTable
fn evaluate_initial_constraints( main_row: ArrayView1<'_, XFieldElement>, aux_row: ArrayView1<'_, XFieldElement>, challenges: &Challenges, ) -> Vec<XFieldElement>
fn evaluate_consistency_constraints( main_row: ArrayView1<'_, XFieldElement>, aux_row: ArrayView1<'_, XFieldElement>, challenges: &Challenges, ) -> Vec<XFieldElement>
fn evaluate_transition_constraints( current_main_row: ArrayView1<'_, XFieldElement>, current_aux_row: ArrayView1<'_, XFieldElement>, next_main_row: ArrayView1<'_, XFieldElement>, next_aux_row: ArrayView1<'_, XFieldElement>, challenges: &Challenges, ) -> Vec<XFieldElement>
fn evaluate_terminal_constraints( main_row: ArrayView1<'_, XFieldElement>, aux_row: ArrayView1<'_, XFieldElement>, challenges: &Challenges, ) -> Vec<XFieldElement>
Source§impl FiniteField for XFieldElement
impl FiniteField for XFieldElement
Source§impl<T> From<[T; 3]> for XFieldElementwhere
T: Into<BFieldElement>,
impl<T> From<[T; 3]> for XFieldElementwhere
T: Into<BFieldElement>,
Source§fn from(value: [T; 3]) -> XFieldElement
fn from(value: [T; 3]) -> XFieldElement
Converts to this type from the input type.
Source§impl From<Polynomial<'_, BFieldElement>> for XFieldElement
impl From<Polynomial<'_, BFieldElement>> for XFieldElement
Source§fn from(poly: Polynomial<'_, BFieldElement>) -> XFieldElement
fn from(poly: Polynomial<'_, BFieldElement>) -> XFieldElement
Converts to this type from the input type.
Source§impl<T> From<T> for XFieldElementwhere
T: Into<BFieldElement>,
impl<T> From<T> for XFieldElementwhere
T: Into<BFieldElement>,
Source§fn from(value: T) -> XFieldElement
fn from(value: T) -> XFieldElement
Converts to this type from the input type.
Source§impl From<XFieldElement> for Digest
impl From<XFieldElement> for Digest
Source§fn from(xfe: XFieldElement) -> Digest
fn from(xfe: XFieldElement) -> Digest
Interpret the XFieldElement
as a Digest
. No hashing is performed. This
interpretation can be useful for the
AlgebraicHasher
trait and,
by extension, allows building
MerkleTree
s directly from XFieldElement
s.
Source§impl Hash for XFieldElement
impl Hash for XFieldElement
Source§impl Inverse for XFieldElement
impl Inverse for XFieldElement
fn inverse(&self) -> XFieldElement
fn inverse_or_zero(&self) -> Self
Source§impl ModPowU32 for XFieldElement
impl ModPowU32 for XFieldElement
fn mod_pow_u32(&self, exp: u32) -> XFieldElement
Source§impl ModPowU64 for XFieldElement
impl ModPowU64 for XFieldElement
fn mod_pow_u64(&self, exponent: u64) -> XFieldElement
Source§impl Mul<BFieldElement> for XFieldElement
impl Mul<BFieldElement> for XFieldElement
XField * BField means scalar multiplication of the BFieldElement onto each coefficient of the XField.
Source§type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
*
operator.Source§fn mul(self, other: BFieldElement) -> XFieldElement
fn mul(self, other: BFieldElement) -> XFieldElement
Performs the
*
operation. Read moreSource§impl<FF, FF2> Mul<Polynomial<'_, FF>> for XFieldElement
impl<FF, FF2> Mul<Polynomial<'_, FF>> for XFieldElement
Source§type Output = Polynomial<'static, FF2>
type Output = Polynomial<'static, FF2>
The resulting type after applying the
*
operator.Source§fn mul(
self,
other: Polynomial<'_, FF>,
) -> <XFieldElement as Mul<Polynomial<'_, FF>>>::Output
fn mul( self, other: Polynomial<'_, FF>, ) -> <XFieldElement as Mul<Polynomial<'_, FF>>>::Output
Performs the
*
operation. Read moreSource§impl Mul<XFieldElement> for BFieldElement
impl Mul<XFieldElement> for BFieldElement
Source§type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
*
operator.Source§fn mul(self, other: XFieldElement) -> XFieldElement
fn mul(self, other: XFieldElement) -> XFieldElement
Performs the
*
operation. Read moreSource§impl Mul for XFieldElement
impl Mul for XFieldElement
Source§type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
*
operator.Source§fn mul(self, other: XFieldElement) -> XFieldElement
fn mul(self, other: XFieldElement) -> XFieldElement
Performs the
*
operation. Read moreSource§impl MulAssign<BFieldElement> for XFieldElement
impl MulAssign<BFieldElement> for XFieldElement
Source§fn mul_assign(&mut self, rhs: BFieldElement)
fn mul_assign(&mut self, rhs: BFieldElement)
Performs the
*=
operation. Read moreSource§impl MulAssign for XFieldElement
impl MulAssign for XFieldElement
Source§fn mul_assign(&mut self, rhs: XFieldElement)
fn mul_assign(&mut self, rhs: XFieldElement)
Performs the
*=
operation. Read moreSource§impl Neg for XFieldElement
impl Neg for XFieldElement
Source§type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
-
operator.Source§fn neg(self) -> XFieldElement
fn neg(self) -> XFieldElement
Performs the unary
-
operation. Read moreSource§impl One for XFieldElement
impl One for XFieldElement
Source§impl PartialEq for XFieldElement
impl PartialEq for XFieldElement
Source§impl PrimitiveRootOfUnity for XFieldElement
impl PrimitiveRootOfUnity for XFieldElement
fn primitive_root_of_unity(n: u64) -> Option<XFieldElement>
Source§impl Serialize for XFieldElement
impl Serialize for XFieldElement
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl Sub<BFieldElement> for XFieldElement
impl Sub<BFieldElement> for XFieldElement
Source§type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
-
operator.Source§fn sub(self, other: BFieldElement) -> XFieldElement
fn sub(self, other: BFieldElement) -> XFieldElement
Performs the
-
operation. Read moreSource§impl Sub<XFieldElement> for BFieldElement
impl Sub<XFieldElement> for BFieldElement
Source§type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
-
operator.Source§fn sub(self, other: XFieldElement) -> XFieldElement
fn sub(self, other: XFieldElement) -> XFieldElement
Performs the
-
operation. Read moreSource§impl Sub for XFieldElement
impl Sub for XFieldElement
Source§type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
-
operator.Source§fn sub(self, other: XFieldElement) -> XFieldElement
fn sub(self, other: XFieldElement) -> XFieldElement
Performs the
-
operation. Read moreSource§impl SubAssign<BFieldElement> for XFieldElement
impl SubAssign<BFieldElement> for XFieldElement
Source§fn sub_assign(&mut self, rhs: BFieldElement)
fn sub_assign(&mut self, rhs: BFieldElement)
Performs the
-=
operation. Read moreSource§impl SubAssign for XFieldElement
impl SubAssign for XFieldElement
Source§fn sub_assign(&mut self, rhs: XFieldElement)
fn sub_assign(&mut self, rhs: XFieldElement)
Performs the
-=
operation. Read moreSource§impl Sum for XFieldElement
impl Sum for XFieldElement
Source§fn sum<I>(iter: I) -> XFieldElementwhere
I: Iterator<Item = XFieldElement>,
fn sum<I>(iter: I) -> XFieldElementwhere
I: Iterator<Item = XFieldElement>,
Takes an iterator and generates
Self
from the elements by “summing up”
the items.Source§impl TryFrom<&[BFieldElement]> for XFieldElement
impl TryFrom<&[BFieldElement]> for XFieldElement
Source§type Error = TryFromXFieldElementError
type Error = TryFromXFieldElementError
The type returned in the event of a conversion error.
Source§fn try_from(
value: &[BFieldElement],
) -> Result<XFieldElement, <XFieldElement as TryFrom<&[BFieldElement]>>::Error>
fn try_from( value: &[BFieldElement], ) -> Result<XFieldElement, <XFieldElement as TryFrom<&[BFieldElement]>>::Error>
Performs the conversion.
Source§impl TryFrom<Digest> for XFieldElement
impl TryFrom<Digest> for XFieldElement
Source§type Error = TryFromXFieldElementError
type Error = TryFromXFieldElementError
The type returned in the event of a conversion error.
Source§fn try_from(
digest: Digest,
) -> Result<XFieldElement, <XFieldElement as TryFrom<Digest>>::Error>
fn try_from( digest: Digest, ) -> Result<XFieldElement, <XFieldElement as TryFrom<Digest>>::Error>
Performs the conversion.
Source§impl TryFrom<Vec<BFieldElement>> for XFieldElement
impl TryFrom<Vec<BFieldElement>> for XFieldElement
Source§type Error = TryFromXFieldElementError
type Error = TryFromXFieldElementError
The type returned in the event of a conversion error.
Source§fn try_from(
value: Vec<BFieldElement>,
) -> Result<XFieldElement, <XFieldElement as TryFrom<Vec<BFieldElement>>>::Error>
fn try_from( value: Vec<BFieldElement>, ) -> Result<XFieldElement, <XFieldElement as TryFrom<Vec<BFieldElement>>>::Error>
Performs the conversion.
Source§impl Zero for XFieldElement
impl Zero for XFieldElement
impl Copy for XFieldElement
impl Eq for XFieldElement
impl StructuralPartialEq for XFieldElement
Auto Trait Implementations§
impl Freeze for XFieldElement
impl RefUnwindSafe for XFieldElement
impl Send for XFieldElement
impl Sync for XFieldElement
impl Unpin for XFieldElement
impl UnwindSafe for XFieldElement
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more