pub trait FancyArithmetic: Fancy {
    fn add(
        &mut self,
        x: &Self::Item,
        y: &Self::Item
    ) -> Result<Self::Item, Self::Error>; fn sub(
        &mut self,
        x: &Self::Item,
        y: &Self::Item
    ) -> Result<Self::Item, Self::Error>; fn cmul(&mut self, x: &Self::Item, c: u16) -> Result<Self::Item, Self::Error>; fn mul(
        &mut self,
        x: &Self::Item,
        y: &Self::Item
    ) -> Result<Self::Item, Self::Error>; fn proj(
        &mut self,
        x: &Self::Item,
        q: u16,
        tt: Option<Vec<u16>>
    ) -> Result<Self::Item, Self::Error>; fn add_many(
        &mut self,
        args: &[Self::Item]
    ) -> Result<Self::Item, Self::Error> { ... } fn mod_change(
        &mut self,
        x: &Self::Item,
        to_modulus: u16
    ) -> Result<Self::Item, Self::Error> { ... } }
Expand description

DSL for arithmetic computation.

Required Methods

Add x and y.

Subtract x and y.

Multiply x times the constant c.

Multiply x and y.

Project x according to the truth table tt. Resulting wire has modulus q.

Optional tt is useful for hiding the gate from the evaluator.

Provided Methods

Sum up a slice of wires.

Change the modulus of x to to_modulus using a projection gate.

Implementors