Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Testing gate internal ABI design #156

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions plonk-core/src/config.rs
Original file line number Diff line number Diff line change
@@ -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<Self::Field>;

/// Polynomial Commitment Opening Type
type Opening;

//TODO Complete with all necessary fields
}
5 changes: 4 additions & 1 deletion plonk-core/src/constraint_system/composer.rs
Original file line number Diff line number Diff line change
@@ -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<BaseField = F>,
{
/// 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<Variable>,

/// TODO: Integrate this as just another gate
/// Public lookup table
pub(crate) lookup_table: LookupTable<F>,

@@ -112,6 +114,7 @@ where
/// These are the actual variable values.
pub(crate) variables: HashMap<Variable, F>,

/// TODO: Integrate this as just another gate
/// Permutation argument.
pub(crate) perm: Permutation,

1 change: 1 addition & 0 deletions plonk-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;