mirror of https://github.com/zcash/halo2.git
Rename hasher to hash_to_curve.
This commit is contained in:
parent
f6f008f905
commit
dc069dff31
|
@ -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<dyn Fn(&[u8]) -> Self + 'static>;
|
||||
fn hash_to_curve(domain_prefix: &str) -> Box<dyn Fn(&[u8]) -> Self + 'static>;
|
||||
|
||||
/// Returns whether or not this element is on the curve; should
|
||||
/// always be true unless an "unchecked" API was used.
|
||||
|
|
|
@ -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<dyn Fn(&[u8]) -> Self + 'static> {
|
||||
fn hash_to_curve(domain_prefix: &str) -> Box<dyn Fn(&[u8]) -> 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<dyn Fn(&[u8]) -> Self + 'static> {
|
||||
fn hash_to_curve(_domain_prefix: &str) -> Box<dyn Fn(&[u8]) -> Self + 'static> {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue