Skip to main content

ComposableChip

Trait ComposableChip 

Source
pub trait ComposableChip<F>:
    Chip<F>
    + Clone
    + Debug
where F: CircuitField,
{ type SharedResources; type InstructionDeps; // Required methods fn new(config: &Self::Config, sub_chips: &Self::InstructionDeps) -> Self; fn configure( meta: &mut ConstraintSystem<F>, shared_resources: &Self::SharedResources, ) -> Self::Config; fn load(&self, layouter: &mut impl Layouter<F>) -> Result<(), Error>; }
Expand description

Provides a common interface for layering chips with shared resources.

Required Associated Types§

Source

type SharedResources

Resources that can be used by other chips or gadgets, typically sub-chip configurations and columns.

Source

type InstructionDeps

Instruction set dependencies of the chip. This chip will need to be provided with subchips that implement these instructions.

Required Methods§

Source

fn new(config: &Self::Config, sub_chips: &Self::InstructionDeps) -> Self

Initialize the chip.

Source

fn configure( meta: &mut ConstraintSystem<F>, shared_resources: &Self::SharedResources, ) -> Self::Config

Configure the chip. Receives the underlying chips and columns it needs via Self::SharedResources. This method must not allocate any resource in the constraint system that is intended to be shared by other chips.

Source

fn load(&self, layouter: &mut impl Layouter<F>) -> Result<(), Error>

Load all tables (including those of underlying chips taken as configs)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<C: EdwardsCurve> ComposableChip<<C as CircuitCurve>::Base> for EccChip<C>

Source§

impl<F: CircuitField> ComposableChip<F> for Base64Chip<F>

Source§

impl<F: CircuitField> ComposableChip<F> for NativeChip<F>

Source§

impl<F: CircuitField> ComposableChip<F> for P2RDecompositionChip<F>

Source§

impl<F: CircuitField> ComposableChip<F> for RipeMD160Chip<F>

Source§

impl<F: CircuitField> ComposableChip<F> for Sha256Chip<F>

Source§

impl<F: CircuitField> ComposableChip<F> for Sha512Chip<F>

Source§

impl<F: PoseidonField> ComposableChip<F> for PoseidonChip<F>

Source§

impl<F> ComposableChip<F> for ScannerChip<F>
where F: CircuitField + Ord,