Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

Commit

Permalink
width3 naive main gate
Browse files Browse the repository at this point in the history
  • Loading branch information
saitima committed Aug 1, 2024
1 parent e01e5fa commit 47e34c6
Show file tree
Hide file tree
Showing 4 changed files with 764 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/plonk/better_better_cs/cs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,16 @@ pub trait ConstraintSystem<E: Engine> {
fn get_current_aux_gate_number(&self) -> usize;
}

#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub struct PlonkCsWidth3Params;
impl<E: Engine> PlonkConstraintSystemParams<E> for PlonkCsWidth3Params {
const STATE_WIDTH: usize = 3;
const WITNESS_WIDTH: usize = 0;
const HAS_WITNESS_POLYNOMIALS: bool = false;
const HAS_CUSTOM_GATES: bool = false;
const CAN_ACCESS_NEXT_TRACE_STEP: bool = false;
}

#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub struct PlonkCsWidth4WithNextStepParams;
impl<E: Engine> PlonkConstraintSystemParams<E> for PlonkCsWidth4WithNextStepParams {
Expand Down Expand Up @@ -2093,7 +2103,7 @@ impl_assembly!{
non_residues.push(E::Fr::one());
non_residues.extend(make_non_residues::<E::Fr>(P::STATE_WIDTH - 1));

assert_eq!(non_residues.len(), 4);
assert_eq!(non_residues.len(), P::STATE_WIDTH);

let mut sigmas = vec![];
for i in 0..P::STATE_WIDTH {
Expand Down
3 changes: 2 additions & 1 deletion src/plonk/better_better_cs/gates/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ use crate::plonk::better_cs::utils::*;
use crate::plonk::fft::cooley_tukey_ntt::*;

pub mod selector_optimized_with_d_next;
pub mod main_gate_with_d_next;
pub mod main_gate_with_d_next;
pub mod naive_main_gate;
Loading

0 comments on commit 47e34c6

Please sign in to comment.