From af44c31ba135ee661ef56a577339d4b379fb96a8 Mon Sep 17 00:00:00 2001 From: David Nevado Date: Fri, 17 Jun 2022 12:26:16 +0200 Subject: [PATCH] tmp --- plonk-core/src/config.rs | 20 ++++++++++++++++++++ plonk-core/src/constraint_system/composer.rs | 5 ++++- plonk-core/src/lib.rs | 1 + 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 plonk-core/src/config.rs diff --git a/plonk-core/src/config.rs b/plonk-core/src/config.rs new file mode 100644 index 00000000..7042a87f --- /dev/null +++ b/plonk-core/src/config.rs @@ -0,0 +1,20 @@ +use crate::commitment::HomomorphicCommitment; + +trait Configuration { + /// Total Number of Wires Accessible to the Compiler + const WIRE_COUNT: usize; + + /// Scalar Field Type + /// + /// This type represents the underlying coefficient field for polynomial + /// constraints. + type Field: ark_ff::PrimeField; + + /// Polynomial Commitment Scheme Type + type PolynomialCommitment: HomomorphicCommitment; + + /// Polynomial Commitment Opening Type + type Opening; + + //TODO Complete with all necessary fields +} diff --git a/plonk-core/src/constraint_system/composer.rs b/plonk-core/src/constraint_system/composer.rs index 811d1f46..8553c86c 100644 --- a/plonk-core/src/constraint_system/composer.rs +++ b/plonk-core/src/constraint_system/composer.rs @@ -25,6 +25,7 @@ use core::marker::PhantomData; use hashbrown::HashMap; use rand_core::{CryptoRng, RngCore}; +// TODO Rewrite this comment /// The StandardComposer is the circuit-builder tool that the `plonk` repository /// provides to create, stored and transformed circuit descriptions /// into a [`Proof`](crate::proof_system::Proof) at some point. @@ -57,7 +58,7 @@ where F: PrimeField, P: ModelParameters, { - /// Number of arithmetic gates in the circuit + /// Number of arithmetic gates the circuit pub(crate) n: usize, // Selector vectors @@ -100,6 +101,7 @@ where /// Fourth wire witness vector. pub(crate) w_4: Vec, + /// TODO: Integrate this as just another gate /// Public lookup table pub(crate) lookup_table: LookupTable, @@ -112,6 +114,7 @@ where /// These are the actual variable values. pub(crate) variables: HashMap, + /// TODO: Integrate this as just another gate /// Permutation argument. pub(crate) perm: Permutation, diff --git a/plonk-core/src/lib.rs b/plonk-core/src/lib.rs index 0f9915a7..90b79e08 100644 --- a/plonk-core/src/lib.rs +++ b/plonk-core/src/lib.rs @@ -41,6 +41,7 @@ mod util; pub mod circuit; pub mod commitment; +pub mod config; pub mod constraint_system; pub mod error; pub mod lookup;