pub trait ExtensionField<F: Field>:
    Field
    + From<F>
    + TryInto<F>
    + Add<F, Output = Self>
    + Sub<F, Output = Self>
    + Mul<F, Output = Self>
    + AddAssign<F>
    + SubAssign<F>
    + MulAssign<F> {
    const LOG_DEGREE: usize;
    const DEGREE: usize = _;
    // Required methods
    fn basis_checked(i: usize) -> Result<Self, Error>;
    fn from_bases_sparse(
        base_elems: impl IntoIterator<Item = F>,
        log_stride: usize,
    ) -> Result<Self, Error>;
    fn iter_bases(&self) -> impl Iterator<Item = F>;
    fn into_iter_bases(self) -> impl Iterator<Item = F>;
    unsafe fn get_base_unchecked(&self, i: usize) -> F;
    fn square_transpose(values: &mut [Self]) -> Result<(), Error>;
    // Provided methods
    fn basis(i: usize) -> Self { ... }
    fn from_bases(
        base_elems: impl IntoIterator<Item = F>,
    ) -> Result<Self, Error> { ... }
    fn get_base(&self, i: usize) -> F { ... }
}Required Associated Constants§
Sourceconst LOG_DEGREE: usize
 
const LOG_DEGREE: usize
Base-2 logarithm of the extension degree.
Provided Associated Constants§
Required Methods§
Sourcefn basis_checked(i: usize) -> Result<Self, Error>
 
fn basis_checked(i: usize) -> Result<Self, Error>
For 0 <= i < DEGREE, returns i-th basis field element.
This is the same operation as Self::basis, but it returns an error result instead of
panicking if the index is out of range.
§Throws
Error::ExtensionDegreeMismatchunlessiis in the range [0,Self::DEGREE).
Sourcefn from_bases_sparse(
    base_elems: impl IntoIterator<Item = F>,
    log_stride: usize,
) -> Result<Self, Error>
 
fn from_bases_sparse( base_elems: impl IntoIterator<Item = F>, log_stride: usize, ) -> Result<Self, Error>
A specialized version of from_bases which assumes that only base field
elements with indices dividing 2^log_stride can be nonzero.
base_elems should have length at most ceil(DEGREE / 2^LOG_STRIDE). Note that
ExtensionField::from_bases is a special case of from_bases_sparse with log_stride = 0.
Sourcefn iter_bases(&self) -> impl Iterator<Item = F>
 
fn iter_bases(&self) -> impl Iterator<Item = F>
Iterator over base field elements.
Sourcefn into_iter_bases(self) -> impl Iterator<Item = F>
 
fn into_iter_bases(self) -> impl Iterator<Item = F>
Convert into an iterator over base field elements.
Sourceunsafe fn get_base_unchecked(&self, i: usize) -> F
 
unsafe fn get_base_unchecked(&self, i: usize) -> F
Sourcefn square_transpose(values: &mut [Self]) -> Result<(), Error>
 
fn square_transpose(values: &mut [Self]) -> Result<(), Error>
Transpose square block of subfield elements within values in place.
Provided Methods§
Sourcefn basis(i: usize) -> Self
 
fn basis(i: usize) -> Self
For 0 <= i < DEGREE, returns i-th basis field element.
§Pre-conditions
imust be in the range [0,Self::DEGREE).
Sourcefn from_bases(base_elems: impl IntoIterator<Item = F>) -> Result<Self, Error>
 
fn from_bases(base_elems: impl IntoIterator<Item = F>) -> Result<Self, Error>
Create an extension field element from a slice of base field elements in order
consistent with basis(i) return values.
Potentially faster than taking an inner product with a vector of basis elements.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.