Struct triton_vm::prelude::XFieldElement

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

Fields§

§coefficients: [BFieldElement; 3]

Implementations§

source§

impl XFieldElement

source

pub fn shah_polynomial() -> Polynomial<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

§

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.

§

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

§

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

§

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

§

type Output = XFieldElement

The resulting type after applying the / operator.
source§

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

Performs the / operation. Read more
source§

impl Evaluable<XFieldElement> for MasterExtTable

source§

fn evaluate_initial_constraints( base_row: ArrayView1<'_, XFieldElement>, ext_row: ArrayView1<'_, XFieldElement>, challenges: &Challenges ) -> Vec<XFieldElement>

The code for this method must be generated by running cargo run --bin constraint-evaluation-generator
source§

fn evaluate_consistency_constraints( base_row: ArrayView1<'_, XFieldElement>, ext_row: ArrayView1<'_, XFieldElement>, challenges: &Challenges ) -> Vec<XFieldElement>

The code for this method must be generated by running cargo run --bin constraint-evaluation-generator
source§

fn evaluate_transition_constraints( current_base_row: ArrayView1<'_, XFieldElement>, current_ext_row: ArrayView1<'_, XFieldElement>, next_base_row: ArrayView1<'_, XFieldElement>, next_ext_row: ArrayView1<'_, XFieldElement>, challenges: &Challenges ) -> Vec<XFieldElement>

The code for this method must be generated by running cargo run --bin constraint-evaluation-generator
source§

fn evaluate_terminal_constraints( base_row: ArrayView1<'_, XFieldElement>, ext_row: ArrayView1<'_, XFieldElement>, challenges: &Challenges ) -> Vec<XFieldElement>

The code for this method must be generated by running cargo run --bin constraint-evaluation-generator
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 MasterTable<XFieldElement> for MasterExtTable

source§

fn trace_domain(&self) -> ArithmeticDomain

source§

fn randomized_trace_domain(&self) -> ArithmeticDomain

source§

fn quotient_domain(&self) -> ArithmeticDomain

source§

fn fri_domain(&self) -> ArithmeticDomain

source§

fn trace_table(&self) -> ArrayView2<'_, XFieldElement>

Presents underlying trace data, excluding trace randomizers and randomizer polynomials.
source§

fn trace_table_mut(&mut self) -> ArrayViewMut2<'_, XFieldElement>

Mutably presents underlying trace data, excluding trace randomizers and randomizer polynomials.
source§

fn randomized_trace_table(&self) -> ArrayView2<'_, XFieldElement>

source§

fn randomized_trace_table_mut(&mut self) -> ArrayViewMut2<'_, XFieldElement>

source§

fn quotient_domain_table(&self) -> ArrayView2<'_, XFieldElement>

The low-degree extended randomized trace data over the quotient domain. Includes randomizer polynomials. Requires having called low_degree_extend_all_columns first.
source§

fn fri_domain_table(&self) -> ArrayView2<'_, XFieldElement>

The low-degree extended randomized trace data over the FRI domain. Includes randomizer polynomials. Requires having called low_degree_extend_all_columns first.
source§

fn memoize_low_degree_extended_table( &mut self, low_degree_extended_columns: Array2<XFieldElement> )

Not intended for direct use, but through Self::low_degree_extend_all_columns.
source§

fn low_degree_extended_table(&self) -> ArrayView2<'_, XFieldElement>

Requires having called low_degree_extend_all_columns first.
source§

fn memoize_interpolation_polynomials( &mut self, interpolation_polynomials: Array1<Polynomial<XFieldElement>> )

Memoize the polynomials interpolating the columns. Not intended for direct use, but through Self::low_degree_extend_all_columns.
source§

fn interpolation_polynomials(&self) -> ArrayView1<'_, Polynomial<XFieldElement>>

Requires having called low_degree_extend_all_columns first.
source§

fn row(&self, row_index: XFieldElement) -> Array1<XFieldElement>

Get one row of the table at an arbitrary index. Notably, the index does not have to be in any of the domains. In other words, can be used to compute out-of-domain rows. Requires having called low_degree_extend_all_columns first. Does not include randomizer polynomials.
source§

fn hash_one_row(row: ArrayView1<'_, XFieldElement>) -> Digest

source§

fn randomize_trace(&mut self)

Set all rows not part of the actual (padded) trace to random values.
source§

fn low_degree_extend_all_columns(&mut self)

Low-degree extend all columns of the randomized trace domain table. The resulting low-degree extended columns can be accessed using quotient_domain_table and fri_domain_table.
source§

fn merkle_tree( &self, maybe_profiler: &mut Option<TritonProfiler> ) -> MerkleTree<Tip5>

Compute a Merkle tree of the FRI domain table. Every row gives one leaf in the tree. The function hash_row is used to hash each row.
source§

fn hash_all_fri_domain_rows(&self) -> Vec<Digest>

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.

§

type Output = XFieldElement

The resulting type after applying the * operator.
source§

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

Performs the * operation. Read more
source§

impl Mul<XFieldElement> for BFieldElement

§

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

§

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

§

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

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

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

This method 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

§

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

§

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

§

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>,

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

impl TryFrom<&[BFieldElement]> for XFieldElement

§

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

§

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

§

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

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

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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>,

§

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,