Trait erase::Field[][src]

pub trait Field: Sized {
    type Elem: Default + Clone + Copy + PartialEq + Debug;

    const ORDER: usize;

    fn add(a: Self::Elem, b: Self::Elem) -> Self::Elem;
fn mul(a: Self::Elem, b: Self::Elem) -> Self::Elem;
fn div(a: Self::Elem, b: Self::Elem) -> Self::Elem;
fn exp(a: Self::Elem, n: usize) -> Self::Elem;
fn zero() -> Self::Elem;
fn one() -> Self::Elem;
fn nth(n: usize) -> Self::Elem; fn mul_slice(elem: Self::Elem, input: &[Self::Elem], out: &mut [Self::Elem]) { ... }
fn mul_slice_add(
        elem: Self::Elem,
        input: &[Self::Elem],
        out: &mut [Self::Elem]
    ) { ... } }

A finite field to perform encoding over.

Associated Types

type Elem: Default + Clone + Copy + PartialEq + Debug[src]

The representational type of the field.

Loading content...

Associated Constants

const ORDER: usize[src]

The order of the field. This is a limit on the number of shards in an encoding.

Loading content...

Required methods

fn add(a: Self::Elem, b: Self::Elem) -> Self::Elem[src]

Add two elements together.

fn mul(a: Self::Elem, b: Self::Elem) -> Self::Elem[src]

Multiply two elements together.

fn div(a: Self::Elem, b: Self::Elem) -> Self::Elem[src]

Divide a by b. Panics is b is zero.

fn exp(a: Self::Elem, n: usize) -> Self::Elem[src]

Raise a to the n’th power.

fn zero() -> Self::Elem[src]

The “zero” element or additive identity.

fn one() -> Self::Elem[src]

The “one” element or multiplicative identity.

fn nth(n: usize) -> Self::Elem[src]

Yield the nth element of the field. Panics if n >= ORDER. Assignment is arbitrary but must be unique to n.

Loading content...

Provided methods

fn mul_slice(elem: Self::Elem, input: &[Self::Elem], out: &mut [Self::Elem])[src]

Multiply a slice of elements by another. Writes into the output slice.

Panics

Panics if the output slice does not have equal length to the input.

fn mul_slice_add(elem: Self::Elem, input: &[Self::Elem], out: &mut [Self::Elem])[src]

Multiply a slice of elements by another, adding each result to the corresponding value in out.

Panics

Panics if the output slice does not have equal length to the input.

Loading content...

Implementors

impl Field for erase::galois_8::Field[src]

type Elem = u8

impl Field for erase::galois_16::Field[src]

Loading content...