pub trait ExtensibleField<const N: usize>: StarkField {
// Required methods
fn mul(a: [Self; N], b: [Self; N]) -> [Self; N];
fn mul_base(a: [Self; N], b: Self) -> [Self; N];
fn frobenius(x: [Self; N]) -> [Self; N];
// Provided methods
fn square(a: [Self; N]) -> [Self; N] { ... }
fn is_supported() -> bool { ... }
}
Expand description
Defines basic arithmetic in an extension of a StarkField of a given degree.
This trait defines how to perform multiplication and compute a Frobenius automorphisms of an element in an extension of degree N for a given StarkField. It as assumed that an element in degree N extension field can be represented by N field elements in the base field.
Implementation of this trait implicitly defines the irreducible polynomial over which the extension field is defined.
Required Methods§
Sourcefn mul(a: [Self; N], b: [Self; N]) -> [Self; N]
fn mul(a: [Self; N], b: [Self; N]) -> [Self; N]
Returns a product of a
and b
in the field defined by this extension.
Provided Methods§
Sourcefn square(a: [Self; N]) -> [Self; N]
fn square(a: [Self; N]) -> [Self; N]
Returns the square of a
in the field defined by this extension.
Sourcefn is_supported() -> bool
fn is_supported() -> bool
Returns true if this extension is supported for the underlying base field.
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§
impl ExtensibleField<2> for winter_math::fields::f62::BaseElement
Defines a quadratic extension of the base field over an irreducible polynomial x2 - x - 1. Thus, an extension element is defined as α + β * φ, where φ is a root of this polynomial, and α and β are base field elements.
impl ExtensibleField<2> for winter_math::fields::f64::BaseElement
Defines a quadratic extension of the base field over an irreducible polynomial x2 - x + 2. Thus, an extension element is defined as α + β * φ, where φ is a root of this polynomial, and α and β are base field elements.
impl ExtensibleField<2> for winter_math::fields::f128::BaseElement
Defines a quadratic extension of the base field over an irreducible polynomial x2 - x - 1. Thus, an extension element is defined as α + β * φ, where φ is a root of this polynomial, and α and β are base field elements.
impl ExtensibleField<3> for winter_math::fields::f62::BaseElement
Defines a cubic extension of the base field over an irreducible polynomial x3 + 2x + 2. Thus, an extension element is defined as α + β * φ + γ * φ^2, where φ is a root of this polynomial, and α, β and γ are base field elements.
impl ExtensibleField<3> for winter_math::fields::f64::BaseElement
Defines a cubic extension of the base field over an irreducible polynomial x3 - x - 1. Thus, an extension element is defined as α + β * φ + γ * φ^2, where φ is a root of this polynomial, and α, β and γ are base field elements.
impl ExtensibleField<3> for winter_math::fields::f128::BaseElement
Cubic extension for this field is not implemented as quadratic extension already provides sufficient security level.