triton_vm::prelude

Struct XFieldElement

Source
pub struct XFieldElement {
    pub coefficients: [BFieldElement; 3],
}

Fields§

§coefficients: [BFieldElement; 3]

Implementations§

Source§

impl XFieldElement

Source

pub fn shah_polynomial() -> Polynomial<'static, BFieldElement>

The quotient defining the field extension over the base field, namely x³ - x + 1.

Source

pub const fn new(coefficients: [BFieldElement; 3]) -> XFieldElement

Source

pub const fn new_const(element: BFieldElement) -> XFieldElement

Source

pub fn unlift(&self) -> Option<BFieldElement>

Source

pub fn increment(&mut self, index: usize)

Source

pub fn decrement(&mut self, index: usize)

Trait Implementations§

Source§

impl Add<BFieldElement> for XFieldElement

Source§

type Output = XFieldElement

The resulting type after applying the + operator.
Source§

fn add(self, other: BFieldElement) -> XFieldElement

Performs the + operation. Read more
Source§

impl Add<XFieldElement> for BFieldElement

The bfe + xfe -> xfe instance belongs to BFieldElement.

Source§

type Output = XFieldElement

The resulting type after applying the + operator.
Source§

fn add(self, other: XFieldElement) -> XFieldElement

Performs the + operation. Read more
Source§

impl Add for XFieldElement

Source§

type Output = XFieldElement

The resulting type after applying the + operator.
Source§

fn add(self, other: XFieldElement) -> XFieldElement

Performs the + operation. Read more
Source§

impl AddAssign<BFieldElement> for XFieldElement

Source§

fn add_assign(&mut self, rhs: BFieldElement)

Performs the += operation. Read more
Source§

impl AddAssign for XFieldElement

Source§

fn add_assign(&mut self, rhs: XFieldElement)

Performs the += operation. Read more
Source§

impl<'arbitrary> Arbitrary<'arbitrary> for XFieldElement

Source§

fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<XFieldElement, Error>

Generate an arbitrary value of Self from the given unstructured data. Read more
Source§

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

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
Source§

impl BFieldCodec for XFieldElement

Source§

type Error = XFieldElementBFieldDecodingError

Source§

fn decode( sequence: &[BFieldElement], ) -> Result<Box<XFieldElement>, <XFieldElement as BFieldCodec>::Error>

Source§

fn encode(&self) -> Vec<BFieldElement>

Source§

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

Source§

fn clone(&self) -> XFieldElement

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 ConstOne for XFieldElement

Source§

const ONE: XFieldElement = _

The multiplicative identity element of Self, 1.
Source§

impl ConstZero for XFieldElement

Source§

const ZERO: XFieldElement = _

The additive identity element of Self, 0.
Source§

impl CyclicGroupGenerator for XFieldElement

Source§

impl Debug for XFieldElement

Source§

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

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

impl<'de> Deserialize<'de> for XFieldElement

Source§

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

Source§

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

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

impl Div for XFieldElement

Source§

type Output = XFieldElement

The resulting type after applying the / operator.
Source§

fn div(self, other: XFieldElement) -> XFieldElement

Performs the / operation. Read more
§

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

Source§

fn batch_inversion(input: Vec<Self>) -> Vec<Self>

Montgomery Batch Inversion
Source§

fn square(self) -> Self

Source§

impl<T> From<[T; 3]> for XFieldElement
where T: Into<BFieldElement>,

Source§

fn from(value: [T; 3]) -> XFieldElement

Converts to this type from the input type.
Source§

impl From<Polynomial<'_, BFieldElement>> for XFieldElement

Source§

fn from(poly: Polynomial<'_, BFieldElement>) -> XFieldElement

Converts to this type from the input type.
Source§

impl<T> From<T> for XFieldElement
where T: Into<BFieldElement>,

Source§

fn from(value: T) -> XFieldElement

Converts to this type from the input type.
Source§

impl From<XFieldElement> for Digest

Source§

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 MerkleTrees directly from XFieldElements.

Source§

impl Hash for XFieldElement

Source§

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

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 Inverse for XFieldElement

Source§

impl ModPowU32 for XFieldElement

Source§

impl ModPowU64 for XFieldElement

Source§

fn mod_pow_u64(&self, exponent: u64) -> XFieldElement

Source§

impl Mul<BFieldElement> for XFieldElement

XField * BField means scalar multiplication of the BFieldElement onto each coefficient of the XField.

Source§

type Output = XFieldElement

The resulting type after applying the * operator.
Source§

fn mul(self, other: BFieldElement) -> XFieldElement

Performs the * operation. Read more
Source§

impl<FF, FF2> Mul<Polynomial<'_, FF>> for XFieldElement
where FF: FiniteField<Output = FF2> + Mul<XFieldElement>, FF2: 'static + FiniteField,

Source§

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

Performs the * operation. Read more
Source§

impl Mul<XFieldElement> for BFieldElement

Source§

type Output = XFieldElement

The resulting type after applying the * operator.
Source§

fn mul(self, other: XFieldElement) -> XFieldElement

Performs the * operation. Read more
Source§

impl Mul for XFieldElement

Source§

type Output = XFieldElement

The resulting type after applying the * operator.
Source§

fn mul(self, other: XFieldElement) -> XFieldElement

Performs the * operation. Read more
Source§

impl MulAssign<BFieldElement> for XFieldElement

Source§

fn mul_assign(&mut self, rhs: BFieldElement)

Performs the *= operation. Read more
Source§

impl MulAssign for XFieldElement

Source§

fn mul_assign(&mut self, rhs: XFieldElement)

Performs the *= operation. Read more
Source§

impl Neg for XFieldElement

Source§

type Output = XFieldElement

The resulting type after applying the - operator.
Source§

fn neg(self) -> XFieldElement

Performs the unary - operation. Read more
Source§

impl One for XFieldElement

Source§

fn one() -> XFieldElement

Returns the multiplicative identity element of Self, 1. Read more
Source§

fn is_one(&self) -> bool

Returns true if self is equal to the multiplicative identity. Read more
Source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
Source§

impl PartialEq for XFieldElement

Source§

fn eq(&self, other: &XFieldElement) -> 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 PrimitiveRootOfUnity for XFieldElement

Source§

impl Serialize for XFieldElement

Source§

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

Source§

type Output = XFieldElement

The resulting type after applying the - operator.
Source§

fn sub(self, other: BFieldElement) -> XFieldElement

Performs the - operation. Read more
Source§

impl Sub<XFieldElement> for BFieldElement

Source§

type Output = XFieldElement

The resulting type after applying the - operator.
Source§

fn sub(self, other: XFieldElement) -> XFieldElement

Performs the - operation. Read more
Source§

impl Sub for XFieldElement

Source§

type Output = XFieldElement

The resulting type after applying the - operator.
Source§

fn sub(self, other: XFieldElement) -> XFieldElement

Performs the - operation. Read more
Source§

impl SubAssign<BFieldElement> for XFieldElement

Source§

fn sub_assign(&mut self, rhs: BFieldElement)

Performs the -= operation. Read more
Source§

impl SubAssign for XFieldElement

Source§

fn sub_assign(&mut self, rhs: XFieldElement)

Performs the -= operation. Read more
Source§

impl Sum for XFieldElement

Source§

fn sum<I>(iter: I) -> XFieldElement
where I: Iterator<Item = XFieldElement>,

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

impl TryFrom<&[BFieldElement]> for XFieldElement

Source§

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>

Performs the conversion.
Source§

impl TryFrom<Digest> for XFieldElement

Source§

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>

Performs the conversion.
Source§

impl TryFrom<Vec<BFieldElement>> for XFieldElement

Source§

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>

Performs the conversion.
Source§

impl Zero for XFieldElement

Source§

fn zero() -> XFieldElement

Returns the additive identity element of Self, 0. Read more
Source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
Source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
Source§

impl Copy for XFieldElement

Source§

impl Eq for XFieldElement

Source§

impl StructuralPartialEq for XFieldElement

Auto Trait Implementations§

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> LinalgScalar for T
where T: One<Output = T> + Add<Output = T> + Sub<Output = T> + 'static + Mul + Copy + Div<Output = T> + Zero,