pub trait Circuit<F: Field> {
    type Config: Clone;
    type FloorPlanner: FloorPlanner;

    fn without_witnesses(&self) -> Self;
    fn configure(meta: &mut ConstraintSystem<F>) -> Self::Config;
    fn synthesize(
        &self,
        config: Self::Config,
        layouter: impl Layouter<F>
    ) -> Result<(), Error>; }
Expand description

This is a trait that circuits provide implementations for so that the backend prover can ask the circuit to synthesize using some given ConstraintSystem implementation.

Required Associated Types

This is a configuration object that stores things like columns.

The floor planner used for this circuit. This is an associated type of the Circuit trait because its behaviour is circuit-critical.

Required Methods

Returns a copy of this circuit with no witness values (i.e. all witnesses set to None). For most circuits, this will be equal to Self::default().

The circuit is given an opportunity to describe the exact gate arrangement, column arrangement, etc.

Given the provided cs, synthesize the circuit. The concrete type of the caller will be different depending on the context, and they may or may not expect to have a witness present.

Implementors