From dc069dff3165649e8cf301d0baf07ba601133362 Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Tue, 2 Feb 2021 12:33:41 -0700 Subject: [PATCH] Rename hasher to hash_to_curve. --- src/arithmetic/curves.rs | 2 +- src/pasta/curves.rs | 4 ++-- src/pasta/pallas.rs | 2 +- src/pasta/vesta.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/arithmetic/curves.rs b/src/arithmetic/curves.rs index 1d946d22..07d53208 100644 --- a/src/arithmetic/curves.rs +++ b/src/arithmetic/curves.rs @@ -83,7 +83,7 @@ pub trait Curve: /// distributed elements in the group, given domain prefix `hasher`. /// /// This method is suitable for use as a random oracle. - fn hasher(domain_prefix: &str) -> Box Self + 'static>; + fn hash_to_curve(domain_prefix: &str) -> Box Self + 'static>; /// Returns whether or not this element is on the curve; should /// always be true unless an "unchecked" API was used. diff --git a/src/pasta/curves.rs b/src/pasta/curves.rs index b6d5f64d..c41610d1 100644 --- a/src/pasta/curves.rs +++ b/src/pasta/curves.rs @@ -686,7 +686,7 @@ macro_rules! new_curve_impl { macro_rules! impl_projective_curve_specific { ($name:ident, $name_affine:ident, $iso_affine:ident, $base:ident, special_a0_b5) => { - fn hasher(domain_prefix: &str) -> Box Self + 'static> { + fn hash_to_curve(domain_prefix: &str) -> Box Self + 'static> { use super::hashtocurve; let domain_separation_tag: String = format!( @@ -777,7 +777,7 @@ macro_rules! impl_projective_curve_specific { }; ($name:ident, $name_affine:ident, $iso_affine:ident, $base:ident, general) => { /// Unimplemented: hashing to this curve is not supported - fn hasher(_domain_prefix: &str) -> Box Self + 'static> { + fn hash_to_curve(_domain_prefix: &str) -> Box Self + 'static> { unimplemented!() } diff --git a/src/pasta/pallas.rs b/src/pasta/pallas.rs index b5a451ab..7cb478a6 100644 --- a/src/pasta/pallas.rs +++ b/src/pasta/pallas.rs @@ -24,7 +24,7 @@ pub type IsoAffine = IsoEpAffine; fn test_map_to_curve_pallas() { use crate::arithmetic::Curve; - let hash = Point::hasher("z.cash:test"); + let hash = Point::hash_to_curve("z.cash:test"); let p: Point = hash(b"hello"); let (x, y, z) = p.jacobian_coordinates(); println!("{:?}", p); diff --git a/src/pasta/vesta.rs b/src/pasta/vesta.rs index fa0c50b0..05db6f1d 100644 --- a/src/pasta/vesta.rs +++ b/src/pasta/vesta.rs @@ -24,7 +24,7 @@ pub type IsoAffine = IsoEqAffine; fn test_map_to_curve_vesta() { use crate::arithmetic::Curve; - let hash = Point::hasher("z.cash:test"); + let hash = Point::hash_to_curve("z.cash:test"); let p: Point = hash(b"hello"); let (x, y, z) = p.jacobian_coordinates(); println!("{:?}", p);