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<XFieldElement> for XFieldElement
impl Add<XFieldElement> for XFieldElement
type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
+
operator.sourceimpl 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 · sourceconst fn clone_from(&mut self, source: &Self)
const 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 Default for XFieldElement
impl Default 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.sourcefn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>where
R: Rng,
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>where
R: Rng,
Create an iterator that generates random values of
T
, using rng
as
the source of randomness. Read moresourceimpl 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<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
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 XFieldElement
impl Mul<XFieldElement> for XFieldElement
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<XFieldElement> for XFieldElement
impl Sub<XFieldElement> for XFieldElement
type Output = XFieldElement
type Output = XFieldElement
The resulting type after applying the
-
operator.sourceimpl 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 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