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..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::{ - ConstraintSynthesizer, ConstraintSystemRef, LinearCombination, Namespace, SynthesisError, + ConstraintGenerator, ConstraintSystemRef, LinearCombination, Namespace, SynthesisError, + R1CS, }, }; use ark_snark::{CircuitSpecificSetupSNARK, UniversalSetupSNARK, SNARK}; @@ -22,8 +23,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 +97,7 @@ pub trait SNARKGadget> { pub trait CircuitSpecificSetupSNARKGadget< F: PrimeField, ConstraintF: PrimeField, - S: CircuitSpecificSetupSNARK, + S: CircuitSpecificSetupSNARK>, >: SNARKGadget { } @@ -104,10 +105,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