mirror of
https://github.com/saymrwulf/pasta_curves-source.git
synced 2026-09-04 20:03:39 +00:00
The `Curve` trait is now `CurveExt: group::prime::PrimeCurve`, and `CurveAffine` is now `CurveAffine: group::prime::PrimeCurveAffine`. There is no `CurveAffine` trait in `group`, and it's a widely-used trait in this crate, so we don't rename it to `CurveAffineExt`.
23 lines
720 B
Rust
23 lines
720 B
Rust
//! Benchmarks for hashing to the Pasta curves.
|
|
|
|
use criterion::{criterion_group, criterion_main, Criterion};
|
|
|
|
use halo2::arithmetic::CurveExt;
|
|
use halo2::pasta::{pallas, vesta};
|
|
|
|
fn criterion_benchmark(c: &mut Criterion) {
|
|
bench_hash_to_curve(c);
|
|
}
|
|
|
|
fn bench_hash_to_curve(c: &mut Criterion) {
|
|
let mut group = c.benchmark_group("hash-to-curve");
|
|
|
|
let hash_pallas = pallas::Point::hash_to_curve("z.cash:test");
|
|
group.bench_function("Pallas", |b| b.iter(|| hash_pallas(b"benchmark")));
|
|
|
|
let hash_vesta = vesta::Point::hash_to_curve("z.cash:test");
|
|
group.bench_function("Vesta", |b| b.iter(|| hash_vesta(b"benchmark")));
|
|
}
|
|
|
|
criterion_group!(benches, criterion_benchmark);
|
|
criterion_main!(benches);
|