forked from Plonky3/Plonky3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from distributed-lab/feature/bls12-377fr
Add support of bls12-377fr
- Loading branch information
Showing
7 changed files
with
1,049 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/target | ||
Cargo.lock | ||
flamegraph.svg | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[package] | ||
name = "p3-bls12-377-fr" | ||
version = "0.1.0" | ||
edition = "2021" | ||
license = "MIT OR Apache-2.0" | ||
|
||
[dependencies] | ||
p3-field.workspace = true | ||
p3-poseidon2.workspace = true | ||
p3-symmetric.workspace = true | ||
|
||
num-bigint.workspace = true | ||
rand.workspace = true | ||
serde = { workspace = true, features = ["derive"] } | ||
lazy_static = { version = "1.5.0" } | ||
|
||
# Ark | ||
ark-bls12-377 = { version = "0.5.0" } | ||
ark-serialize = { version = "0.5.0" } | ||
ark-ff = { version = "0.5.0" } | ||
|
||
[dev-dependencies] | ||
p3-field-testing.workspace = true | ||
|
||
criterion.workspace = true | ||
num-traits.workspace = true | ||
serde_json.workspace = true | ||
|
||
[features] | ||
default = [] | ||
|
||
[[bench]] | ||
name = "bench_field" | ||
harness = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use criterion::{criterion_group, criterion_main, Criterion}; | ||
use p3_bls12_377_fr::Bls12_377Fr; | ||
use p3_field_testing::bench_func::{ | ||
benchmark_add_latency, benchmark_add_throughput, benchmark_inv, benchmark_iter_sum, | ||
benchmark_sub_latency, benchmark_sub_throughput, | ||
}; | ||
|
||
type F = Bls12_377Fr; | ||
|
||
fn bench_field(c: &mut Criterion) { | ||
let name = "Bls12-377Fr"; | ||
const REPS: usize = 1000; | ||
benchmark_inv::<F>(c, name); | ||
benchmark_iter_sum::<F, 4, REPS>(c, name); | ||
benchmark_iter_sum::<F, 8, REPS>(c, name); | ||
benchmark_iter_sum::<F, 12, REPS>(c, name); | ||
|
||
// Note that each round of throughput has 10 operations | ||
// So we should have 10 * more repetitions for latency tests. | ||
const L_REPS: usize = 10 * REPS; | ||
benchmark_add_latency::<F, L_REPS>(c, name); | ||
benchmark_add_throughput::<F, REPS>(c, name); | ||
benchmark_sub_latency::<F, L_REPS>(c, name); | ||
benchmark_sub_throughput::<F, REPS>(c, name); | ||
} | ||
|
||
criterion_group!(bls12377fr_arithmetic, bench_field); | ||
criterion_main!(bls12377fr_arithmetic); |
Oops, something went wrong.