Struct winter_math::fields::CubeExtension
source · #[repr(C)]pub struct CubeExtension<B: ExtensibleField<3>>(_, _, _);Expand description
Represents an element in a cubic extension of a StarkField.
The extension element is defined as α + β * φ + γ * φ^2, where φ is a root of in irreducible polynomial defined by the implementation of the ExtensibleField trait, and α, β, γ are base field elements.
Implementations
sourceimpl<B: ExtensibleField<3>> CubeExtension<B>
impl<B: ExtensibleField<3>> CubeExtension<B>
sourcepub fn new(a: B, b: B, c: B) -> Self
pub fn new(a: B, b: B, c: B) -> Self
Returns a new extension element instantiated from the provided base elements.
sourcepub fn is_supported() -> bool
pub fn is_supported() -> bool
Returns true if the base field specified by B type parameter supports cubic extensions.
Trait Implementations
sourceimpl<B: ExtensibleField<3>> Add<CubeExtension<B>> for CubeExtension<B>
impl<B: ExtensibleField<3>> Add<CubeExtension<B>> for CubeExtension<B>
type Output = CubeExtension<B>
type Output = CubeExtension<B>
The resulting type after applying the
+ operator.sourceimpl<B: ExtensibleField<3>> AddAssign<CubeExtension<B>> for CubeExtension<B>
impl<B: ExtensibleField<3>> AddAssign<CubeExtension<B>> for CubeExtension<B>
sourcefn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moresourceimpl<B: ExtensibleField<3>> AsBytes for CubeExtension<B>
impl<B: ExtensibleField<3>> AsBytes for CubeExtension<B>
sourceimpl<B: Clone + ExtensibleField<3>> Clone for CubeExtension<B>
impl<B: Clone + ExtensibleField<3>> Clone for CubeExtension<B>
sourcefn clone(&self) -> CubeExtension<B>
fn clone(&self) -> CubeExtension<B>
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<B: Debug + ExtensibleField<3>> Debug for CubeExtension<B>
impl<B: Debug + ExtensibleField<3>> Debug for CubeExtension<B>
sourceimpl<B: Default + ExtensibleField<3>> Default for CubeExtension<B>
impl<B: Default + ExtensibleField<3>> Default for CubeExtension<B>
sourcefn default() -> CubeExtension<B>
fn default() -> CubeExtension<B>
Returns the “default value” for a type. Read more
sourceimpl<B: ExtensibleField<3>> Deserializable for CubeExtension<B>
impl<B: ExtensibleField<3>> Deserializable for CubeExtension<B>
sourcefn read_from<R: ByteReader>(
source: &mut R
) -> Result<Self, DeserializationError>
fn read_from<R: ByteReader>(
source: &mut R
) -> Result<Self, DeserializationError>
Reads a sequence of bytes from the provided
source, attempts to deserialize these bytes
into Self, and returns the result. Read moresourcefn read_batch_from<R>(
source: &mut R,
num_elements: usize
) -> Result<Vec<Self, Global>, DeserializationError>where
R: ByteReader,
fn read_batch_from<R>(
source: &mut R,
num_elements: usize
) -> Result<Vec<Self, Global>, DeserializationError>where
R: ByteReader,
Reads a sequence of bytes from the provided
source, attempts to deserialize these bytes
into a vector with the specified number of Self elements, and returns the result. Read moresourceimpl<B: ExtensibleField<3>> Display for CubeExtension<B>
impl<B: ExtensibleField<3>> Display for CubeExtension<B>
sourceimpl<B: ExtensibleField<3>> Div<CubeExtension<B>> for CubeExtension<B>
impl<B: ExtensibleField<3>> Div<CubeExtension<B>> for CubeExtension<B>
type Output = CubeExtension<B>
type Output = CubeExtension<B>
The resulting type after applying the
/ operator.sourceimpl<B: ExtensibleField<3>> DivAssign<CubeExtension<B>> for CubeExtension<B>
impl<B: ExtensibleField<3>> DivAssign<CubeExtension<B>> for CubeExtension<B>
sourcefn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/= operation. Read moresourceimpl<B: ExtensibleField<3>> ExtensionOf<B> for CubeExtension<B>
impl<B: ExtensibleField<3>> ExtensionOf<B> for CubeExtension<B>
sourceimpl<B: ExtensibleField<3>> FieldElement for CubeExtension<B>
impl<B: ExtensibleField<3>> FieldElement for CubeExtension<B>
type PositiveInteger = <B as FieldElement>::PositiveInteger
type PositiveInteger = <B as FieldElement>::PositiveInteger
A type defining positive integers big enough to describe a field modulus for
Self::BaseField with no loss of precision. Read moretype BaseField = B
type BaseField = B
sourceconst ELEMENT_BYTES: usize = _
const ELEMENT_BYTES: usize = _
Number of bytes needed to encode an element
sourceconst IS_CANONICAL: bool = B::IS_CANONICAL
const IS_CANONICAL: bool = B::IS_CANONICAL
True if internal representation of the element is the same as its canonical representation.
sourcefn inv(self) -> Self
fn inv(self) -> Self
Returns a multiplicative inverse of this field element. If this element is ZERO, ZERO is
returned. Read more
sourcefn elements_as_bytes(elements: &[Self]) -> &[u8] ⓘ
fn elements_as_bytes(elements: &[Self]) -> &[u8] ⓘ
Converts a list of elements into a list of bytes. Read more
sourceunsafe fn bytes_as_elements(
bytes: &[u8]
) -> Result<&[Self], DeserializationError>
unsafe fn bytes_as_elements(
bytes: &[u8]
) -> Result<&[Self], DeserializationError>
Converts a list of bytes into a list of field elements. Read more
sourcefn zeroed_vector(n: usize) -> Vec<Self>
fn zeroed_vector(n: usize) -> Vec<Self>
Returns a vector of length
n initialized with all ZERO elements. Read moresourcefn as_base_elements(elements: &[Self]) -> &[Self::BaseField]
fn as_base_elements(elements: &[Self]) -> &[Self::BaseField]
Converts a list of field elements into a list of elements in the underlying base field. Read more
sourcefn exp(self, power: Self::PositiveInteger) -> Self
fn exp(self, power: Self::PositiveInteger) -> Self
Exponentiates this field element by
power parameter.sourceimpl<B: ExtensibleField<3>> From<B> for CubeExtension<B>
impl<B: ExtensibleField<3>> From<B> for CubeExtension<B>
sourceimpl<B: ExtensibleField<3>> From<u128> for CubeExtension<B>
impl<B: ExtensibleField<3>> From<u128> for CubeExtension<B>
sourceimpl<B: ExtensibleField<3>> From<u16> for CubeExtension<B>
impl<B: ExtensibleField<3>> From<u16> for CubeExtension<B>
sourceimpl<B: ExtensibleField<3>> From<u32> for CubeExtension<B>
impl<B: ExtensibleField<3>> From<u32> for CubeExtension<B>
sourceimpl<B: ExtensibleField<3>> From<u64> for CubeExtension<B>
impl<B: ExtensibleField<3>> From<u64> for CubeExtension<B>
sourceimpl<B: ExtensibleField<3>> From<u8> for CubeExtension<B>
impl<B: ExtensibleField<3>> From<u8> for CubeExtension<B>
sourceimpl<B: ExtensibleField<3>> Mul<CubeExtension<B>> for CubeExtension<B>
impl<B: ExtensibleField<3>> Mul<CubeExtension<B>> for CubeExtension<B>
type Output = CubeExtension<B>
type Output = CubeExtension<B>
The resulting type after applying the
* operator.sourceimpl<B: ExtensibleField<3>> MulAssign<CubeExtension<B>> for CubeExtension<B>
impl<B: ExtensibleField<3>> MulAssign<CubeExtension<B>> for CubeExtension<B>
sourcefn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*= operation. Read moresourceimpl<B: ExtensibleField<3>> Neg for CubeExtension<B>
impl<B: ExtensibleField<3>> Neg for CubeExtension<B>
type Output = CubeExtension<B>
type Output = CubeExtension<B>
The resulting type after applying the
- operator.sourceimpl<B: PartialEq + ExtensibleField<3>> PartialEq<CubeExtension<B>> for CubeExtension<B>
impl<B: PartialEq + ExtensibleField<3>> PartialEq<CubeExtension<B>> for CubeExtension<B>
sourcefn eq(&self, other: &CubeExtension<B>) -> bool
fn eq(&self, other: &CubeExtension<B>) -> bool
sourceimpl<B: ExtensibleField<3>> Randomizable for CubeExtension<B>
impl<B: ExtensibleField<3>> Randomizable for CubeExtension<B>
sourceconst VALUE_SIZE: usize = Self::ELEMENT_BYTES
const VALUE_SIZE: usize = Self::ELEMENT_BYTES
Size of
Self in bytes. Read moresourcefn from_random_bytes(bytes: &[u8]) -> Option<Self>
fn from_random_bytes(bytes: &[u8]) -> Option<Self>
Returns
Self if the set of bytes forms a valid value, otherwise returns None.sourceimpl<B: ExtensibleField<3>> Serializable for CubeExtension<B>
impl<B: ExtensibleField<3>> Serializable for CubeExtension<B>
sourcefn write_into<W: ByteWriter>(&self, target: &mut W)
fn write_into<W: ByteWriter>(&self, target: &mut W)
Serializes
self into bytes and writes these bytes into the target.sourcefn write_batch_into<W>(source: &[Self], target: &mut W)where
W: ByteWriter,
fn write_batch_into<W>(source: &[Self], target: &mut W)where
W: ByteWriter,
sourcefn get_size_hint(&self) -> usize
fn get_size_hint(&self) -> usize
Returns an estimate of how many bytes are needed to represent self. Read more
sourceimpl<B: ExtensibleField<3>> Sub<CubeExtension<B>> for CubeExtension<B>
impl<B: ExtensibleField<3>> Sub<CubeExtension<B>> for CubeExtension<B>
type Output = CubeExtension<B>
type Output = CubeExtension<B>
The resulting type after applying the
- operator.sourceimpl<B: ExtensibleField<3>> SubAssign<CubeExtension<B>> for CubeExtension<B>
impl<B: ExtensibleField<3>> SubAssign<CubeExtension<B>> for CubeExtension<B>
sourcefn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moresourceimpl<'a, B: ExtensibleField<3>> TryFrom<&'a [u8]> for CubeExtension<B>
impl<'a, B: ExtensibleField<3>> TryFrom<&'a [u8]> for CubeExtension<B>
sourcefn try_from(bytes: &[u8]) -> Result<Self, Self::Error>
fn try_from(bytes: &[u8]) -> Result<Self, Self::Error>
Converts a slice of bytes into a field element; returns error if the value encoded in bytes is not a valid field element. The bytes are assumed to be in little-endian byte order.
type Error = DeserializationError
type Error = DeserializationError
The type returned in the event of a conversion error.
impl<B: Copy + ExtensibleField<3>> Copy for CubeExtension<B>
impl<B: Eq + ExtensibleField<3>> Eq for CubeExtension<B>
impl<B: ExtensibleField<3>> StructuralEq for CubeExtension<B>
impl<B: ExtensibleField<3>> StructuralPartialEq for CubeExtension<B>
Auto Trait Implementations
impl<B> RefUnwindSafe for CubeExtension<B>where
B: RefUnwindSafe,
impl<B> Send for CubeExtension<B>
impl<B> Sync for CubeExtension<B>
impl<B> Unpin for CubeExtension<B>where
B: Unpin,
impl<B> UnwindSafe for CubeExtension<B>where
B: UnwindSafe,
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