fix: use latest names for groth16 traits/types
Georgios Konstantopoulos me@gakonst.com
Tue, 10 Aug 2021 18:09:32 +0300
5 files changed,
9 insertions(+),
9 deletions(-)
M
Cargo.toml
→
Cargo.toml
@@ -15,7 +15,7 @@ ark-ec = { version = "0.3.0", default-features = false }
ark-ff = { version = "0.3.0", default-features = false } ark-std = { version = "0.3.0", default-features = false } ark-bn254 = { version = "0.3.0" } -ark-groth16 = { git = "https://github.com/kobigurk/groth16", version = "0.3.0", branch = "feat/customizable-r1cs-to-qap" } +ark-groth16 = { git = "https://github.com/gakonst/groth16", version = "0.3.0", branch = "feat/customizable-r1cs-to-qap" } ark-poly = { version = "^0.3.0", default-features = false } ark-relations = { version = "0.3.0", default-features = false } ark-serialize = { version = "0.3.0", default-features = false }
M
src/circom/mod.rs
→
src/circom/mod.rs
@@ -10,7 +10,7 @@ mod builder;
pub use builder::{CircomBuilder, CircomConfig}; mod qap; -pub use qap::R1CStoQAPCircom; +pub use qap::CircomReduction; pub type Constraints<E> = (ConstraintVec<E>, ConstraintVec<E>, ConstraintVec<E>); pub type ConstraintVec<E> = Vec<(usize, <E as PairingEngine>::Fr)>;
M
src/circom/qap.rs
→
src/circom/qap.rs
@@ -1,5 +1,5 @@
use ark_ff::PrimeField; -use ark_groth16::r1cs_to_qap::{evaluate_constraint, QAPCalculator, R1CStoQAP}; +use ark_groth16::r1cs_to_qap::{evaluate_constraint, LibsnarkReduction, R1CStoQAP}; use ark_poly::EvaluationDomain; use ark_relations::r1cs::{ConstraintSystemRef, SynthesisError}; use ark_std::{cfg_into_iter, cfg_iter, cfg_iter_mut, vec};@@ -10,15 +10,15 @@ /// coefficients of H through computing (AB-C)/Z in the evaluation domain and going back to the
/// coefficients domain. snarkjs instead precomputes the Lagrange form of the powers of tau bases /// in a domain twice as large and the witness map is computed as the odd coefficients of (AB-C) /// in that domain. This serves as HZ when computing the C proof element. -pub struct R1CStoQAPCircom; +pub struct CircomReduction; -impl QAPCalculator for R1CStoQAPCircom { +impl R1CStoQAP for CircomReduction { #[allow(clippy::type_complexity)] fn instance_map_with_evaluation<F: PrimeField, D: EvaluationDomain<F>>( cs: ConstraintSystemRef<F>, t: &F, ) -> Result<(Vec<F>, Vec<F>, Vec<F>, F, usize, usize), SynthesisError> { - R1CStoQAP::instance_map_with_evaluation::<F, D>(cs, t) + LibsnarkReduction::instance_map_with_evaluation::<F, D>(cs, t) } fn witness_map<F: PrimeField, D: EvaluationDomain<F>>(
M
src/lib.rs
→
src/lib.rs
@@ -4,7 +4,7 @@ //! Provides bindings to Circom's R1CS, for Groth16 Proof and Witness generation in Rust.
mod witness; pub mod circom; -pub use circom::{CircomBuilder, CircomCircuit, CircomConfig, R1CStoQAPCircom}; +pub use circom::{CircomBuilder, CircomCircuit, CircomConfig, CircomReduction}; pub mod ethereum;
M
src/zkey.rs
→
src/zkey.rs
@@ -299,7 +299,7 @@ use num_bigint::BigUint;
use serde_json::Value; use std::fs::File; - use crate::{circom::R1CStoQAPCircom, CircomBuilder, CircomConfig}; + use crate::{circom::CircomReduction, CircomBuilder, CircomConfig}; use ark_groth16::{create_random_proof_with_qap as prove, prepare_verifying_key, verify_proof}; use ark_std::rand::thread_rng; use num_traits::{One, Zero};@@ -783,7 +783,7 @@
let inputs = circom.get_public_inputs().unwrap(); let mut rng = thread_rng(); - let proof = prove::<_, _, _, R1CStoQAPCircom>(circom, ¶ms, &mut rng).unwrap(); + let proof = prove::<_, _, _, CircomReduction>(circom, ¶ms, &mut rng).unwrap(); let pvk = prepare_verifying_key(¶ms.vk);