Skip to main content

CubicTrinomialExtensionField

Type Alias CubicTrinomialExtensionField 

Source
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§

Source§

impl<F: Copy> CubicTrinomialExtensionField<F, F>

Source

pub const fn new_array<const N: usize>(input: [[F; 3]; N]) -> [Self; N]

Convert a [[F; D]; N] array to an array of extension field elements.

Const version of input.map(CubicTrinomialExtensionField::new).

§Panics

Panics if N == 0.

Trait Implementations§

Source§

impl<F, A> Add for CubicTrinomialExtensionField<F, A>

Source§

type Output = ExtField<F, 3, CubicTrinomial, A>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self

Performs the + operation. Read more
Source§

impl<F, A> Add<A> for CubicTrinomialExtensionField<F, A>

Source§

type Output = ExtField<F, 3, CubicTrinomial, A>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: A) -> Self

Performs the + operation. Read more
Source§

impl<F, A> AddAssign for CubicTrinomialExtensionField<F, A>

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl<F, A> AddAssign<A> for CubicTrinomialExtensionField<F, A>

Source§

fn add_assign(&mut self, rhs: A)

Performs the += operation. Read more
Source§

impl<F: CubicTrinomialExtendable> Algebra<F> for CubicTrinomialExtensionField<F>

Source§

fn mixed_dot_product<const N: usize>(a: &[Self; N], f: &[F; N]) -> Self
where F: Dup,

Dot product between algebra elements and base field scalars. Read more
Source§

const BATCHED_LC_CHUNK: usize = 8

Optimal chunk size for batched_linear_combination. Read more
Source§

fn batched_linear_combination(values: &[Self], coeffs: &[F]) -> Self
where F: Dup,

Runtime-length linear combination: Σ values[i] * coeffs[i]. Read more
Source§

impl<F: CubicTrinomialExtendable> Display for CubicTrinomialExtensionField<F>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<F> Div for CubicTrinomialExtensionField<F>

Source§

type Output = ExtField<F, 3, CubicTrinomial>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
Source§

impl<F> DivAssign for CubicTrinomialExtensionField<F>

Source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
Source§

impl<F: CubicTrinomialExtendable> ExtensionField<F> for CubicTrinomialExtensionField<F>

Source§

type ExtensionPacking = PackedExtField<F, <F as Field>::Packing, 3, CubicTrinomial>

Source§

fn is_in_basefield(&self) -> bool

Determine if the given element lies in the base field.
Source§

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>

Reassemble an element of Self from D = DIMENSION coefficients in Self via Σⱼ basisⱼ · coeffsⱼ. Returns None if coeffs.len() != Self::DIMENSION. Read more
Source§

impl<F: CubicTrinomialExtendable> Field for CubicTrinomialExtensionField<F>

Source§

const GENERATOR: Self

A generator of this field’s multiplicative group.
Source§

type Packing = ExtField<F, 3, CubicTrinomial>

Source§

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])

Add two slices of field elements together, returning the result in the first slice. Read more
Source§

fn order() -> BigUint

The number of elements in the field. Read more
Source§

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

Check if the given field element is equal to the unique multiplicative identity (ONE).
Source§

fn inverse(&self) -> Self

The multiplicative inverse of this field element. Read more
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])>,

Accumulate acc[c * N + j] += scales[j] * row[c] over a stream of packed rows. Read more
Source§

fn bits() -> usize

The number of bits required to define an element of this field. Read more
Source§

impl<F: CubicTrinomialExtendable> HasFrobenius<F> for CubicTrinomialExtensionField<F>

Source§

fn frobenius(&self) -> Self

FrobeniusField automorphisms: x -> x^n, where n is the order of BaseField.

Source§

fn repeated_frobenius(&self, count: usize) -> Self

Apply Frobenius count times: x → x^{p^count}.

Source§

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>

Returns the full Galois orbit of the element under Frobenius. Read more
Source§

impl<F, A> Mul for CubicTrinomialExtensionField<F, A>

Source§

type Output = ExtField<F, 3, CubicTrinomial, A>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self

Performs the * operation. Read more
Source§

impl<F, A> Mul<A> for CubicTrinomialExtensionField<F, A>

Source§

type Output = ExtField<F, 3, CubicTrinomial, A>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: A) -> Self

Performs the * operation. Read more
Source§

impl<F, A> MulAssign for CubicTrinomialExtensionField<F, A>

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl<F, A> MulAssign<A> for CubicTrinomialExtensionField<F, A>

Source§

fn mul_assign(&mut self, rhs: A)

Performs the *= operation. Read more
Source§

impl<F, A> Neg for CubicTrinomialExtensionField<F, A>

Source§

type Output = ExtField<F, 3, CubicTrinomial, A>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self

Performs the unary - operation. Read more
Source§

impl<F, A> PrimeCharacteristicRing for CubicTrinomialExtensionField<F, A>

Source§

const ZERO: Self

The additive identity of the ring. Read more
Source§

const ONE: Self

The multiplicative identity of the ring. Read more
Source§

const TWO: Self

The element in the ring given by ONE + ONE. Read more
Source§

const NEG_ONE: Self

The element in the ring given by -ONE. Read more
Source§

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

Embed an element of the prime field ℤ/p into the ring R. Read more
Source§

fn halve(&self) -> Self

The elementary function halve(a) = a/2. Read more
Source§

fn square(&self) -> Self

The elementary function square(a) = a^2. Read more
Source§

fn mul_2exp_u64(&self, exp: u64) -> Self

The elementary function mul_2exp_u64(a, exp) = a * 2^{exp}. Read more
Source§

fn div_2exp_u64(&self, exp: u64) -> Self

Divide by a given power of two. div_2exp_u64(a, exp) = a/2^exp Read more
Source§

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 more
Source§

fn from_bool(b: bool) -> Self

Return Self::ONE if b is true and Self::ZERO if b is false.
Source§

fn from_u8(int: u8) -> Self

Given an integer r, return the sum of r copies of ONE: Read more
Source§

fn from_u16(int: u16) -> Self

Given an integer r, return the sum of r copies of ONE: Read more
Source§

fn from_u32(int: u32) -> Self

Given an integer r, return the sum of r copies of ONE: Read more
Source§

fn from_u64(int: u64) -> Self

Given an integer r, return the sum of r copies of ONE: Read more
Source§

fn from_u128(int: u128) -> Self

Given an integer r, return the sum of r copies of ONE: Read more
Source§

fn from_usize(int: usize) -> Self

Given an integer r, return the sum of r copies of ONE: Read more
Source§

fn from_i8(int: i8) -> Self

Given an integer r, return the sum of r copies of ONE: Read more
Source§

fn from_i16(int: i16) -> Self

Given an integer r, return the sum of r copies of ONE: Read more
Source§

fn from_i32(int: i32) -> Self

Given an integer r, return the sum of r copies of ONE: Read more
Source§

fn from_i64(int: i64) -> Self

Given an integer r, return the sum of r copies of ONE: Read more
Source§

fn from_i128(int: i128) -> Self

Given an integer r, return the sum of r copies of ONE: Read more
Source§

fn from_isize(int: isize) -> Self

Given an integer r, return the sum of r copies of ONE: Read more
Source§

fn double(&self) -> Self

The elementary function double(a) = 2*a. Read more
Source§

fn cube(&self) -> Self

The elementary function cube(a) = a^3. Read more
Source§

fn xor(&self, y: &Self) -> Self

Computes the arithmetic generalization of boolean xor. Read more
Source§

fn xor3(&self, y: &Self, z: &Self) -> Self

Computes the arithmetic generalization of a triple xor. Read more
Source§

fn andn(&self, y: &Self) -> Self

Computes the arithmetic generalization of andnot. Read more
Source§

fn bool_check(&self) -> Self

The vanishing polynomial for boolean values: x * (x - 1). Read more
Source§

fn exp_u64(&self, power: u64) -> Self

Exponentiation by a u64 power. Read more
Source§

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

The elementary function exp_power_of_2(a, power_log) = a^{2^power_log}. Read more
Source§

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>

Construct an iterator which returns powers of self shifted by start: start, start*self^1, start*self^2, ....
Source§

fn dot_product<const N: usize>(u: &[Self; N], v: &[Self; N]) -> Self

Compute the dot product of two vectors.
Source§

fn sum_array<const N: usize>(input: &[Self]) -> Self

Compute the sum of a slice of elements whose length is a compile time constant. Read more
Source§

impl<F, A> Product for CubicTrinomialExtensionField<F, A>

Source§

fn product<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl<F: CubicTrinomialExtendable> RawDataSerializable for CubicTrinomialExtensionField<F>

Source§

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>

Convert a field element into a collection of bytes.
Source§

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>

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>

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]>

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]>

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]>

Convert an iterator of field element arrays into an iterator of u64 arrays. Read more
Source§

impl<F, A> Sub for CubicTrinomialExtensionField<F, A>

Source§

type Output = ExtField<F, 3, CubicTrinomial, A>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self

Performs the - operation. Read more
Source§

impl<F, A> Sub<A> for CubicTrinomialExtensionField<F, A>

Source§

type Output = ExtField<F, 3, CubicTrinomial, A>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: A) -> Self

Performs the - operation. Read more
Source§

impl<F, A> SubAssign for CubicTrinomialExtensionField<F, A>

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl<F, A> SubAssign<A> for CubicTrinomialExtensionField<F, A>

Source§

fn sub_assign(&mut self, rhs: A)

Performs the -= operation. Read more
Source§

impl<F, A> Sum for CubicTrinomialExtensionField<F, A>

Source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl<F: CubicTrinomialExtendable + HasTwoAdicCubicExtension> TwoAdicField for CubicTrinomialExtensionField<F>

Source§

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

Returns a generator of the multiplicative group of order 2^bits. Assumes bits <= TWO_ADICITY, otherwise the result is undefined.