Skip to main content

BinomiallyExtendableAlgebra

Trait BinomiallyExtendableAlgebra 

Source
pub trait BinomiallyExtendableAlgebra<F, const D: usize>: Algebra<F>
where F: Field,
{ // Provided methods fn binomial_mul(a: &[Self; D], b: &[Self; D], res: &mut [Self; D], w: F) { ... } fn binomial_add(a: &[Self; D], b: &[Self; D]) -> [Self; D] { ... } fn binomial_sub(a: &[Self; D], b: &[Self; D]) -> [Self; D] { ... } fn binomial_base_mul(lhs: [Self; D], rhs: Self) -> [Self; D] { ... } }
Expand description

Trait for algebras which support binomial extensions of the form A[X]/(X^D - W) with W in the base field F.

Provided Methods§

Source

fn binomial_mul(a: &[Self; D], b: &[Self; D], res: &mut [Self; D], w: F)

Multiplication in the algebra extension ring A<X> / (X^D - W).

Some algebras may want to reimplement this with faster methods.

Source

fn binomial_add(a: &[Self; D], b: &[Self; D]) -> [Self; D]

Addition of elements in the algebra extension ring A<X> / (X^D - W).

As addition has no dependence on W so this is equivalent to an algorithm for adding arrays of elements of A.

Some algebras may want to reimplement this with faster methods.

Source

fn binomial_sub(a: &[Self; D], b: &[Self; D]) -> [Self; D]

Subtraction of elements in the algebra extension ring A<X> / (X^D - W).

As subtraction has no dependence on W so this is equivalent to an algorithm for subtracting arrays of elements of A.

Some algebras may want to reimplement this with faster methods.

Source

fn binomial_base_mul(lhs: [Self; D], rhs: Self) -> [Self; D]

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.

Implementations on Foreign Types§

Source§

impl BinomiallyExtendableAlgebra<Goldilocks, 2> for Goldilocks

Source§

impl BinomiallyExtendableAlgebra<Goldilocks, 5> for Goldilocks

Source§

impl<const WIDTH: usize, FP> BinomiallyExtendableAlgebra<MontyField31<FP>, WIDTH> for MontyField31<FP>

Source§

fn binomial_mul( a: &[MontyField31<FP>; WIDTH], b: &[MontyField31<FP>; WIDTH], res: &mut [MontyField31<FP>; WIDTH], _w: MontyField31<FP>, )

Source§

fn binomial_add( a: &[MontyField31<FP>; WIDTH], b: &[MontyField31<FP>; WIDTH], ) -> [MontyField31<FP>; WIDTH]

Source§

fn binomial_sub( a: &[MontyField31<FP>; WIDTH], b: &[MontyField31<FP>; WIDTH], ) -> [MontyField31<FP>; WIDTH]

Source§

fn binomial_base_mul( lhs: [MontyField31<FP>; WIDTH], rhs: MontyField31<FP>, ) -> [MontyField31<FP>; WIDTH]

Implementors§