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§
source§impl<B: ExtensibleField<3>> CubeExtension<B>
impl<B: ExtensibleField<3>> CubeExtension<B>
sourcepub const fn new(a: B, b: B, c: B) -> Self
pub const 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.
sourcepub const fn to_base_elements(self) -> [B; 3]
pub const fn to_base_elements(self) -> [B; 3]
Returns an array of base field elements comprising this extension field element.
The order of abase elements in the returned array is the same as the order in which the elements are provided to the CubeExtension::new() constructor.
Trait Implementations§
source§impl<B: ExtensibleField<3>> Add<CubeExtension<B>> for CubeExtension<B>
impl<B: ExtensibleField<3>> Add<CubeExtension<B>> for CubeExtension<B>
source§impl<B: ExtensibleField<3>> AddAssign<CubeExtension<B>> for CubeExtension<B>
impl<B: ExtensibleField<3>> AddAssign<CubeExtension<B>> for CubeExtension<B>
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+=
operation. Read moresource§impl<B: ExtensibleField<3>> AsBytes for CubeExtension<B>
impl<B: ExtensibleField<3>> AsBytes for CubeExtension<B>
source§impl<B: Clone + ExtensibleField<3>> Clone for CubeExtension<B>
impl<B: Clone + ExtensibleField<3>> Clone for CubeExtension<B>
source§fn clone(&self) -> CubeExtension<B>
fn clone(&self) -> CubeExtension<B>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<B: Debug + ExtensibleField<3>> Debug for CubeExtension<B>
impl<B: Debug + ExtensibleField<3>> Debug for CubeExtension<B>
source§impl<B: Default + ExtensibleField<3>> Default for CubeExtension<B>
impl<B: Default + ExtensibleField<3>> Default for CubeExtension<B>
source§fn default() -> CubeExtension<B>
fn default() -> CubeExtension<B>
source§impl<B: ExtensibleField<3>> Deserializable for CubeExtension<B>
impl<B: ExtensibleField<3>> Deserializable for CubeExtension<B>
source§fn read_from<R: ByteReader>(
source: &mut R
) -> Result<Self, DeserializationError>
fn read_from<R: ByteReader>( source: &mut R ) -> Result<Self, DeserializationError>
source
, attempts to deserialize these bytes
into Self
, and returns the result. Read moresource§fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
fn read_from_bytes(bytes: &[u8]) -> Result<Self, DeserializationError>
source§fn 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,
source
, attempts to deserialize these bytes
into a vector with the specified number of Self
elements, and returns the result. Read moresource§impl<B: ExtensibleField<3>> Display for CubeExtension<B>
impl<B: ExtensibleField<3>> Display for CubeExtension<B>
source§impl<B: ExtensibleField<3>> Div<CubeExtension<B>> for CubeExtension<B>
impl<B: ExtensibleField<3>> Div<CubeExtension<B>> for CubeExtension<B>
source§impl<B: ExtensibleField<3>> DivAssign<CubeExtension<B>> for CubeExtension<B>
impl<B: ExtensibleField<3>> DivAssign<CubeExtension<B>> for CubeExtension<B>
source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
/=
operation. Read moresource§impl<B: ExtensibleField<3>> ExtensionOf<B> for CubeExtension<B>
impl<B: ExtensibleField<3>> ExtensionOf<B> for CubeExtension<B>
source§impl<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
Self::BaseField
with no loss of precision.§type BaseField = B
type BaseField = B
BaseField
should be set
to Self
.source§const EXTENSION_DEGREE: usize = 3usize
const EXTENSION_DEGREE: usize = 3usize
Self::BaseField
. For prime fields,
extension degree should be set to 1.source§const ELEMENT_BYTES: usize = _
const ELEMENT_BYTES: usize = _
source§const IS_CANONICAL: bool = B::IS_CANONICAL
const IS_CANONICAL: bool = B::IS_CANONICAL
source§fn inv(self) -> Self
fn inv(self) -> Self
source§fn base_element(&self, i: usize) -> Self::BaseField
fn base_element(&self, i: usize) -> Self::BaseField
i
. Read moresource§fn slice_as_base_elements(elements: &[Self]) -> &[Self::BaseField]
fn slice_as_base_elements(elements: &[Self]) -> &[Self::BaseField]
source§fn slice_from_base_elements(elements: &[Self::BaseField]) -> &[Self]
fn slice_from_base_elements(elements: &[Self::BaseField]) -> &[Self]
source§fn elements_as_bytes(elements: &[Self]) -> &[u8] ⓘ
fn elements_as_bytes(elements: &[Self]) -> &[u8] ⓘ
source§unsafe fn bytes_as_elements(
bytes: &[u8]
) -> Result<&[Self], DeserializationError>
unsafe fn bytes_as_elements( bytes: &[u8] ) -> Result<&[Self], DeserializationError>
source§fn zeroed_vector(n: usize) -> Vec<Self>
fn zeroed_vector(n: usize) -> Vec<Self>
n
initialized with all ZERO elements. Read moresource§fn exp(self, power: Self::PositiveInteger) -> Self
fn exp(self, power: Self::PositiveInteger) -> Self
power
parameter.source§fn exp_vartime(self, power: Self::PositiveInteger) -> Self
fn exp_vartime(self, power: Self::PositiveInteger) -> Self
power
parameter.
This function is expressly variable time, to speed-up verifier computations.source§impl<B: ExtensibleField<3>> From<B> for CubeExtension<B>
impl<B: ExtensibleField<3>> From<B> for CubeExtension<B>
source§impl<B: ExtensibleField<3>> From<u128> for CubeExtension<B>
impl<B: ExtensibleField<3>> From<u128> for CubeExtension<B>
source§impl<B: ExtensibleField<3>> From<u16> for CubeExtension<B>
impl<B: ExtensibleField<3>> From<u16> for CubeExtension<B>
source§impl<B: ExtensibleField<3>> From<u32> for CubeExtension<B>
impl<B: ExtensibleField<3>> From<u32> for CubeExtension<B>
source§impl<B: ExtensibleField<3>> From<u64> for CubeExtension<B>
impl<B: ExtensibleField<3>> From<u64> for CubeExtension<B>
source§impl<B: ExtensibleField<3>> From<u8> for CubeExtension<B>
impl<B: ExtensibleField<3>> From<u8> for CubeExtension<B>
source§impl<B: ExtensibleField<3>> Mul<CubeExtension<B>> for CubeExtension<B>
impl<B: ExtensibleField<3>> Mul<CubeExtension<B>> for CubeExtension<B>
source§impl<B: ExtensibleField<3>> MulAssign<CubeExtension<B>> for CubeExtension<B>
impl<B: ExtensibleField<3>> MulAssign<CubeExtension<B>> for CubeExtension<B>
source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
*=
operation. Read moresource§impl<B: ExtensibleField<3>> Neg for CubeExtension<B>
impl<B: ExtensibleField<3>> Neg for CubeExtension<B>
source§impl<B: PartialEq + ExtensibleField<3>> PartialEq<CubeExtension<B>> for CubeExtension<B>
impl<B: PartialEq + ExtensibleField<3>> PartialEq<CubeExtension<B>> for CubeExtension<B>
source§fn eq(&self, other: &CubeExtension<B>) -> bool
fn eq(&self, other: &CubeExtension<B>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<B: ExtensibleField<3>> Randomizable for CubeExtension<B>
impl<B: ExtensibleField<3>> Randomizable for CubeExtension<B>
source§const VALUE_SIZE: usize = Self::ELEMENT_BYTES
const VALUE_SIZE: usize = Self::ELEMENT_BYTES
Self
in bytes. Read moresource§fn from_random_bytes(bytes: &[u8]) -> Option<Self>
fn from_random_bytes(bytes: &[u8]) -> Option<Self>
Self
if the set of bytes forms a valid value, otherwise returns None.source§impl<B: ExtensibleField<3>> Serializable for CubeExtension<B>
impl<B: ExtensibleField<3>> Serializable for CubeExtension<B>
source§fn write_into<W: ByteWriter>(&self, target: &mut W)
fn write_into<W: ByteWriter>(&self, target: &mut W)
self
into bytes and writes these bytes into the target
.source§fn 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,
source§fn get_size_hint(&self) -> usize
fn get_size_hint(&self) -> usize
source§impl<B: ExtensibleField<3>> Sub<CubeExtension<B>> for CubeExtension<B>
impl<B: ExtensibleField<3>> Sub<CubeExtension<B>> for CubeExtension<B>
source§impl<B: ExtensibleField<3>> SubAssign<CubeExtension<B>> for CubeExtension<B>
impl<B: ExtensibleField<3>> SubAssign<CubeExtension<B>> for CubeExtension<B>
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-=
operation. Read moresource§impl<'a, B: ExtensibleField<3>> TryFrom<&'a [u8]> for CubeExtension<B>
impl<'a, B: ExtensibleField<3>> TryFrom<&'a [u8]> for CubeExtension<B>
source§fn 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.