pub trait Fancy {
    type Item: Clone + HasModulus;
    type Error: Debug + Display + From<FancyError>;

    fn constant(&mut self, x: u16, q: u16) -> Result<Self::Item, Self::Error>;
    fn output(&mut self, x: &Self::Item) -> Result<Option<u16>, Self::Error>;

    fn outputs(
        &mut self,
        xs: &[Self::Item]
    ) -> Result<Option<Vec<u16>>, Self::Error> { ... } }
Expand description

DSL for the basic computations supported by fancy-garbling.

Primarily used as a supertrait for FancyBinary and FancyArithmetic, which indicate computation supported by the DSL.

Required Associated Types

The underlying wire datatype created by an object implementing Fancy.

Errors which may be thrown by the users of Fancy.

Required Methods

Create a constant x with modulus q.

Process this wire as output. Some Fancy implementers don’t actually return output, but they need to be involved in the process, so they can return None.

Provided Methods

Output a slice of wires.

Implementors