Skip to content

Commit

Permalink
chore: switch benches to hzkg/bn254
Browse files Browse the repository at this point in the history
  • Loading branch information
huitseeker committed Feb 14, 2024
1 parent 4cc09c8 commit e53708a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 19 deletions.
6 changes: 3 additions & 3 deletions benches/common/supernova/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::common::supernova::{
};
use crate::common::{noise_threshold_env, BenchParams};
use arecibo::{
provider::{PallasEngine, VestaEngine},
provider::{Bn256EngineKZG, GrumpkinEngine},
supernova::NonUniformCircuit,
supernova::{snark::CompressedSNARK, PublicParams, RecursiveSNARK},
traits::{
Expand Down Expand Up @@ -145,8 +145,8 @@ pub fn bench_snark_internal_with_arity<
assert!(black_box(&mut recursive_snark.clone())
.verify(
black_box(&pp),
black_box(&[<PallasEngine as Engine>::Scalar::from(2u64)]),
black_box(&[<VestaEngine as Engine>::Scalar::from(2u64)]),
black_box(&[<Bn256EngineKZG as Engine>::Scalar::from(2u64)]),
black_box(&[<GrumpkinEngine as Engine>::Scalar::from(2u64)]),
)
.is_ok());
})
Expand Down
7 changes: 4 additions & 3 deletions benches/common/supernova/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ use arecibo::{
use bellpepper_core::{num::AllocatedNum, ConstraintSystem, SynthesisError};
use core::marker::PhantomData;
use ff::PrimeField;
use halo2curves::bn256::Bn256;

pub type E1 = arecibo::provider::PallasEngine;
pub type E2 = arecibo::provider::VestaEngine;
pub type EE1 = arecibo::provider::ipa_pc::EvaluationEngine<E1>;
pub type E1 = arecibo::provider::Bn256EngineKZG;
pub type E2 = arecibo::provider::GrumpkinEngine;
pub type EE1 = arecibo::provider::hyperkzg::EvaluationEngine<Bn256, E1>;
pub type EE2 = arecibo::provider::ipa_pc::EvaluationEngine<E2>;
// SNARKs without computation commitments
pub type S1 = arecibo::spartan::batched::BatchedRelaxedR1CSSNARK<E1, EE1>;
Expand Down
9 changes: 5 additions & 4 deletions benches/compressed-snark.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![allow(non_snake_case)]
use arecibo::{
provider::{PallasEngine, VestaEngine},
provider::{Bn256EngineKZG, GrumpkinEngine},
traits::{
circuit::{StepCircuit, TrivialCircuit},
snark::RelaxedR1CSSNARKTrait,
Expand All @@ -12,14 +12,15 @@ use bellpepper_core::{num::AllocatedNum, ConstraintSystem, SynthesisError};
use core::marker::PhantomData;
use criterion::{measurement::WallTime, *};
use ff::PrimeField;
use halo2curves::bn256::Bn256;
use std::time::Duration;

mod common;
use common::{noise_threshold_env, BenchParams};

type E1 = PallasEngine;
type E2 = VestaEngine;
type EE1 = arecibo::provider::ipa_pc::EvaluationEngine<E1>;
type E1 = Bn256EngineKZG;
type E2 = GrumpkinEngine;
type EE1 = arecibo::provider::hyperkzg::EvaluationEngine<Bn256, E1>;
type EE2 = arecibo::provider::ipa_pc::EvaluationEngine<E2>;
// SNARKs without computation commitmnets
type S1 = arecibo::spartan::snark::RelaxedR1CSSNARK<E1, EE1>;
Expand Down
6 changes: 3 additions & 3 deletions benches/compute-digest.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{marker::PhantomData, time::Duration};

use arecibo::{
provider::{PallasEngine, VestaEngine},
provider::{Bn256EngineKZG, GrumpkinEngine},
traits::{
circuit::{StepCircuit, TrivialCircuit},
snark::default_ck_hint,
Expand All @@ -13,8 +13,8 @@ use bellpepper_core::{num::AllocatedNum, ConstraintSystem, SynthesisError};
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use ff::PrimeField;

type E1 = PallasEngine;
type E2 = VestaEngine;
type E1 = Bn256EngineKZG;
type E2 = GrumpkinEngine;
type C1 = NonTrivialCircuit<<E1 as Engine>::Scalar>;
type C2 = TrivialCircuit<<E2 as Engine>::Scalar>;

Expand Down
6 changes: 3 additions & 3 deletions benches/recursive-snark.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![allow(non_snake_case)]
use arecibo::{
provider::{PallasEngine, VestaEngine},
provider::{Bn256EngineKZG, GrumpkinEngine},
traits::{
circuit::{StepCircuit, TrivialCircuit},
snark::default_ck_hint,
Expand All @@ -17,8 +17,8 @@ use std::time::Duration;
mod common;
use common::{noise_threshold_env, BenchParams};

type E1 = PallasEngine;
type E2 = VestaEngine;
type E1 = Bn256EngineKZG;
type E2 = GrumpkinEngine;

// To run these benchmarks, first download `criterion` with `cargo install cargo-criterion`.
// Then `cargo criterion --bench recursive-snark`. The results are located in `target/criterion/data/<name-of-benchmark>`.
Expand Down
6 changes: 3 additions & 3 deletions benches/sha256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! It also uses code from bellman/bellperson to compare circuit-generated digest with sha2 crate's output
#![allow(non_snake_case)]
use arecibo::{
provider::{PallasEngine, VestaEngine},
provider::{Bn256EngineKZG, GrumpkinEngine},
traits::{
circuit::{StepCircuit, TrivialCircuit},
snark::default_ck_hint,
Expand All @@ -24,8 +24,8 @@ use criterion::*;
use ff::{PrimeField, PrimeFieldBits};
use sha2::{Digest, Sha256};

type E1 = PallasEngine;
type E2 = VestaEngine;
type E1 = Bn256EngineKZG;
type E2 = GrumpkinEngine;

#[derive(Clone, Debug)]
struct Sha256Circuit<Scalar: PrimeField> {
Expand Down

0 comments on commit e53708a

Please sign in to comment.