Browse Source

Update to new benchmarking framework (#126)

cherry-pick
Pratyush Mishra 2 years ago
committed by GitHub
parent
commit
363426c1d4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
42 changed files with 244 additions and 448 deletions
  1. +2
    -3
      .github/workflows/ci.yml
  2. +3
    -2
      Cargo.toml
  3. +7
    -1
      bls12_377/Cargo.toml
  4. +16
    -0
      bls12_377/benches/bls12_377.rs
  5. +6
    -0
      bls12_381/Cargo.toml
  6. +16
    -0
      bls12_381/benches/bls12_381.rs
  7. +6
    -0
      bn254/Cargo.toml
  8. +13
    -0
      bn254/benches/bn254.rs
  9. +6
    -0
      bw6_761/Cargo.toml
  10. +16
    -0
      bw6_761/benches/bw6_761.rs
  11. +6
    -0
      cp6_782/Cargo.toml
  12. +15
    -0
      cp6_782/benches/cp6_782.rs
  13. +0
    -115
      curve-benches/Cargo.toml
  14. +0
    -1
      curve-benches/LICENSE-APACHE
  15. +0
    -1
      curve-benches/LICENSE-MIT
  16. +0
    -31
      curve-benches/benches/bls12_377.rs
  17. +0
    -31
      curve-benches/benches/bls12_381.rs
  18. +0
    -30
      curve-benches/benches/bn254.rs
  19. +0
    -32
      curve-benches/benches/bw6_761.rs
  20. +0
    -29
      curve-benches/benches/cp6_782.rs
  21. +0
    -16
      curve-benches/benches/ed_on_bls12_381.rs
  22. +0
    -29
      curve-benches/benches/mnt4_298.rs
  23. +0
    -29
      curve-benches/benches/mnt4_753.rs
  24. +0
    -29
      curve-benches/benches/mnt6_298.rs
  25. +0
    -29
      curve-benches/benches/mnt6_753.rs
  26. +0
    -16
      curve-benches/benches/pallas.rs
  27. +0
    -16
      curve-benches/benches/vesta.rs
  28. +1
    -0
      ed_on_bls12_381/Cargo.toml
  29. +9
    -0
      ed_on_bls12_381/benches/ed_on_bls12_381.rs
  30. +7
    -1
      mnt4_298/Cargo.toml
  31. +15
    -0
      mnt4_298/benches/mnt4_298.rs
  32. +7
    -1
      mnt4_753/Cargo.toml
  33. +15
    -0
      mnt4_753/benches/mnt4_753.rs
  34. +8
    -2
      mnt6_298/Cargo.toml
  35. +15
    -0
      mnt6_298/benches/mnt6_298.rs
  36. +7
    -1
      mnt6_753/Cargo.toml
  37. +15
    -0
      mnt6_753/benches/mnt6_753.rs
  38. +7
    -1
      pallas/Cargo.toml
  39. +9
    -0
      pallas/benches/pallas.rs
  40. +1
    -1
      rustfmt.toml
  41. +7
    -1
      vesta/Cargo.toml
  42. +9
    -0
      vesta/benches/vesta.rs

+ 2
- 3
.github/workflows/ci.yml

@ -103,7 +103,6 @@ jobs:
exclude:
- dir: scripts/
- dir: curve-constraint-tests/
- dir: curve-benches/
steps:
- name: Checkout
uses: actions/checkout@v2
@ -159,10 +158,10 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: check
args: --examples --workspace --exclude ark-curve-constraint-tests --exclude ark-curve-benches --target aarch64-unknown-none
args: --examples --workspace --exclude ark-curve-constraint-tests --target aarch64-unknown-none
- name: build
uses: actions-rs/cargo@v1
with:
command: build
args: --workspace --exclude ark-curve-constraint-tests --exclude ark-curve-benches --target aarch64-unknown-none
args: --workspace --exclude ark-curve-constraint-tests --target aarch64-unknown-none

+ 3
- 2
Cargo.toml

@ -1,7 +1,6 @@
[workspace]
members = [
"curve-benches",
"curve-constraint-tests",
"bls12_377",
@ -31,6 +30,7 @@ members = [
"pallas",
"vesta",
]
resolver = "2"
[profile.release]
opt-level = 3
@ -64,5 +64,6 @@ ark-ff = { git = "https://github.com/arkworks-rs/algebra" }
ark-serialize = { git = "https://github.com/arkworks-rs/algebra" }
ark-algebra-bench-templates = { git = "https://github.com/arkworks-rs/algebra" }
ark-algebra-test-templates = { git = "https://github.com/arkworks-rs/algebra" }
ark-r1cs-std = { git = "https://github.com/arkworks-rs/r1cs-std" }
ark-std = { git = "https://github.com/arkworks-rs/std" }
ark-std = { git = "https://github.com/arkworks-rs/std" }

+ 7
- 1
bls12_377/Cargo.toml

@ -22,6 +22,7 @@ ark-std = { version="^0.3.0", default-features = false }
ark-relations = { version="^0.3.0", default-features = false }
ark-serialize = { version="^0.3.0", default-features = false }
ark-algebra-test-templates = { version="^0.3.0", default-features = false }
ark-algebra-bench-templates = { version = "^0.3.0", default-features = false }
ark-curve-constraint-tests = { path = "../curve-constraint-tests", default-features = false }
[features]
@ -31,4 +32,9 @@ std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
curve = [ "scalar_field", "base_field" ]
scalar_field = []
base_field = []
r1cs = [ "base_field", "ark-r1cs-std" ]
r1cs = [ "base_field", "ark-r1cs-std" ]
[[bench]]
name = "bls12_377"
path = "benches/bls12_377.rs"
harness = false

+ 16
- 0
bls12_377/benches/bls12_377.rs

@ -0,0 +1,16 @@
use ark_algebra_bench_templates::*;
use ark_bls12_377::{
fq::Fq, fq2::Fq2, fr::Fr, Bls12_377, Fq12, G1Projective as G1, G2Projective as G2,
};
bench!(
Name = "Bls12_377",
Pairing = Bls12_377,
G1 = G1,
G2 = G2,
ScalarField = Fr,
G1BaseField = Fq,
G2BaseField = Fq2,
TargetField = Fq12,
);

+ 6
- 0
bls12_381/Cargo.toml

@ -20,6 +20,7 @@ ark-std = { version="^0.3.0", default-features = false }
[dev-dependencies]
ark-serialize = { version="^0.3.0", default-features = false }
ark-algebra-test-templates = { version="^0.3.0", default-features = false }
ark-algebra-bench-templates = { version = "^0.3.0", default-features = false }
[features]
default = [ "curve" ]
@ -27,3 +28,8 @@ std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
curve = [ "scalar_field" ]
scalar_field = []
[[bench]]
name = "bls12_381"
path = "benches/bls12_381.rs"
harness = false

+ 16
- 0
bls12_381/benches/bls12_381.rs

@ -0,0 +1,16 @@
use ark_algebra_bench_templates::*;
use ark_bls12_381::{
fq::Fq, fq2::Fq2, fr::Fr, Bls12_381, Fq12, G1Projective as G1, G2Projective as G2,
};
bench!(
Name = "Bls12_381",
Pairing = Bls12_381,
G1 = G1,
G2 = G2,
ScalarField = Fr,
G1BaseField = Fq,
G2BaseField = Fq2,
TargetField = Fq12,
);

+ 6
- 0
bn254/Cargo.toml

@ -20,6 +20,7 @@ ark-std = { version="^0.3.0", default-features = false }
[dev-dependencies]
ark-serialize = { version="^0.3.0", default-features = false }
ark-algebra-test-templates = { version="^0.3.0", default-features = false }
ark-algebra-bench-templates = { version = "^0.3.0", default-features = false }
[features]
default = [ "curve" ]
@ -27,3 +28,8 @@ std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
curve = [ "scalar_field" ]
scalar_field = []
[[bench]]
name = "bn254"
path = "benches/bn254.rs"
harness = false

+ 13
- 0
bn254/benches/bn254.rs

@ -0,0 +1,13 @@
use ark_algebra_bench_templates::*;
use ark_bn254::{fq::Fq, fq2::Fq2, fr::Fr, Bn254, Fq12, G1Projective as G1, G2Projective as G2};
bench!(
Name = "BN254",
Pairing = Bn254,
G1 = G1,
G2 = G2,
ScalarField = Fr,
G1BaseField = Fq,
G2BaseField = Fq2,
TargetField = Fq12,
);

+ 6
- 0
bw6_761/Cargo.toml

@ -21,7 +21,13 @@ ark-bls12-377 = { version="^0.3.0", path = "../bls12_377", default-features = fa
[dev-dependencies]
ark-serialize = { version="^0.3.0", default-features = false }
ark-algebra-test-templates = { version="^0.3.0", default-features = false }
ark-algebra-bench-templates = { version="^0.3.0", default-features = false }
[features]
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std", "ark-bls12-377/std" ]
[[bench]]
name = "bw6_761"
path = "benches/bw6_761.rs"
harness = false

+ 16
- 0
bw6_761/benches/bw6_761.rs

@ -0,0 +1,16 @@
use ark_algebra_bench_templates::*;
use ark_bw6_761::{
fq::Fq, fq3::Fq3, fq6::Fq6, fr::Fr, g1::G1Projective as G1, g2::G2Projective as G2, BW6_761,
};
bench!(
Name = "BW6_761",
Pairing = BW6_761,
G1 = G1,
G2 = G2,
ScalarField = Fr,
G1BaseField = Fq,
G2BaseField = Fq3,
TargetField = Fq6,
);

+ 6
- 0
cp6_782/Cargo.toml

@ -22,7 +22,13 @@ ark-serialize = { version = "^0.3.0", default-features = false }
[dev-dependencies]
ark-algebra-test-templates = { version = "^0.3.0", default-features = false }
ark-algebra-bench-templates = { version="^0.3.0", default-features = false }
[features]
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std", "ark-bls12-377/std" ]
[[bench]]
name = "cp6_782"
path = "benches/cp6_782.rs"
harness = false

+ 15
- 0
cp6_782/benches/cp6_782.rs

@ -0,0 +1,15 @@
use ark_algebra_bench_templates::*;
use ark_cp6_782::{
fq::Fq, fq3::Fq3, fq6::Fq6, fr::Fr, g1::G1Projective as G1, g2::G2Projective as G2, CP6_782,
};
bench!(
Name = "CP6_782",
Pairing = CP6_782,
G1 = G1,
G2 = G2,
ScalarField = Fr,
G1BaseField = Fq,
G2BaseField = Fq3,
TargetField = Fq6,
);

+ 0
- 115
curve-benches/Cargo.toml

@ -1,115 +0,0 @@
[package]
name = "ark-curve-benches"
version = "0.3.0"
authors = [
"Sean Bowe",
"Alessandro Chiesa",
"Matthew Green",
"Ian Miers",
"Pratyush Mishra",
"Howard Wu",
"Daira Hopwood"
]
description = "A benchmark library for finite fields and elliptic curves"
homepage = "https://arkworks.rs"
repository = "https://github.com/arkworks-rs/curves"
documentation = "https://docs.rs/algebra/"
keywords = ["cryptography", "finite-fields", "elliptic-curves", "pairing"]
categories = ["cryptography"]
include = ["Cargo.toml", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
license = "MIT/Apache-2.0"
edition = "2021"
publish = false
################################# Dependencies ################################
[dependencies]
bencher = { version = "0.1.5" }
[dev-dependencies]
ark-std = { version = "^0.3.0", default-features = false }
ark-ec = { version = "^0.3.0", default-features = false }
ark-ff = { version = "^0.3.0", default-features = false }
ark-serialize = { version = "^0.3.0", default-features = false }
ark-algebra-bench-templates = { version = "^0.3.0", default-features = false }
ark-mnt4-298 = { path = "../mnt4_298" }
ark-mnt6-298 = { path = "../mnt6_298" }
ark-mnt4-753 = { path = "../mnt4_753" }
ark-mnt6-753 = { path = "../mnt6_753" }
ark-bn254 = { path = "../bn254" }
ark-bls12-377 = { path = "../bls12_377" }
ark-bls12-381 = { path = "../bls12_381" }
ark-ed-on-bls12-381 = { path = "../ed_on_bls12_381" }
ark-bw6-761 = { path = "../bw6_761" }
ark-cp6-782 = { path = "../cp6_782" }
ark-pallas = { path = "../pallas" }
ark-vesta = { path = "../vesta" }
[features]
asm = [ "ark-ff/asm"]
parallel = [ "ark-ff/parallel", "ark-ec/parallel" ]
n_fold = []
[build-dependencies]
rustc_version = "0.2"
[[bench]]
name = "bls12_377"
path = "benches/bls12_377.rs"
harness = false
[[bench]]
name = "bls12_381"
path = "benches/bls12_381.rs"
harness = false
[[bench]]
name = "bn254"
path = "benches/bn254.rs"
harness = false
[[bench]]
name = "bw6_761"
path = "benches/bw6_761.rs"
harness = false
[[bench]]
name = "cp6_782"
path = "benches/cp6_782.rs"
harness = false
[[bench]]
name = "ed_on_bls12_381"
path = "benches/ed_on_bls12_381.rs"
harness = false
[[bench]]
name = "mnt4_298"
path = "benches/mnt4_298.rs"
harness = false
[[bench]]
name = "mnt6_298"
path = "benches/mnt6_298.rs"
harness = false
[[bench]]
name = "mnt4_753"
path = "benches/mnt4_753.rs"
harness = false
[[bench]]
name = "mnt6_753"
path = "benches/mnt6_753.rs"
harness = false
[[bench]]
name = "pallas"
path = "benches/pallas.rs"
harness = false
[[bench]]
name = "vesta"
path = "benches/vesta.rs"
harness = false

+ 0
- 1
curve-benches/LICENSE-APACHE

@ -1 +0,0 @@
../LICENSE-APACHE

+ 0
- 1
curve-benches/LICENSE-MIT

@ -1 +0,0 @@
../LICENSE-MIT

+ 0
- 31
curve-benches/benches/bls12_377.rs

@ -1,31 +0,0 @@
use ark_algebra_bench_templates::*;
use ark_std::ops::{AddAssign, MulAssign, SubAssign};
use ark_bls12_377::{
fq::Fq, fq2::Fq2, fr::Fr, Bls12_377, Fq12, G1Affine, G1Projective as G1, G2Affine,
G2Projective as G2,
};
use ark_ec::bls12::{G1Prepared, G2Prepared};
use ark_ec::{CurveGroup, Group};
use ark_ff::{
biginteger::{BigInteger256 as FrRepr, BigInteger384 as FqRepr},
BigInteger, Field, PrimeField, UniformRand,
};
mod g1 {
use super::*;
ec_bench!(G1, G1Affine);
}
mod g2 {
use super::*;
ec_bench!(G2, G2Affine);
}
f_bench!(Fq, Fq, FqRepr, FqRepr, fq);
f_bench!(Fr, Fr, FrRepr, FrRepr, fr);
f_bench!(extension, Fq2, Fq2, fq2);
f_bench!(target, Fq12, Fq12, fq12);
pairing_bench!(Bls12_377, Fq12);
bencher::benchmark_main!(fq, fr, fq2, fq12, g1::group_ops, g2::group_ops, pairing);

+ 0
- 31
curve-benches/benches/bls12_381.rs

@ -1,31 +0,0 @@
use ark_algebra_bench_templates::*;
use ark_std::ops::{AddAssign, MulAssign, SubAssign};
use ark_bls12_381::{
fq::Fq, fq2::Fq2, fr::Fr, Bls12_381, Fq12, G1Affine, G1Projective as G1, G2Affine,
G2Projective as G2,
};
use ark_ec::bls12::{G1Prepared, G2Prepared};
use ark_ec::{CurveGroup, Group};
use ark_ff::{
biginteger::{BigInteger256 as FrRepr, BigInteger384 as FqRepr},
BigInteger, Field, PrimeField, UniformRand,
};
mod g1 {
use super::*;
ec_bench!(G1, G1Affine);
}
mod g2 {
use super::*;
ec_bench!(G2, G2Affine);
}
f_bench!(Fq, Fq, FqRepr, FqRepr, fq);
f_bench!(Fr, Fr, FrRepr, FrRepr, fr);
f_bench!(extension, Fq2, Fq2, fq2);
f_bench!(target, Fq12, Fq12, fq12);
pairing_bench!(Bls12_381, Fq12);
bencher::benchmark_main!(fq, fr, fq2, fq12, g1::group_ops, g2::group_ops, pairing);

+ 0
- 30
curve-benches/benches/bn254.rs

@ -1,30 +0,0 @@
use ark_algebra_bench_templates::*;
use ark_std::ops::{AddAssign, MulAssign, SubAssign};
use ark_bn254::{
fq::Fq, fq2::Fq2, fr::Fr, Bn254, Fq12, G1Affine, G1Projective as G1, G2Affine,
G2Projective as G2,
};
use ark_ec::{
bn::{G1Prepared, G2Prepared},
CurveGroup, Group,
};
use ark_ff::{biginteger::BigInteger256 as Repr, BigInteger, Field, PrimeField, UniformRand};
mod g1 {
use super::*;
ec_bench!(G1, G1Affine);
}
mod g2 {
use super::*;
ec_bench!(G2, G2Affine);
}
f_bench!(Fq, Fq, Repr, Repr, fq);
f_bench!(Fr, Fr, Repr, Repr, fr);
f_bench!(extension, Fq2, Fq2, fq2);
f_bench!(target, Fq12, Fq12, fq12);
pairing_bench!(Bn254, Fq12);
bencher::benchmark_main!(fq, fr, fq2, fq12, g1::group_ops, g2::group_ops, pairing);

+ 0
- 32
curve-benches/benches/bw6_761.rs

@ -1,32 +0,0 @@
use ark_algebra_bench_templates::*;
use ark_std::ops::{AddAssign, MulAssign, SubAssign};
use ark_bw6_761::{
fq::Fq, fq3::Fq3, fr::Fr, Fq6, G1Affine, G1Projective as G1, G2Affine, G2Projective as G2,
BW6_761,
};
use ark_ec::{
bw6::{G1Prepared, G2Prepared},
CurveGroup, Group,
};
use ark_ff::{
biginteger::{BigInteger384 as FrRepr, BigInteger768 as FqRepr},
BigInteger, Field, PrimeField, UniformRand,
};
mod g1 {
use super::*;
ec_bench!(G1, G1Affine);
}
mod g2 {
use super::*;
ec_bench!(G2, G2Affine);
}
f_bench!(extension, Fq3, Fq3, fq3);
f_bench!(target, Fq6, Fq6, fq6);
f_bench!(Fq, Fq, FqRepr, FqRepr, fq);
f_bench!(Fr, Fr, FrRepr, FrRepr, fr);
pairing_bench!(BW6_761, Fq6);
bencher::benchmark_main!(fq, fr, fq3, fq6, g1::group_ops, g2::group_ops, pairing);

+ 0
- 29
curve-benches/benches/cp6_782.rs

@ -1,29 +0,0 @@
use ark_algebra_bench_templates::*;
use ark_std::ops::{AddAssign, MulAssign, SubAssign};
use ark_cp6_782::{
fq::Fq, fq3::Fq3, fr::Fr, Fq6, G1Affine, G1Prepared, G1Projective as G1, G2Affine, G2Prepared,
G2Projective as G2, CP6_782,
};
use ark_ec::{CurveGroup, Group};
use ark_ff::{
biginteger::{BigInteger384 as FrRepr, BigInteger832 as FqRepr},
BigInteger, Field, PrimeField, UniformRand,
};
mod g1 {
use super::*;
ec_bench!(G1, G1Affine);
}
mod g2 {
use super::*;
ec_bench!(G2, G2Affine);
}
f_bench!(extension, Fq3, Fq3, fq3);
f_bench!(target, Fq6, Fq6, fq6);
f_bench!(Fq, Fq, FqRepr, FqRepr, fq);
f_bench!(Fr, Fr, FrRepr, FrRepr, fr);
pairing_bench!(CP6_782, Fq6);
bencher::benchmark_main!(fq, fr, fq3, fq6, g1::group_ops, g2::group_ops, pairing);

+ 0
- 16
curve-benches/benches/ed_on_bls12_381.rs

@ -1,16 +0,0 @@
use ark_algebra_bench_templates::*;
use ark_std::ops::{AddAssign, MulAssign, SubAssign};
use ark_ec::{CurveGroup, Group};
use ark_ed_on_bls12_381::{fq::Fq, fr::Fr, EdwardsAffine as GAffine, EdwardsProjective as G};
use ark_ff::{biginteger::BigInteger256 as Repr, BigInteger, Field, PrimeField, UniformRand};
mod g {
use super::*;
ec_bench!(G, GAffine);
}
f_bench!(Fq, Fq, Repr, Repr, fq);
f_bench!(Fr, Fr, Repr, Repr, fr);
bencher::benchmark_main!(fq, fr, g::group_ops);

+ 0
- 29
curve-benches/benches/mnt4_298.rs

@ -1,29 +0,0 @@
use ark_algebra_bench_templates::*;
use ark_std::ops::{AddAssign, MulAssign, SubAssign};
use ark_ec::{
mnt4::{G1Prepared, G2Prepared},
CurveGroup, Group,
};
use ark_ff::{biginteger::BigInteger320 as FqRepr, BigInteger, Field, PrimeField, UniformRand};
use ark_mnt4_298::{
fq::Fq, fq2::Fq2, fr::Fr, Fq4, G1Affine, G1Projective as G1, G2Affine, G2Projective as G2,
MNT4_298,
};
mod g1 {
use super::*;
ec_bench!(G1, G1Affine);
}
mod g2 {
use super::*;
ec_bench!(G2, G2Affine);
}
f_bench!(extension, Fq2, Fq2, fq2);
f_bench!(target, Fq4, Fq4, fq4);
f_bench!(Fq, Fq, FqRepr, FqRepr, fq);
f_bench!(Fr, Fr, FqRepr, FqRepr, fr);
pairing_bench!(MNT4_298, Fq4);
bencher::benchmark_main!(fq, fr, fq2, fq4, g1::group_ops, g2::group_ops, pairing);

+ 0
- 29
curve-benches/benches/mnt4_753.rs

@ -1,29 +0,0 @@
use ark_algebra_bench_templates::*;
use ark_std::ops::{AddAssign, MulAssign, SubAssign};
use ark_ec::{
mnt4::{G1Prepared, G2Prepared},
CurveGroup, Group,
};
use ark_ff::{biginteger::BigInteger768 as FqRepr, BigInteger, Field, PrimeField, UniformRand};
use ark_mnt4_753::{
fq::Fq, fq2::Fq2, fr::Fr, Fq4, G1Affine, G1Projective as G1, G2Affine, G2Projective as G2,
MNT4_753,
};
mod g1 {
use super::*;
ec_bench!(G1, G1Affine);
}
mod g2 {
use super::*;
ec_bench!(G2, G2Affine);
}
f_bench!(extension, Fq2, Fq2, fq2);
f_bench!(target, Fq4, Fq4, fq4);
f_bench!(Fq, Fq, FqRepr, FqRepr, fq);
f_bench!(Fr, Fr, FqRepr, FqRepr, fr);
pairing_bench!(MNT4_753, Fq4);
bencher::benchmark_main!(fq, fr, fq2, fq4, g1::group_ops, g2::group_ops, pairing);

+ 0
- 29
curve-benches/benches/mnt6_298.rs

@ -1,29 +0,0 @@
use ark_algebra_bench_templates::*;
use ark_std::ops::{AddAssign, MulAssign, SubAssign};
use ark_ec::{
mnt6::{G1Prepared, G2Prepared},
CurveGroup, Group,
};
use ark_ff::{biginteger::BigInteger320 as FqRepr, BigInteger, Field, PrimeField, UniformRand};
use ark_mnt6_298::{
fq::Fq, fq3::Fq3, fr::Fr, Fq6, G1Affine, G1Projective as G1, G2Affine, G2Projective as G2,
MNT6_298,
};
mod g1 {
use super::*;
ec_bench!(G1, G1Affine);
}
mod g2 {
use super::*;
ec_bench!(G2, G2Affine);
}
f_bench!(extension, Fq3, Fq3, fq3);
f_bench!(target, Fq6, Fq6, fq6);
f_bench!(Fq, Fq, FqRepr, FqRepr, fq);
f_bench!(Fr, Fr, FqRepr, FqRepr, fr);
pairing_bench!(MNT6_298, Fq6);
bencher::benchmark_main!(fq, fr, fq3, fq6, g1::group_ops, g2::group_ops, pairing);

+ 0
- 29
curve-benches/benches/mnt6_753.rs

@ -1,29 +0,0 @@
use ark_algebra_bench_templates::*;
use ark_std::ops::{AddAssign, MulAssign, SubAssign};
use ark_ec::{
mnt6::{G1Prepared, G2Prepared},
CurveGroup, Group,
};
use ark_ff::{biginteger::BigInteger768 as FqRepr, BigInteger, Field, PrimeField, UniformRand};
use ark_mnt6_753::{
fq::Fq, fq3::Fq3, fr::Fr, Fq6, G1Affine, G1Projective as G1, G2Affine, G2Projective as G2,
MNT6_753,
};
mod g1 {
use super::*;
ec_bench!(G1, G1Affine);
}
mod g2 {
use super::*;
ec_bench!(G2, G2Affine);
}
f_bench!(extension, Fq3, Fq3, fq3);
f_bench!(target, Fq6, Fq6, fq6);
f_bench!(Fq, Fq, FqRepr, FqRepr, fq);
f_bench!(Fr, Fr, FqRepr, FqRepr, fr);
pairing_bench!(MNT6_753, Fq6);
bencher::benchmark_main!(fq, fr, fq3, fq6, g1::group_ops, g2::group_ops, pairing);

+ 0
- 16
curve-benches/benches/pallas.rs

@ -1,16 +0,0 @@
use ark_algebra_bench_templates::*;
use ark_std::ops::{AddAssign, MulAssign, SubAssign};
use ark_ec::{CurveGroup, Group};
use ark_ff::{biginteger::BigInteger256 as Repr, BigInteger, Field, PrimeField, UniformRand};
use ark_pallas::{fq::Fq, fr::Fr, Affine as GAffine, Projective as G};
mod g {
use super::*;
ec_bench!(G, GAffine);
}
f_bench!(Fq, Fq, Repr, Repr, fq);
f_bench!(Fr, Fr, Repr, Repr, fr);
bencher::benchmark_main!(fq, fr, g::group_ops);

+ 0
- 16
curve-benches/benches/vesta.rs

@ -1,16 +0,0 @@
use ark_algebra_bench_templates::*;
use ark_std::ops::{AddAssign, MulAssign, SubAssign};
use ark_ec::{CurveGroup, Group};
use ark_ff::{biginteger::BigInteger256 as Repr, BigInteger, Field, PrimeField, UniformRand};
use ark_vesta::{fq::Fq, fr::Fr, Affine as GAffine, Projective as G};
mod g {
use super::*;
ec_bench!(G, GAffine);
}
f_bench!(Fq, Fq, Repr, Repr, fq);
f_bench!(Fr, Fr, Repr, Repr, fr);
bencher::benchmark_main!(fq, fr, g::group_ops);

+ 1
- 0
ed_on_bls12_381/Cargo.toml

@ -23,6 +23,7 @@ ark-bls12-381 = { version = "^0.3.0", path = "../bls12_381", default-features =
ark-relations = { version = "^0.3.0", default-features = false }
ark-serialize = { version = "^0.3.0", default-features = false }
ark-algebra-test-templates = { version = "^0.3.0", default-features = false }
ark-algebra-bench-templates = { version = "^0.3.0", default-features = false }
ark-curve-constraint-tests = { path = "../curve-constraint-tests", default-features = false }
[features]

+ 9
- 0
ed_on_bls12_381/benches/ed_on_bls12_381.rs

@ -0,0 +1,9 @@
use ark_algebra_bench_templates::*;
use ark_ed_on_bls12_381::{fq::Fq, fr::Fr, EdwardsProjective as G};
bench!(
Name = "EdOnBls12_381",
Group = G,
ScalarField = Fr,
PrimeBaseField = Fq,
);

+ 7
- 1
mnt4_298/Cargo.toml

@ -22,6 +22,7 @@ ark-r1cs-std = { version = "^0.3.0", default-features = false, optional = true }
ark-relations = { version = "^0.3.0", default-features = false }
ark-serialize = { version = "^0.3.0", default-features = false }
ark-algebra-test-templates = { version = "^0.3.0", default-features = false }
ark-algebra-bench-templates = { version = "^0.3.0", default-features = false }
ark-curve-constraint-tests = { path = "../curve-constraint-tests", default-features = false }
[features]
@ -31,4 +32,9 @@ std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
curve = [ "scalar_field", "base_field" ]
scalar_field = []
base_field = []
r1cs = [ "base_field", "ark-r1cs-std" ]
r1cs = [ "base_field", "ark-r1cs-std" ]
[[bench]]
name = "mnt4_298"
path = "benches/mnt4_298.rs"
harness = false

+ 15
- 0
mnt4_298/benches/mnt4_298.rs

@ -0,0 +1,15 @@
use ark_algebra_bench_templates::*;
use ark_mnt4_298::{
fq::Fq, fq2::Fq2, fr::Fr, Fq4, G1Projective as G1, G2Projective as G2, MNT4_298,
};
bench!(
Name = "MNT4_298",
Pairing = MNT4_298,
G1 = G1,
G2 = G2,
ScalarField = Fr,
G1BaseField = Fq,
G2BaseField = Fq2,
TargetField = Fq4,
);

+ 7
- 1
mnt4_753/Cargo.toml

@ -22,6 +22,7 @@ ark-r1cs-std = { version = "^0.3.0", default-features = false, optional = true }
ark-relations = { version = "^0.3.0", default-features = false }
ark-serialize = { version = "^0.3.0", default-features = false }
ark-algebra-test-templates = { version = "^0.3.0", default-features = false }
ark-algebra-bench-templates = { version = "^0.3.0", default-features = false }
ark-curve-constraint-tests = { path = "../curve-constraint-tests", default-features = false }
[features]
@ -31,4 +32,9 @@ std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
curve = [ "scalar_field", "base_field" ]
scalar_field = []
base_field = []
r1cs = [ "base_field", "ark-r1cs-std" ]
r1cs = [ "base_field", "ark-r1cs-std" ]
[[bench]]
name = "mnt4_753"
path = "benches/mnt4_753.rs"
harness = false

+ 15
- 0
mnt4_753/benches/mnt4_753.rs

@ -0,0 +1,15 @@
use ark_algebra_bench_templates::*;
use ark_mnt4_753::{
fq::Fq, fq2::Fq2, fr::Fr, Fq4, G1Projective as G1, G2Projective as G2, MNT4_753,
};
bench!(
Name = "MNT4_753",
Pairing = MNT4_753,
G1 = G1,
G2 = G2,
ScalarField = Fr,
G1BaseField = Fq,
G2BaseField = Fq2,
TargetField = Fq4,
);

+ 8
- 2
mnt6_298/Cargo.toml

@ -10,7 +10,7 @@ keywords = ["cryptography", "finite-fields", "elliptic-curves"]
categories = ["cryptography"]
include = ["Cargo.toml", "src", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
license = "MIT/Apache-2.0"
edition = "2018"
edition = "2021"
[dependencies]
ark-ff = { version = "^0.3.0", default-features = false }
@ -23,9 +23,15 @@ ark-mnt4-298 = { version = "^0.3.0", path = "../mnt4_298", default-features = fa
ark-relations = { version = "^0.3.0", default-features = false }
ark-serialize = { version = "^0.3.0", default-features = false }
ark-algebra-test-templates = { version = "^0.3.0", default-features = false }
ark-algebra-bench-templates = { version = "^0.3.0", default-features = false }
ark-curve-constraint-tests = { path = "../curve-constraint-tests", default-features = false }
[features]
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
r1cs = [ "ark-r1cs-std" ]
r1cs = [ "ark-r1cs-std" ]
[[bench]]
name = "mnt6_298"
path = "benches/mnt6_298.rs"
harness = false

+ 15
- 0
mnt6_298/benches/mnt6_298.rs

@ -0,0 +1,15 @@
use ark_algebra_bench_templates::*;
use ark_mnt6_298::{
fq::Fq, fq3::Fq3, fr::Fr, Fq6, G1Projective as G1, G2Projective as G2, MNT6_298,
};
bench!(
Name = "MNT6_298",
Pairing = MNT6_298,
G1 = G1,
G2 = G2,
ScalarField = Fr,
G1BaseField = Fq,
G2BaseField = Fq3,
TargetField = Fq6,
);

+ 7
- 1
mnt6_753/Cargo.toml

@ -10,7 +10,7 @@ keywords = ["cryptography", "finite-fields", "elliptic-curves" ]
categories = ["cryptography"]
include = ["Cargo.toml", "src", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
license = "MIT/Apache-2.0"
edition = "2018"
edition = "2021"
[dependencies]
ark-ff = { version = "^0.3.0", default-features = false }
@ -23,9 +23,15 @@ ark-mnt4-753 = { version = "^0.3.0", path = "../mnt4_753", default-features = fa
ark-relations = { version = "^0.3.0", default-features = false }
ark-serialize = { version = "^0.3.0", default-features = false }
ark-algebra-test-templates = { version = "^0.3.0", default-features = false }
ark-algebra-bench-templates = { version = "^0.3.0", default-features = false }
ark-curve-constraint-tests = { path = "../curve-constraint-tests", default-features = false }
[features]
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
r1cs = ["ark-r1cs-std"]
[[bench]]
name = "mnt6_753"
path = "benches/mnt6_753.rs"
harness = false

+ 15
- 0
mnt6_753/benches/mnt6_753.rs

@ -0,0 +1,15 @@
use ark_algebra_bench_templates::*;
use ark_mnt6_753::{
fq::Fq, fq3::Fq3, fr::Fr, Fq6, G1Projective as G1, G2Projective as G2, MNT6_753,
};
bench!(
Name = "MNT6_753",
Pairing = MNT6_753,
G1 = G1,
G2 = G2,
ScalarField = Fr,
G1BaseField = Fq,
G2BaseField = Fq3,
TargetField = Fq6,
);

+ 7
- 1
pallas/Cargo.toml

@ -10,7 +10,7 @@ keywords = ["cryptography", "finite-fields", "elliptic-curves" ]
categories = ["cryptography"]
include = ["Cargo.toml", "src"]
license = "MIT/Apache-2.0"
edition = "2018"
edition = "2021"
[dependencies]
ark-ff = { version = "^0.3.0", default-features = false }
@ -22,6 +22,7 @@ ark-std = { version = "^0.3.0", default-features = false }
ark-relations = { version = "^0.3.0", default-features = false }
ark-serialize = { version = "^0.3.0", default-features = false }
ark-algebra-test-templates = { version = "^0.3.0", default-features = false }
ark-algebra-bench-templates = { version = "^0.3.0", default-features = false }
ark-curve-constraint-tests = { path = "../curve-constraint-tests", default-features = false }
[features]
@ -32,3 +33,8 @@ curve = [ "scalar_field", "base_field" ]
scalar_field = []
base_field = []
r1cs = [ "base_field", "ark-r1cs-std" ]
[[bench]]
name = "pallas"
path = "benches/pallas.rs"
harness = false

+ 9
- 0
pallas/benches/pallas.rs

@ -0,0 +1,9 @@
use ark_algebra_bench_templates::*;
use ark_pallas::{fq::Fq, fr::Fr, Projective as G};
bench!(
Name = "Pallas",
Group = G,
ScalarField = Fr,
PrimeBaseField = Fq,
);

+ 1
- 1
rustfmt.toml

@ -4,6 +4,6 @@ normalize_comments = true
use_try_shorthand = true
match_block_trailing_comma = true
use_field_init_shorthand = true
edition = "2018"
edition = "2021"
condense_wildcard_suffixes = true
imports_granularity="Crate"

+ 7
- 1
vesta/Cargo.toml

@ -10,7 +10,7 @@ keywords = ["cryptography", "finite-fields", "elliptic-curves" ]
categories = ["cryptography"]
include = ["Cargo.toml", "src"]
license = "MIT/Apache-2.0"
edition = "2018"
edition = "2021"
[dependencies]
ark-ff = { version = "^0.3.0", default-features = false }
@ -23,9 +23,15 @@ ark-pallas = { version = "^0.3.0", path = "../pallas", default-features = false,
ark-relations = { version = "^0.3.0", default-features = false }
ark-serialize = { version = "^0.3.0", default-features = false }
ark-algebra-test-templates = { version = "^0.3.0", default-features = false }
ark-algebra-bench-templates = { version = "^0.3.0", default-features = false }
ark-curve-constraint-tests = { path = "../curve-constraint-tests", default-features = false }
[features]
default = []
std = [ "ark-std/std", "ark-ff/std", "ark-ec/std" ]
r1cs = [ "ark-r1cs-std" ]
[[bench]]
name = "vesta"
path = "benches/vesta.rs"
harness = false

+ 9
- 0
vesta/benches/vesta.rs

@ -0,0 +1,9 @@
use ark_algebra_bench_templates::*;
use ark_vesta::{fq::Fq, fr::Fr, Projective as G};
bench!(
Name = "Vesta",
Group = G,
ScalarField = Fr,
PrimeBaseField = Fq,
);

Loading…
Cancel
Save