From 8f090b90b88406589fe53b51a6d5851e1f6f5532 Mon Sep 17 00:00:00 2001 From: Pratyush Mishra Date: Fri, 23 Apr 2021 12:19:53 -0700 Subject: [PATCH 1/2] Update to new relations --- Cargo.toml | 4 ++++ src/snark/constraints.rs | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 72d4844c..8fc8c1d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,3 +44,7 @@ ark-ed-on-bls12-381 = { version = "^0.2.0", default-features = false, features = ark-bls12-377 = { version = "^0.2.0", default-features = false, features = [ "curve", "r1cs" ] } ark-mnt4-298 = { version = "^0.2.0", default-features = false, features = [ "curve", "r1cs" ] } ark-mnt6-298 = { version = "^0.2.0", default-features = false, features = [ "r1cs" ] } + +[patch.crates-io] +ark-relations = { git = "https://github.com/arkworks-rs/snark", branch = "relations", default-features = false } +ark-snark = { git = "https://github.com/arkworks-rs/snark", branch = "relations", default-features = false } diff --git a/src/snark/constraints.rs b/src/snark/constraints.rs index 05a76b2a..b2657c3f 100644 --- a/src/snark/constraints.rs +++ b/src/snark/constraints.rs @@ -11,7 +11,7 @@ use ark_relations::r1cs::OptimizationGoal; use ark_relations::{ lc, ns, r1cs::{ - ConstraintSynthesizer, ConstraintSystemRef, LinearCombination, Namespace, SynthesisError, + R1CS, ConstraintGenerator, ConstraintSystemRef, LinearCombination, Namespace, SynthesisError, }, }; use ark_snark::{CircuitSpecificSetupSNARK, UniversalSetupSNARK, SNARK}; @@ -22,8 +22,8 @@ use ark_std::{ vec::{IntoIter, Vec}, }; -/// This implements constraints for SNARK verifiers. -pub trait SNARKGadget> { +/// This implements constraints for R1CS SNARK verifiers. +pub trait SNARKGadget>> { type ProcessedVerifyingKeyVar: AllocVar + Clone; type VerifyingKeyVar: AllocVar + ToBytesGadget @@ -96,7 +96,7 @@ pub trait SNARKGadget> { pub trait CircuitSpecificSetupSNARKGadget< F: PrimeField, ConstraintF: PrimeField, - S: CircuitSpecificSetupSNARK, + S: CircuitSpecificSetupSNARK>, >: SNARKGadget { } @@ -104,10 +104,10 @@ pub trait CircuitSpecificSetupSNARKGadget< pub trait UniversalSetupSNARKGadget< F: PrimeField, ConstraintF: PrimeField, - S: UniversalSetupSNARK, + S: UniversalSetupSNARK>, >: SNARKGadget { - type BoundCircuit: From + ConstraintSynthesizer + Clone; + type BoundCircuit: From + ConstraintGenerator + Clone; } /// Gadgets to convert elements between different fields for recursive proofs From ade0df74e13a7a543d9ae173f4e1010be4dd2925 Mon Sep 17 00:00:00 2001 From: Pratyush Mishra Date: Fri, 23 Apr 2021 12:24:36 -0700 Subject: [PATCH 2/2] Format --- src/snark/constraints.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/snark/constraints.rs b/src/snark/constraints.rs index b2657c3f..eb88f063 100644 --- a/src/snark/constraints.rs +++ b/src/snark/constraints.rs @@ -11,7 +11,8 @@ use ark_relations::r1cs::OptimizationGoal; use ark_relations::{ lc, ns, r1cs::{ - R1CS, ConstraintGenerator, ConstraintSystemRef, LinearCombination, Namespace, SynthesisError, + ConstraintGenerator, ConstraintSystemRef, LinearCombination, Namespace, SynthesisError, + R1CS, }, }; use ark_snark::{CircuitSpecificSetupSNARK, UniversalSetupSNARK, SNARK};