ExtElem

Trait ExtElem 

Source
pub trait ExtElem:
    Elem<Output = Self, Output = Self, Output = Self, Output = Self>
    + From<Self::SubElem>
    + Neg
    + PartialEq
    + Eq
    + Add<Self::SubElem>
    + Sub<Self::SubElem>
    + Mul<Self::SubElem>
    + AddAssign<Self::SubElem>
    + SubAssign<Self::SubElem>
    + MulAssign<Self::SubElem> {
    type SubElem: Elem<Output = Self, Output = Self, Output = Self> + Add<Self> + Sub<Self> + Mul<Self>;

    const EXT_SIZE: usize;

    // Required methods
    fn from_subfield(elem: &Self::SubElem) -> Self;
    fn from_subelems(elems: impl IntoIterator<Item = Self::SubElem>) -> Self;
    fn subelems(&self) -> &[Self::SubElem];
}
Expand description

A field extension which can be constructed from a subfield element Elem

Represents an element of an extension field. This extension field is associated with a base field (sometimes called “subfield”) whose element type is given by the generic type parameter.

Required Associated Constants§

Source

const EXT_SIZE: usize

The degree of the field extension

This the degree of the extension field when interpreted as a vector space over the base field. Thus, an ExtElem can be represented as EXT_SIZE SubElems.

Required Associated Types§

Source

type SubElem: Elem<Output = Self, Output = Self, Output = Self> + Add<Self> + Sub<Self> + Mul<Self>

An element of the base field

This type represents an element of the base field (sometimes called “subfield”) of this extension field.

Required Methods§

Source

fn from_subfield(elem: &Self::SubElem) -> Self

Interpret a base field element as an extension field element

Every SubElem is (mathematically) an ExtElem. This constructs the ExtElem equal to the given SubElem.

Source

fn from_subelems(elems: impl IntoIterator<Item = Self::SubElem>) -> Self

Construct an extension field element

Construct an extension field element from a (mathematical) vector of SubElems. This vector is length EXT_SIZE.

Source

fn subelems(&self) -> &[Self::SubElem]

Express an extension field element in terms of base field elements

Returns the (mathematical) vector of SubElems equal to the ExtElem. This vector is length EXT_SIZE.

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.

Implementors§