message: [15-wires] added poseidon gadget
diff: @@ -43,6 +43,51 @@ impl<F: FftField> CircuitGate<F> {
  }
  }
  + /// `create_poseidon_gadget(row, first_and_last_row, round_constants)` creates an entire set of constraint for a Poseidon hash.
  + /// For that, you need to pass:
  + /// - the index of the first `row`
  + /// - the first and last rows' wires (because they are used in the permutation)
  + /// - the round constants
  + /// The function returns a set of gates, as well as the next pointer to the circuit (next empty absolute row)
  + pub fn create_poseidon_gadget(
  + // the absolute row in the circuit
  + row: usize,
  + // first and last row of the poseidon circuit (because they are used in the permutation)
  + first_and_last_row: [GateWires; 2],
  + round_constants: &Vec<Vec<F>>,
  + ) -> (Vec<Self>, usize) {
  + let mut gates = vec![];
  +
  + // create the gates
  + let relative_rows = 0..POS_ROWS_PER_HASH;
  + let last_row = row + POS_ROWS_PER_HASH;
  + let absolute_rows = row..last_row;
  +
  + for (abs_row, rel_row) in absolute_rows.zip(relative_rows) {
  + // the 15 wires for this row
  + let wires = if rel_row == 0 {
  + first_and_last_row[0]
  + } else {
  + array_init(|col| Wire { col, row: abs_row })
  + };
  +
  + // round constant for this row
  + let coeffs = array_init(|offset| {
  + let round = rel_row * ROUNDS_PER_ROW + offset + 1;
  + array_init(|field_el| round_constants[round][field_el])
  + });
  +
  + // create poseidon gate for this row
  + gates.push(CircuitGate::create_poseidon(abs_row, wires, coeffs));
  + }
  +
  + // final (zero) gate that contains the output of poseidon
  + gates.push(CircuitGate::zero(last_row, first_and_last_row[1]));
  +
  + //
  + (gates, last_row)
  + }
  +
  pub fn verify_poseidon(&self, witness: &[Vec<F>; COLUMNS], cs: &ConstraintSystem<F>) -> bool {
  // TODO: Needs to be fixed
  