Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into 465-round-to-phase
Browse files Browse the repository at this point in the history
  • Loading branch information
aakoshh committed Jun 12, 2024
2 parents 1dbe86b + 21deed0 commit 68ab009
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 611 deletions.
20 changes: 1 addition & 19 deletions node/libs/crypto/benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,6 @@ use criterion::{criterion_group, criterion_main, Criterion};
use rand::Rng;
use std::iter::repeat_with;

fn bench_bn254(c: &mut Criterion) {
use zksync_consensus_crypto::bn254::{AggregateSignature, PublicKey, SecretKey, Signature};
let mut rng = rand::thread_rng();
let mut group = c.benchmark_group("bn254");
group.bench_function("100 sig aggregation", |b| {
b.iter(|| {
let sks: Vec<SecretKey> = repeat_with(|| rng.gen::<SecretKey>()).take(100).collect();
let pks: Vec<PublicKey> = sks.iter().map(|k| k.public()).collect();
let msg = rng.gen::<[u8; 32]>();
let sigs: Vec<Signature> = sks.iter().map(|k| k.sign(&msg)).collect();
let agg = AggregateSignature::aggregate(&sigs);
agg.verify(pks.iter().map(|pk| (&msg[..], pk))).unwrap()
});
});

group.finish();
}

fn bench_bls12_381(c: &mut Criterion) {
use zksync_consensus_crypto::bls12_381::{AggregateSignature, PublicKey, SecretKey, Signature};
let mut rng = rand::thread_rng();
Expand All @@ -41,5 +23,5 @@ fn bench_bls12_381(c: &mut Criterion) {
group.finish();
}

criterion_group!(benches, bench_bls12_381, bench_bn254);
criterion_group!(benches, bench_bls12_381);
criterion_main!(benches);
46 changes: 0 additions & 46 deletions node/libs/crypto/src/bn254/hash.rs

This file was deleted.

313 changes: 0 additions & 313 deletions node/libs/crypto/src/bn254/mod.rs

This file was deleted.

Loading

0 comments on commit 68ab009

Please sign in to comment.