pub trait ExprOps<F, ChallengeTerm>: Add<Output = Self> + Sub<Output = Self> + Neg<Output = Self> + Mul<Output = Self> + AddAssign<Self> + MulAssign<Self> + Clone + Zero + One + From<u64> + Debug + Displaywhere
    Self: Sized,{
Show 14 methods // Required methods fn two_pow(pow: u64) -> Self; fn two_to_limb() -> Self; fn two_to_2limb() -> Self; fn two_to_3limb() -> Self; fn double(&self) -> Self; fn square(&self) -> Self; fn pow(&self, p: u64) -> Self; fn boolean(&self) -> Self; fn crumb(&self) -> Self; fn literal(x: F) -> Self; fn witness( row: CurrOrNext, col: usize, env: Option<&ArgumentData<F>> ) -> Self; fn coeff(col: usize, env: Option<&ArgumentData<F>>) -> Self; fn constant( expr: ConstantExpr<F, ChallengeTerm>, env: Option<&ArgumentData<F>> ) -> Self; fn cache(&self, cache: &mut Cache) -> Self;
}
Expand description

This trait defines a common arithmetic operations interface that can be used by constraints. It allows us to reuse constraint code for witness computation.

Required Methods§

source

fn two_pow(pow: u64) -> Self

2^pow

source

fn two_to_limb() -> Self

2^{LIMB_BITS}

source

fn two_to_2limb() -> Self

2^{2 * LIMB_BITS}

source

fn two_to_3limb() -> Self

2^{3 * LIMB_BITS}

source

fn double(&self) -> Self

Double the value

source

fn square(&self) -> Self

Compute the square of this value

source

fn pow(&self, p: u64) -> Self

Raise the value to the given power

source

fn boolean(&self) -> Self

Constrain to boolean

source

fn crumb(&self) -> Self

Constrain to crumb (i.e. two bits)

source

fn literal(x: F) -> Self

Create a literal

source

fn witness(row: CurrOrNext, col: usize, env: Option<&ArgumentData<F>>) -> Self

source

fn coeff(col: usize, env: Option<&ArgumentData<F>>) -> Self

Coefficient

source

fn constant( expr: ConstantExpr<F, ChallengeTerm>, env: Option<&ArgumentData<F>> ) -> Self

Create a constant

source

fn cache(&self, cache: &mut Cache) -> Self

Cache item

Implementors§