Skip to content

Commit

Permalink
feat: wrap g16 api (0xEigenLabs#145)
Browse files Browse the repository at this point in the history
* chore: change curve naming to uppercase format (0xEigenLabs#142)

* feat: move api from zkit to g16
---------

Co-authored-by: ibmp33 <[email protected]>
  • Loading branch information
eigmax and ibmp33 authored Oct 28, 2023
1 parent fa36961 commit b998be6
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
18 changes: 9 additions & 9 deletions zkit/src/groth16_api.rs → groth16/src/api.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
use algebraic::{
bellman_ce::Engine,
circom_circuit::CircomCircuit,
errors::{EigenError, Result},
reader::load_r1cs,
witness::{load_input_for_witness, WitnessCalculator},
Field, PrimeField,
};
use groth16::{
use crate::{
bellman_ce::{
groth16::{Parameters, Proof, VerifyingKey},
pairing::{
Expand All @@ -17,6 +9,14 @@ use groth16::{
groth16::Groth16,
json_utils::*,
};
use algebraic::{
bellman_ce::Engine,
circom_circuit::CircomCircuit,
errors::{EigenError, Result},
reader::load_r1cs,
witness::{load_input_for_witness, WitnessCalculator},
Field, PrimeField,
};
use num_traits::Zero;
use rand;

Expand Down
1 change: 1 addition & 0 deletions groth16/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pub mod api;
pub mod groth16;
pub mod json_utils;

Expand Down
2 changes: 1 addition & 1 deletion test/recursive_proof_to_snark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ if [ "$GENERATE_PROOF_TYPE" = "stark" ]; then
../target/release/eigen-zkit stark_prove -s ../starky/data/c12.starkStruct.json \
-p $WORKSPACE/$C12_VERIFIER.pil.json \
--o $WORKSPACE/$C12_VERIFIER.const \
--m $WORKSPACE/$C12_VERIFIER.cm -c $WORKSPACE/circuits/$RECURSIVE1_VERIFIER.circom --i $WORKSPACE/aggregation/$RECURSIVE1_VERIFIER/input.zkin.json --norm_stage
--m $WORKSPACE/$C12_VERIFIER.cm -c $WORKSPACE/circuits/$RECURSIVE1_VERIFIER.circom --i $WORKSPACE/aggregation/$RECURSIVE1_VERIFIER/input.zkin.json --norm_stage --agg_stage

else
echo "Generate snark proof"
Expand Down
1 change: 0 additions & 1 deletion zkit/src/lib.rs

This file was deleted.

6 changes: 3 additions & 3 deletions zkit/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extern crate clap;
use clap::{command, Parser};
use dsl_compile::circom_compiler;
use eigen_zkit::groth16_api::*;
use groth16::api::*;
use plonky::api::{
aggregation_check, aggregation_prove, aggregation_verify, analyse, calculate_witness,
export_aggregation_verification_key, export_verification_key, generate_aggregation_verifier,
Expand Down Expand Up @@ -297,7 +297,7 @@ pub struct Groth16ProveOpt {
#[arg(long = "r1cs", required = true)]
circuit_file: String,
#[arg(short, required = true)]
wtns_file: String,
wasm_file: String,
#[arg(short, required = true, default_value = "g16.zkey")]
pk_file: String,
#[arg(short, required = true)]
Expand Down Expand Up @@ -484,7 +484,7 @@ fn main() {
Command::Groth16Prove(args) => groth16_prove(
&args.curve_type,
&args.circuit_file,
&args.wtns_file,
&args.wasm_file,
&args.pk_file,
&args.input_file,
&args.public_input_file,
Expand Down

0 comments on commit b998be6

Please sign in to comment.