Skip to main content

Fancy

Trait Fancy 

Source
pub trait Fancy {
    type Item: Clone + Debug + HasModulus;

    // Required method
    fn constant(
        &mut self,
        x: u16,
        q: u16,
        channel: &mut Channel<'_>,
    ) -> Result<Self::Item>;
}
Expand description

The Fancy trait is the core trait for writing circuits.

The trait contains an associated type, Fancy::Item, which defines the underlying wire representation, alongside a Fancy::constant method for creating constant (public) wires.

This trait can be further extended to support binary, arithmetic, and/or projections by using the FancyBinary, FancyArithmetic, or FancyProj extension traits, respectively. The FancyEncode trait allows for encoding values into wires, and the FancyOutput trait allows for converting wires into their underlying plaintext representation.

Required Associated Types§

Source

type Item: Clone + Debug + HasModulus

The underlying wire representation of this Fancy object.

Required Methods§

Source

fn constant( &mut self, x: u16, q: u16, channel: &mut Channel<'_>, ) -> Result<Self::Item>

Encode a constant x with modulus q.

Implementors§