fix: use latest names for groth16 traits/types

This commit is contained in:
Georgios Konstantopoulos 2021-08-10 18:09:32 +03:00
parent c03ae8490f
commit c32270a285
5 changed files with 9 additions and 9 deletions

View File

@ -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 }

View File

@ -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)>;

View File

@ -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 @@ use core::ops::Deref;
/// 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>>(

View File

@ -4,7 +4,7 @@
mod witness;
pub mod circom;
pub use circom::{CircomBuilder, CircomCircuit, CircomConfig, R1CStoQAPCircom};
pub use circom::{CircomBuilder, CircomCircuit, CircomConfig, CircomReduction};
pub mod ethereum;

View File

@ -299,7 +299,7 @@ mod tests {
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 @@ mod tests {
let inputs = circom.get_public_inputs().unwrap();
let mut rng = thread_rng();
let proof = prove::<_, _, _, R1CStoQAPCircom>(circom, &params, &mut rng).unwrap();
let proof = prove::<_, _, _, CircomReduction>(circom, &params, &mut rng).unwrap();
let pvk = prepare_verifying_key(&params.vk);