Skip to main content

Field

Trait Field 

Source
pub trait Field:
    Copy
    + Eq
    + Debug {
    const MULTILINEAR: bool;

    // Required methods
    fn zero() -> Self;
    fn one() -> Self;
    fn add(self, o: Self) -> Self;
    fn sub(self, o: Self) -> Self;
    fn mul(self, o: Self) -> Self;
    fn inv(self) -> Self;

    // Provided method
    fn is_zero(self) -> bool { ... }
}
Expand description

A finite field small enough to enumerate — the arithmetic XL runs its linear algebra over.

Required Associated Constants§

Source

const MULTILINEAR: bool

Whether the polynomial ring is multilinear (x² = x). True for GF(2), where we impose the field equations; false for GF(256), where quadratics are genuine.

Required Methods§

Source

fn zero() -> Self

Source

fn one() -> Self

Source

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

Source

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

Source

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

Source

fn inv(self) -> Self

Multiplicative inverse; caller guarantees self is non-zero.

Provided Methods§

Source

fn is_zero(self) -> bool

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§