Skip to main content

Connect

Trait Connect 

Source
pub trait Connect {
    // Required methods
    fn connect_cell_pair(
        &mut self,
        cell1: (usize, usize),
        cell2: (usize, usize),
    );
    fn connect_64bit(&mut self, zero_row: usize, start_row: usize);
    fn connect_ffadd_range_checks(
        &mut self,
        ffadd_row: usize,
        left_rc: Option<usize>,
        right_rc: Option<usize>,
        out_rc: usize,
    );
}
Expand description

Trait to connect a pair of cells in a circuit

Required Methods§

Source

fn connect_cell_pair(&mut self, cell1: (usize, usize), cell2: (usize, usize))

Connect the pair of cells specified by the cell1 and cell2 parameters cell_pre –> cell_new && cell_new –> wire_tmp

Note: This function assumes that the targeted cells are freshly instantiated with self-connections. If the two cells are transitively already part of the same permutation then this would split it.

Source

fn connect_64bit(&mut self, zero_row: usize, start_row: usize)

Connects a generic gate cell with zeros to a given row for 64bit range check

Source

fn connect_ffadd_range_checks( &mut self, ffadd_row: usize, left_rc: Option<usize>, right_rc: Option<usize>, out_rc: usize, )

Connects the wires of the range checks in a single foreign field addition Inputs:

  • ffadd_row: the row of the foreign field addition gate
  • left_rc: the first row of the range check for the left input
  • right_rc: the first row of the range check for the right input
  • out_rc: the first row of the range check for the output of the addition

Note: If run with left_rc = None and right_rc = None then it can be used for the bound check range check

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<F: PrimeField> Connect for Vec<CircuitGate<F>>

Source§

fn connect_cell_pair( &mut self, cell_pre: (usize, usize), cell_new: (usize, usize), )

Source§

fn connect_64bit(&mut self, zero_row: usize, start_row: usize)

Source§

fn connect_ffadd_range_checks( &mut self, ffadd_row: usize, left_rc: Option<usize>, right_rc: Option<usize>, out_rc: usize, )

Implementors§