diff --git a/src/dev.rs b/src/dev.rs index 2c49fcc..0fe103d 100644 --- a/src/dev.rs +++ b/src/dev.rs @@ -5,12 +5,8 @@ use ff::Field; use crate::{ arithmetic::{FieldExt, Group}, plonk::{permutation, Any, Assignment, Circuit, Column, ConstraintSystem, Error}, - poly::{EvaluationDomain, LagrangeCoeff, Polynomial}, }; -#[derive(Debug)] -struct Cell(usize, usize); - /// The reasons why a particular circuit is not satisfied. #[derive(Debug, PartialEq)] pub enum VerifyFailure { @@ -131,15 +127,14 @@ pub enum VerifyFailure { #[derive(Debug)] pub struct MockProver { n: u32, - domain: EvaluationDomain, cs: ConstraintSystem, // The fixed cells in the circuit, arranged as [column][row]. - fixed: Vec>, + fixed: Vec>, // The advice cells in the circuit, arranged as [column][row]. - advice: Vec>, + advice: Vec>, // The aux cells in the circuit, arranged as [column][row]. - aux: Vec>, + aux: Vec>, permutations: Vec, } @@ -198,32 +193,15 @@ impl MockProver { pub fn run>( k: u32, circuit: &ConcreteCircuit, - aux: Vec>, + aux: Vec>, ) -> Result { let n = 1 << k; let mut cs = ConstraintSystem::default(); let config = ConcreteCircuit::configure(&mut cs); - // The permutation argument will serve alongside the gates, so must be - // accounted for. - let mut degree = cs - .permutations - .iter() - .map(|p| p.required_degree()) - .max() - .unwrap_or(1); - - // Account for each gate to ensure our quotient polynomial is the - // correct degree and that our extended domain is the right size. - for poly in cs.gates.iter() { - degree = std::cmp::max(degree, poly.degree()); - } - - let domain = EvaluationDomain::new(degree as u32, k); - - let fixed = vec![domain.empty_lagrange(); cs.num_fixed_columns]; - let advice = vec![domain.empty_lagrange(); cs.num_advice_columns]; + let fixed = vec![vec![F::zero(); n as usize]; cs.num_fixed_columns]; + let advice = vec![vec![F::zero(); n as usize]; cs.num_advice_columns]; let permutations = cs .permutations .iter() @@ -232,7 +210,6 @@ impl MockProver { let mut prover = MockProver { n, - domain, cs, fixed, advice, @@ -336,8 +313,6 @@ impl MockProver { } } - // TODO: Implement the rest of the verification checks. - Ok(()) } } diff --git a/src/plonk.rs b/src/plonk.rs index 257eb20..e5e0c19 100644 --- a/src/plonk.rs +++ b/src/plonk.rs @@ -464,7 +464,7 @@ fn test_proving() { .to_affine(); // Check this circuit is satisfied. - let prover = match MockProver::run(K, &circuit, vec![pubinputs.clone()]) { + let prover = match MockProver::run(K, &circuit, vec![pubinputs.to_vec()]) { Ok(prover) => prover, Err(e) => panic!("{:?}", e), };