diff --git a/CHANGELOG.md b/CHANGELOG.md index 9863d4a..0c096ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ `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 @@ ## v0.1.0 -Initial Release \ No newline at end of file +Initial Release diff --git a/curve-benches/Cargo.toml b/curve-benches/Cargo.toml index 61e962a..b92bdc3 100644 --- a/curve-benches/Cargo.toml +++ b/curve-benches/Cargo.toml @@ -7,7 +7,8 @@ authors = [ "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 @@ harness = false 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 diff --git a/curve-benches/benches/pallas.rs b/curve-benches/benches/pallas.rs new file mode 100644 index 0000000..adbb392 --- /dev/null +++ b/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); diff --git a/curve-benches/benches/vesta.rs b/curve-benches/benches/vesta.rs new file mode 100644 index 0000000..11a0fd4 --- /dev/null +++ b/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);