binius_field::extension

Trait ExtensionField

source
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> {
    type Iterator: Iterator<Item = F>;

    const LOG_DEGREE: usize;
    const DEGREE: usize = _;

    // Required methods
    fn basis(i: usize) -> Result<Self, Error>;
    fn from_bases_sparse(
        base_elems: &[F],
        log_stride: usize,
    ) -> Result<Self, Error>;
    fn iter_bases(&self) -> Self::Iterator;

    // Provided method
    fn from_bases(base_elems: &[F]) -> Result<Self, Error> { ... }
}

Required Associated Constants§

source

const LOG_DEGREE: usize

Base-2 logarithm of the extension degree.

Provided Associated Constants§

source

const DEGREE: usize = _

Extension degree.

DEGREE is guaranteed to equal 2^LOG_DEGREE.

Required Associated Types§

source

type Iterator: Iterator<Item = F>

Iterator returned by iter_bases.

Required Methods§

source

fn basis(i: usize) -> Result<Self, Error>

For 0 <= i < DEGREE, returns i-th basis field element.

source

fn from_bases_sparse(base_elems: &[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.

source

fn iter_bases(&self) -> Self::Iterator

Iterator over base field elements.

Provided Methods§

source

fn from_bases(base_elems: &[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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl ExtensionField<AESTowerField8b> for AESTowerField16b

source§

impl ExtensionField<AESTowerField8b> for AESTowerField32b

source§

impl ExtensionField<AESTowerField8b> for AESTowerField64b

source§

impl ExtensionField<AESTowerField8b> for AESTowerField128b

source§

impl ExtensionField<AESTowerField16b> for AESTowerField32b

source§

impl ExtensionField<AESTowerField16b> for AESTowerField64b

source§

impl ExtensionField<AESTowerField16b> for AESTowerField128b

source§

impl ExtensionField<AESTowerField32b> for AESTowerField64b

source§

impl ExtensionField<AESTowerField32b> for AESTowerField128b

source§

impl ExtensionField<AESTowerField64b> for AESTowerField128b

source§

impl ExtensionField<BinaryField1b> for AESTowerField8b

source§

impl ExtensionField<BinaryField1b> for AESTowerField16b

source§

impl ExtensionField<BinaryField1b> for AESTowerField32b

source§

impl ExtensionField<BinaryField1b> for AESTowerField64b

source§

impl ExtensionField<BinaryField1b> for AESTowerField128b

source§

impl ExtensionField<BinaryField1b> for BinaryField2b

source§

impl ExtensionField<BinaryField1b> for BinaryField4b

source§

impl ExtensionField<BinaryField1b> for BinaryField8b

source§

impl ExtensionField<BinaryField1b> for BinaryField16b

source§

impl ExtensionField<BinaryField1b> for BinaryField32b

source§

impl ExtensionField<BinaryField1b> for BinaryField64b

source§

impl ExtensionField<BinaryField1b> for BinaryField128b

source§

impl ExtensionField<BinaryField1b> for BinaryField128bPolyval

source§

impl ExtensionField<BinaryField2b> for BinaryField4b

source§

impl ExtensionField<BinaryField2b> for BinaryField8b

source§

impl ExtensionField<BinaryField2b> for BinaryField16b

source§

impl ExtensionField<BinaryField2b> for BinaryField32b

source§

impl ExtensionField<BinaryField2b> for BinaryField64b

source§

impl ExtensionField<BinaryField2b> for BinaryField128b

source§

impl ExtensionField<BinaryField4b> for BinaryField8b

source§

impl ExtensionField<BinaryField4b> for BinaryField16b

source§

impl ExtensionField<BinaryField4b> for BinaryField32b

source§

impl ExtensionField<BinaryField4b> for BinaryField64b

source§

impl ExtensionField<BinaryField4b> for BinaryField128b

source§

impl ExtensionField<BinaryField8b> for BinaryField16b

source§

impl ExtensionField<BinaryField8b> for BinaryField32b

source§

impl ExtensionField<BinaryField8b> for BinaryField64b

source§

impl ExtensionField<BinaryField8b> for BinaryField128b

source§

impl ExtensionField<BinaryField16b> for BinaryField32b

source§

impl ExtensionField<BinaryField16b> for BinaryField64b

source§

impl ExtensionField<BinaryField16b> for BinaryField128b

source§

impl ExtensionField<BinaryField32b> for BinaryField64b

source§

impl ExtensionField<BinaryField32b> for BinaryField128b

source§

impl ExtensionField<BinaryField64b> for BinaryField128b

source§

impl<F: Field> ExtensionField<F> for F