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]) -> Self
pub const fn new_const(element: BFieldElement) -> Self
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) -> Self
fn add(self, other: BFieldElement) -> Self
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§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: Self)
fn add_assign(&mut self, rhs: Self)
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<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self
from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
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<Self>, Self::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§impl ConstZero for XFieldElement
impl ConstZero for XFieldElement
Source§impl CyclicGroupGenerator for XFieldElement
impl CyclicGroupGenerator for 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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::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 Distribution<XFieldElement> for Standard
impl Distribution<XFieldElement> for Standard
Source§fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> XFieldElement
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> XFieldElement
Generate a random value of
T
, using rng
as the source of randomness.Source§fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
Create an iterator that generates random values of
T
, using rng
as
the source of randomness. Read moreSource§impl Div for XFieldElement
impl Div for 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§impl From<Polynomial<'_, BFieldElement>> for XFieldElement
impl From<Polynomial<'_, BFieldElement>> for XFieldElement
Source§fn from(poly: Polynomial<'_, BFieldElement>) -> Self
fn from(poly: Polynomial<'_, BFieldElement>) -> Self
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§impl From<XFieldElement> for Digest
impl From<XFieldElement> for Digest
Source§fn from(xfe: XFieldElement) -> Self
fn from(xfe: XFieldElement) -> Self
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 From<XFieldElement> for Polynomial<'static, BFieldElement>
impl From<XFieldElement> for Polynomial<'static, BFieldElement>
Source§fn from(xfe: XFieldElement) -> Self
fn from(xfe: XFieldElement) -> Self
Converts to this type from the input type.
Source§impl Hash for XFieldElement
impl Hash for XFieldElement
Source§impl Inverse for XFieldElement
impl Inverse for XFieldElement
Source§impl ModPowU32 for XFieldElement
impl ModPowU32 for XFieldElement
fn mod_pow_u32(&self, exp: u32) -> Self
Source§impl ModPowU64 for XFieldElement
impl ModPowU64 for XFieldElement
fn mod_pow_u64(&self, exponent: u64) -> Self
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) -> Self
fn mul(self, other: BFieldElement) -> Self
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§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§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: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*=
operation. Read moreSource§impl Neg for XFieldElement
impl Neg for XFieldElement
Source§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§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) -> Self
fn sub(self, other: BFieldElement) -> Self
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§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: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moreSource§impl Sum for XFieldElement
impl Sum for XFieldElement
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§impl TryFrom<Digest> for XFieldElement
impl TryFrom<Digest> for XFieldElement
Source§impl TryFrom<Vec<BFieldElement>> for XFieldElement
impl TryFrom<Vec<BFieldElement>> for XFieldElement
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<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