pub type CubicTrinomialExtensionField<F, A = F> = ExtField<F, 3, CubicTrinomial, A>;Expand description
A degree-3 extension field using X^3 - X - 1.
Elements are a_0 + a_1 X + a_2 X^2 with coefficients in the base field.
Type alias for the unified ExtField with Shape = CubicTrinomial.
Aliased Type§
pub struct CubicTrinomialExtensionField<F, A = F> { /* private fields */ }Implementations§
Trait Implementations§
Source§impl<F, A> Add for CubicTrinomialExtensionField<F, A>
impl<F, A> Add for CubicTrinomialExtensionField<F, A>
Source§impl<F, A> Add<A> for CubicTrinomialExtensionField<F, A>where
F: CubicTrinomialExtendable,
A: Algebra<F>,
impl<F, A> Add<A> for CubicTrinomialExtensionField<F, A>where
F: CubicTrinomialExtendable,
A: Algebra<F>,
Source§impl<F, A> AddAssign for CubicTrinomialExtensionField<F, A>
impl<F, A> AddAssign for CubicTrinomialExtensionField<F, A>
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+= operation. Read moreSource§impl<F, A> AddAssign<A> for CubicTrinomialExtensionField<F, A>where
F: CubicTrinomialExtendable,
A: Algebra<F>,
impl<F, A> AddAssign<A> for CubicTrinomialExtensionField<F, A>where
F: CubicTrinomialExtendable,
A: Algebra<F>,
Source§fn add_assign(&mut self, rhs: A)
fn add_assign(&mut self, rhs: A)
Performs the
+= operation. Read moreSource§impl<F: CubicTrinomialExtendable> Algebra<F> for CubicTrinomialExtensionField<F>
impl<F: CubicTrinomialExtendable> Algebra<F> for CubicTrinomialExtensionField<F>
Source§fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Selfwhere
F: Dup,
Dot product between algebra elements and base field scalars. Read more
Source§const BATCHED_LC_CHUNK: usize = 8
const BATCHED_LC_CHUNK: usize = 8
Optimal chunk size for
batched_linear_combination. Read moreSource§impl<F: CubicTrinomialExtendable> Display for CubicTrinomialExtensionField<F>
impl<F: CubicTrinomialExtendable> Display for CubicTrinomialExtensionField<F>
Source§impl<F> Div for CubicTrinomialExtensionField<F>where
F: CubicTrinomialExtendable,
impl<F> Div for CubicTrinomialExtensionField<F>where
F: CubicTrinomialExtendable,
Source§impl<F> DivAssign for CubicTrinomialExtensionField<F>where
F: CubicTrinomialExtendable,
impl<F> DivAssign for CubicTrinomialExtensionField<F>where
F: CubicTrinomialExtendable,
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/= operation. Read moreSource§impl<F: CubicTrinomialExtendable> ExtensionField<F> for CubicTrinomialExtensionField<F>
impl<F: CubicTrinomialExtendable> ExtensionField<F> for CubicTrinomialExtensionField<F>
type ExtensionPacking = PackedExtField<F, <F as Field>::Packing, 3, CubicTrinomial>
Source§fn is_in_basefield(&self) -> bool
fn is_in_basefield(&self) -> bool
Determine if the given element lies in the base field.
Source§fn as_base(&self) -> Option<F>
fn as_base(&self) -> Option<F>
If the element lies in the base field project it down.
Otherwise return None.
Source§fn from_ext_basis_coefficients(coeffs: &[Self]) -> Option<Self>
fn from_ext_basis_coefficients(coeffs: &[Self]) -> Option<Self>
Reassemble an element of
Self from D = DIMENSION coefficients in Self
via Σⱼ basisⱼ · coeffsⱼ. Returns None if coeffs.len() != Self::DIMENSION. Read moreSource§impl<F: CubicTrinomialExtendable> Field for CubicTrinomialExtensionField<F>
impl<F: CubicTrinomialExtendable> Field for CubicTrinomialExtensionField<F>
type Packing = ExtField<F, 3, CubicTrinomial>
Source§fn try_inverse(&self) -> Option<Self>
fn try_inverse(&self) -> Option<Self>
The multiplicative inverse of this field element, if it exists. Read more
Source§fn add_slices(slice_1: &mut [Self], slice_2: &[Self])
fn add_slices(slice_1: &mut [Self], slice_2: &[Self])
Add two slices of field elements together, returning the result in the first slice. Read more
Source§fn is_zero(&self) -> bool
fn is_zero(&self) -> bool
Check if the given field element is equal to the unique additive identity (ZERO).
Source§fn is_one(&self) -> bool
fn is_one(&self) -> bool
Check if the given field element is equal to the unique multiplicative identity (ONE).
Source§fn batched_columnwise_dot_product<EF, R, I, const N: usize>(
acc: &mut [EF::ExtensionPacking],
items: I,
)where
EF: ExtensionField<Self>,
R: Iterator<Item = Self::Packing>,
I: Iterator<Item = (R, [EF; N])>,
fn batched_columnwise_dot_product<EF, R, I, const N: usize>(
acc: &mut [EF::ExtensionPacking],
items: I,
)where
EF: ExtensionField<Self>,
R: Iterator<Item = Self::Packing>,
I: Iterator<Item = (R, [EF; N])>,
Accumulate
acc[c * N + j] += scales[j] * row[c] over a stream of packed rows. Read moreSource§impl<F: CubicTrinomialExtendable> HasFrobenius<F> for CubicTrinomialExtensionField<F>
impl<F: CubicTrinomialExtendable> HasFrobenius<F> for CubicTrinomialExtensionField<F>
Source§fn frobenius(&self) -> Self
fn frobenius(&self) -> Self
FrobeniusField automorphisms: x -> x^n, where n is the order of BaseField.
Source§fn repeated_frobenius(&self, count: usize) -> Self
fn repeated_frobenius(&self, count: usize) -> Self
Apply Frobenius count times: x → x^{p^count}.
Source§fn pseudo_inv(&self) -> Self
fn pseudo_inv(&self) -> Self
Compute pseudo-inverse using Frobenius automorphism.
Returns 0 if self == 0, and 1/self otherwise.
Uses the identity: a^{-1} = ProdConj(a) * Norm(a)^{-1} where
ProdConj(a) = a^{p + p^2},Norm(a) = a * ProdConj(a)is in the base field.
Source§fn galois_orbit(self) -> Vec<Self>
fn galois_orbit(self) -> Vec<Self>
Returns the full Galois orbit of the element under Frobenius. Read more
Source§impl<F, A> Mul for CubicTrinomialExtensionField<F, A>
impl<F, A> Mul for CubicTrinomialExtensionField<F, A>
Source§impl<F, A> Mul<A> for CubicTrinomialExtensionField<F, A>
impl<F, A> Mul<A> for CubicTrinomialExtensionField<F, A>
Source§impl<F, A> MulAssign for CubicTrinomialExtensionField<F, A>
impl<F, A> MulAssign for CubicTrinomialExtensionField<F, A>
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*= operation. Read moreSource§impl<F, A> MulAssign<A> for CubicTrinomialExtensionField<F, A>
impl<F, A> MulAssign<A> for CubicTrinomialExtensionField<F, A>
Source§fn mul_assign(&mut self, rhs: A)
fn mul_assign(&mut self, rhs: A)
Performs the
*= operation. Read moreSource§impl<F, A> Neg for CubicTrinomialExtensionField<F, A>where
F: CubicTrinomialExtendable,
A: Algebra<F>,
impl<F, A> Neg for CubicTrinomialExtensionField<F, A>where
F: CubicTrinomialExtendable,
A: Algebra<F>,
Source§impl<F, A> PrimeCharacteristicRing for CubicTrinomialExtensionField<F, A>
impl<F, A> PrimeCharacteristicRing for CubicTrinomialExtensionField<F, A>
Source§type PrimeSubfield = <A as PrimeCharacteristicRing>::PrimeSubfield
type PrimeSubfield = <A as PrimeCharacteristicRing>::PrimeSubfield
The field
ℤ/p where the characteristic of this ring is p.Source§fn from_prime_subfield(f: Self::PrimeSubfield) -> Self
fn from_prime_subfield(f: Self::PrimeSubfield) -> Self
Source§fn mul_2exp_u64(&self, exp: u64) -> Self
fn mul_2exp_u64(&self, exp: u64) -> Self
The elementary function
mul_2exp_u64(a, exp) = a * 2^{exp}. Read moreSource§fn div_2exp_u64(&self, exp: u64) -> Self
fn div_2exp_u64(&self, exp: u64) -> Self
Divide by a given power of two.
div_2exp_u64(a, exp) = a/2^exp Read moreSource§fn zero_vec(len: usize) -> Vec<Self>
fn zero_vec(len: usize) -> Vec<Self>
Allocates a vector of zero elements of length
len. Many operating systems zero pages
before assigning them to a userspace process. In that case, our process should not need to
write zeros, which would be redundant. However, the compiler may not always recognize this. Read moreSource§fn from_usize(int: usize) -> Self
fn from_usize(int: usize) -> Self
Source§fn from_isize(int: isize) -> Self
fn from_isize(int: isize) -> Self
Source§fn xor(&self, y: &Self) -> Self
fn xor(&self, y: &Self) -> Self
Computes the arithmetic generalization of boolean
xor. Read moreSource§fn xor3(&self, y: &Self, z: &Self) -> Self
fn xor3(&self, y: &Self, z: &Self) -> Self
Computes the arithmetic generalization of a triple
xor. Read moreSource§fn bool_check(&self) -> Self
fn bool_check(&self) -> Self
The vanishing polynomial for boolean values:
x * (x - 1). Read moreSource§fn exp_const_u64<const POWER: u64>(&self) -> Self
fn exp_const_u64<const POWER: u64>(&self) -> Self
Exponentiation by a small constant power. Read more
Source§fn exp_power_of_2(&self, power_log: usize) -> Self
fn exp_power_of_2(&self, power_log: usize) -> Self
The elementary function
exp_power_of_2(a, power_log) = a^{2^power_log}. Read moreSource§fn powers(&self) -> Powers<Self> ⓘ
fn powers(&self) -> Powers<Self> ⓘ
Construct an iterator which returns powers of
self: self^0, self^1, self^2, ....Source§fn shifted_powers(&self, start: Self) -> Powers<Self> ⓘ
fn shifted_powers(&self, start: Self) -> Powers<Self> ⓘ
Construct an iterator which returns powers of
self shifted by start: start, start*self^1, start*self^2, ....Source§impl<F, A> Product for CubicTrinomialExtensionField<F, A>
impl<F, A> Product for CubicTrinomialExtensionField<F, A>
Source§impl<F: CubicTrinomialExtendable> RawDataSerializable for CubicTrinomialExtensionField<F>
impl<F: CubicTrinomialExtendable> RawDataSerializable for CubicTrinomialExtensionField<F>
Source§const NUM_BYTES: usize
const NUM_BYTES: usize
The number of bytes which this field element occupies in memory.
Must be equal to the length of self.into_bytes().
Source§fn into_bytes(self) -> impl IntoIterator<Item = u8>
fn into_bytes(self) -> impl IntoIterator<Item = u8>
Convert a field element into a collection of bytes.
Source§fn into_byte_stream(
input: impl IntoIterator<Item = Self>,
) -> impl IntoIterator<Item = u8>
fn into_byte_stream( input: impl IntoIterator<Item = Self>, ) -> impl IntoIterator<Item = u8>
Convert an iterator of field elements into an iterator of bytes.
Source§fn into_u32_stream(
input: impl IntoIterator<Item = Self>,
) -> impl IntoIterator<Item = u32>
fn into_u32_stream( input: impl IntoIterator<Item = Self>, ) -> impl IntoIterator<Item = u32>
Convert an iterator of field elements into an iterator of u32s. Read more
Source§fn into_u64_stream(
input: impl IntoIterator<Item = Self>,
) -> impl IntoIterator<Item = u64>
fn into_u64_stream( input: impl IntoIterator<Item = Self>, ) -> impl IntoIterator<Item = u64>
Convert an iterator of field elements into an iterator of u64s. Read more
Source§fn into_parallel_byte_streams<const N: usize>(
input: impl IntoIterator<Item = [Self; N]>,
) -> impl IntoIterator<Item = [u8; N]>
fn into_parallel_byte_streams<const N: usize>( input: impl IntoIterator<Item = [Self; N]>, ) -> impl IntoIterator<Item = [u8; N]>
Convert an iterator of field element arrays into an iterator of byte arrays. Read more
Source§fn into_parallel_u32_streams<const N: usize>(
input: impl IntoIterator<Item = [Self; N]>,
) -> impl IntoIterator<Item = [u32; N]>
fn into_parallel_u32_streams<const N: usize>( input: impl IntoIterator<Item = [Self; N]>, ) -> impl IntoIterator<Item = [u32; N]>
Convert an iterator of field element arrays into an iterator of u32 arrays. Read more
Source§fn into_parallel_u64_streams<const N: usize>(
input: impl IntoIterator<Item = [Self; N]>,
) -> impl IntoIterator<Item = [u64; N]>
fn into_parallel_u64_streams<const N: usize>( input: impl IntoIterator<Item = [Self; N]>, ) -> impl IntoIterator<Item = [u64; N]>
Convert an iterator of field element arrays into an iterator of u64 arrays. Read more
Source§impl<F, A> Sub for CubicTrinomialExtensionField<F, A>
impl<F, A> Sub for CubicTrinomialExtensionField<F, A>
Source§impl<F, A> Sub<A> for CubicTrinomialExtensionField<F, A>where
F: CubicTrinomialExtendable,
A: Algebra<F>,
impl<F, A> Sub<A> for CubicTrinomialExtensionField<F, A>where
F: CubicTrinomialExtendable,
A: Algebra<F>,
Source§impl<F, A> SubAssign for CubicTrinomialExtensionField<F, A>
impl<F, A> SubAssign for CubicTrinomialExtensionField<F, A>
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-= operation. Read moreSource§impl<F, A> SubAssign<A> for CubicTrinomialExtensionField<F, A>where
F: CubicTrinomialExtendable,
A: Algebra<F>,
impl<F, A> SubAssign<A> for CubicTrinomialExtensionField<F, A>where
F: CubicTrinomialExtendable,
A: Algebra<F>,
Source§fn sub_assign(&mut self, rhs: A)
fn sub_assign(&mut self, rhs: A)
Performs the
-= operation. Read moreSource§impl<F, A> Sum for CubicTrinomialExtensionField<F, A>
impl<F, A> Sum for CubicTrinomialExtensionField<F, A>
Source§impl<F: CubicTrinomialExtendable + HasTwoAdicCubicExtension> TwoAdicField for CubicTrinomialExtensionField<F>
impl<F: CubicTrinomialExtendable + HasTwoAdicCubicExtension> TwoAdicField for CubicTrinomialExtensionField<F>
Source§const TWO_ADICITY: usize = F::EXT_TWO_ADICITY
const TWO_ADICITY: usize = F::EXT_TWO_ADICITY
The number of factors of two in this field’s multiplicative group.
Source§fn two_adic_generator(bits: usize) -> Self
fn two_adic_generator(bits: usize) -> Self
Returns a generator of the multiplicative group of order
2^bits.
Assumes bits <= TWO_ADICITY, otherwise the result is undefined.