Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BFT-457: Remove bn254 #123

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading