Struct twenty_first::shared_math::x_field_element::XFieldElement
source · pub struct XFieldElement {
pub coefficients: [BFieldElement; 3],
}
Fields
coefficients: [BFieldElement; 3]
Implementations
sourceimpl XFieldElement
impl XFieldElement
pub fn shah_polynomial() -> Polynomial<BFieldElement>
pub fn new(coefficients: [BFieldElement; 3]) -> Self
pub fn new_u64(coeffs: [u64; 3]) -> Self
pub fn new_const(element: BFieldElement) -> Self
pub fn unlift(&self) -> Option<BFieldElement>
pub fn sample(digest: &Digest) -> Self
pub fn xgcd(
x: Polynomial<BFieldElement>,
y: Polynomial<BFieldElement>
) -> (Polynomial<BFieldElement>, Polynomial<BFieldElement>, Polynomial<BFieldElement>)
pub fn increment(&mut self, index: usize)
pub fn decrement(&mut self, index: usize)
Trait Implementations
sourceimpl Add<BFieldElement> for XFieldElement
impl Add<BFieldElement> for XFieldElement
type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
+
operator.sourcefn add(self, other: BFieldElement) -> Self
fn add(self, other: BFieldElement) -> Self
Performs the
+
operation. Read moresourceimpl Add<XFieldElement> for BFieldElement
impl Add<XFieldElement> for BFieldElement
The bfe + xfe -> xfe
instance belongs to BFieldElement.
type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
+
operator.sourcefn add(self, other: XFieldElement) -> XFieldElement
fn add(self, other: XFieldElement) -> XFieldElement
Performs the
+
operation. Read moresourceimpl Add<XFieldElement> for XFieldElement
impl Add<XFieldElement> for XFieldElement
type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
+
operator.sourceimpl AddAssign<BFieldElement> for XFieldElement
impl AddAssign<BFieldElement> for XFieldElement
sourcefn add_assign(&mut self, rhs: BFieldElement)
fn add_assign(&mut self, rhs: BFieldElement)
Performs the
+=
operation. Read moresourceimpl AddAssign<XFieldElement> for XFieldElement
impl AddAssign<XFieldElement> for XFieldElement
sourcefn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moresourceimpl Clone for XFieldElement
impl Clone for XFieldElement
sourcefn clone(&self) -> XFieldElement
fn clone(&self) -> XFieldElement
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl CyclicGroupGenerator for XFieldElement
impl CyclicGroupGenerator for XFieldElement
fn get_cyclic_group_elements(&self, max: Option<usize>) -> Vec<Self>
sourceimpl Debug for XFieldElement
impl Debug for XFieldElement
sourceimpl<'de> Deserialize<'de> for XFieldElement
impl<'de> Deserialize<'de> for XFieldElement
sourcefn 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
sourceimpl Display for XFieldElement
impl Display for XFieldElement
sourceimpl Distribution<XFieldElement> for Standard
impl Distribution<XFieldElement> for Standard
sourcefn 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.sourceimpl Div<XFieldElement> for XFieldElement
impl Div<XFieldElement> for XFieldElement
type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
/
operator.sourceimpl FiniteField for XFieldElement
impl FiniteField for XFieldElement
sourceimpl From<BFieldElement> for XFieldElement
impl From<BFieldElement> for XFieldElement
sourcefn from(bfe: BFieldElement) -> Self
fn from(bfe: BFieldElement) -> Self
Converts to this type from the input type.
sourceimpl From<Polynomial<BFieldElement>> for XFieldElement
impl From<Polynomial<BFieldElement>> for XFieldElement
sourcefn from(poly: Polynomial<BFieldElement>) -> Self
fn from(poly: Polynomial<BFieldElement>) -> Self
Converts to this type from the input type.
sourceimpl From<XFieldElement> for Polynomial<BFieldElement>
impl From<XFieldElement> for Polynomial<BFieldElement>
sourcefn from(item: XFieldElement) -> Self
fn from(item: XFieldElement) -> Self
Converts to this type from the input type.
sourceimpl From<u32> for XFieldElement
impl From<u32> for XFieldElement
sourceimpl FromVecu8 for XFieldElement
impl FromVecu8 for XFieldElement
fn from_vecu8(bytes: Vec<u8>) -> Self
sourceimpl Hash for XFieldElement
impl Hash for XFieldElement
sourceimpl Hashable for XFieldElement
impl Hashable for XFieldElement
fn to_sequence(&self) -> Vec<BFieldElement>
sourceimpl Inverse for XFieldElement
impl Inverse for XFieldElement
fn inverse(&self) -> Self
fn inverse_or_zero(&self) -> Self
sourceimpl ModPowU32 for XFieldElement
impl ModPowU32 for XFieldElement
fn mod_pow_u32(&self, exp: u32) -> Self
sourceimpl ModPowU64 for XFieldElement
impl ModPowU64 for XFieldElement
fn mod_pow_u64(&self, exponent: u64) -> Self
sourceimpl Mul<BFieldElement> for XFieldElement
impl Mul<BFieldElement> for XFieldElement
XField * BField means scalar multiplication of the BFieldElement onto each coefficient of the XField.
type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
*
operator.sourcefn mul(self, other: BFieldElement) -> Self
fn mul(self, other: BFieldElement) -> Self
Performs the
*
operation. Read moresourceimpl Mul<XFieldElement> for BFieldElement
impl Mul<XFieldElement> for BFieldElement
type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
*
operator.sourcefn mul(self, other: XFieldElement) -> XFieldElement
fn mul(self, other: XFieldElement) -> XFieldElement
Performs the
*
operation. Read moresourceimpl Mul<XFieldElement> for XFieldElement
impl Mul<XFieldElement> for XFieldElement
XField * XField means:
(ax^2 + bx + c) * (dx^2 + ex + f) (mod x^3 - x + 1)
= adx^4 + aex^3 + afx^2
- bdx^3 + bex^2 + bfx
- cdx^2 + cex + cf
= adx^4 + (ae + bd)x^3 + (af + be + cd)x^2 + (bf + ce)x + cf (mod x^3 - x + 1)
type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
*
operator.sourceimpl MulAssign<BFieldElement> for XFieldElement
impl MulAssign<BFieldElement> for XFieldElement
sourcefn mul_assign(&mut self, rhs: BFieldElement)
fn mul_assign(&mut self, rhs: BFieldElement)
Performs the
*=
operation. Read moresourceimpl MulAssign<XFieldElement> for XFieldElement
impl MulAssign<XFieldElement> for XFieldElement
sourcefn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*=
operation. Read moresourceimpl Neg for XFieldElement
impl Neg for XFieldElement
type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
-
operator.sourceimpl New for XFieldElement
impl New for XFieldElement
fn new_from_usize(&self, value: usize) -> Self
sourceimpl One for XFieldElement
impl One for XFieldElement
sourceimpl PartialEq<XFieldElement> for XFieldElement
impl PartialEq<XFieldElement> for XFieldElement
sourcefn eq(&self, other: &XFieldElement) -> bool
fn eq(&self, other: &XFieldElement) -> bool
sourceimpl PrimitiveRootOfUnity for XFieldElement
impl PrimitiveRootOfUnity for XFieldElement
fn primitive_root_of_unity(n: u64) -> Option<XFieldElement>
sourceimpl Serialize for XFieldElement
impl Serialize for XFieldElement
sourceimpl Sub<BFieldElement> for XFieldElement
impl Sub<BFieldElement> for XFieldElement
Subtracting a BFieldElement from an XFieldElement
self - other = self + (-other)
This overloads to Add and Neg
type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
-
operator.sourcefn sub(self, other: BFieldElement) -> Self
fn sub(self, other: BFieldElement) -> Self
Performs the
-
operation. Read moresourceimpl Sub<XFieldElement> for BFieldElement
impl Sub<XFieldElement> for BFieldElement
type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
-
operator.sourcefn sub(self, other: XFieldElement) -> XFieldElement
fn sub(self, other: XFieldElement) -> XFieldElement
Performs the
-
operation. Read moresourceimpl Sub<XFieldElement> for XFieldElement
impl Sub<XFieldElement> for XFieldElement
type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
-
operator.sourceimpl SubAssign<BFieldElement> for XFieldElement
impl SubAssign<BFieldElement> for XFieldElement
sourcefn sub_assign(&mut self, rhs: BFieldElement)
fn sub_assign(&mut self, rhs: BFieldElement)
Performs the
-=
operation. Read moresourceimpl SubAssign<XFieldElement> for XFieldElement
impl SubAssign<XFieldElement> for XFieldElement
sourcefn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moresourceimpl Sum<XFieldElement> for XFieldElement
impl Sum<XFieldElement> for XFieldElement
sourceimpl TryFrom<&[BFieldElement]> for XFieldElement
impl TryFrom<&[BFieldElement]> for XFieldElement
sourceimpl TryFrom<Vec<BFieldElement, Global>> for XFieldElement
impl TryFrom<Vec<BFieldElement, Global>> for XFieldElement
sourceimpl Zero for XFieldElement
impl Zero for XFieldElement
impl Copy for XFieldElement
impl Eq for XFieldElement
impl StructuralEq for XFieldElement
impl StructuralPartialEq for XFieldElement
Auto Trait Implementations
impl RefUnwindSafe for XFieldElement
impl Send for XFieldElement
impl Sync for XFieldElement
impl Unpin for XFieldElement
impl UnwindSafe for XFieldElement
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more