Add benchmarks for Pallas and Vesta curves. (#53) Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Daira Hopwood daira@jacaranda.org
Fri, 16 Apr 2021 18:18:06 +0100
4 files changed,
54 insertions(+),
2 deletions(-)
M
CHANGELOG.md
→
CHANGELOG.md
@@ -19,6 +19,7 @@ `ark-mnt4-753`,
`ark-mnt6-753`. - [\#7](https://github.com/arkworks-rs/curves/pull/7) Add benchmarks for Edwards curves. - [\#19](https://github.com/arkworks-rs/curves/pull/19) Change field constants to be provided as normal strings, instead of in Montgomery form. +- [\#53](https://github.com/arkworks-rs/curves/pull/53) Add benchmarks for Pallas and Vesta curves. ### Improvements - [\#42](https://github.com/arkworks-rs/curves/pull/42) Remove the dependency of `rand_xorshift`.@@ -30,4 +31,4 @@ - [\#45](https://github.com/arkworks-rs/curves/pull/45) Fix `ark-ed-on-mnt4-753`.
## v0.1.0 -Initial Release+Initial Release
M
curve-benches/Cargo.toml
→
curve-benches/Cargo.toml
@@ -7,7 +7,8 @@ "Alessandro Chiesa",
"Matthew Green", "Ian Miers", "Pratyush Mishra", - "Howard Wu" + "Howard Wu", + "Daira Hopwood" ] description = "A benchmark library for finite fields and elliptic curves" homepage = "https://arkworks.rs"@@ -42,6 +43,8 @@ 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"]@@ -100,3 +103,13 @@ [[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
A
curve-benches/benches/pallas.rs
@@ -0,0 +1,19 @@
+use ark_curve_benches::*; +use ark_std::ops::{AddAssign, MulAssign, SubAssign}; + +use ark_ec::ProjectiveCurve; +use ark_ff::{ + biginteger::{BigInteger256 as FrRepr, BigInteger256 as FqRepr}, + BigInteger, Field, PrimeField, SquareRootField, 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, FqRepr, FqRepr, fq); +f_bench!(Fr, Fr, FrRepr, FrRepr, fr); + +bencher::benchmark_main!(fq, fr, g::group_ops);
A
curve-benches/benches/vesta.rs
@@ -0,0 +1,19 @@
+use ark_curve_benches::*; +use ark_std::ops::{AddAssign, MulAssign, SubAssign}; + +use ark_ec::ProjectiveCurve; +use ark_ff::{ + biginteger::{BigInteger256 as FrRepr, BigInteger256 as FqRepr}, + BigInteger, Field, PrimeField, SquareRootField, 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, FqRepr, FqRepr, fq); +f_bench!(Fr, Fr, FrRepr, FrRepr, fr); + +bencher::benchmark_main!(fq, fr, g::group_ops);