pub trait HashToCurve<T: CurveGroup>: Sized {
    // Required methods
    fn new(domain: &[u8]) -> Result<Self, HashToCurveError>;
    fn hash(&self, message: &[u8]) -> Result<T::Affine, HashToCurveError>;
}
Expand description

Trait for hashing arbitrary data to a group element on an elliptic curve

Required Methods§

source

fn new(domain: &[u8]) -> Result<Self, HashToCurveError>

Create a new hash to curve instance, with a given domain.

source

fn hash(&self, message: &[u8]) -> Result<T::Affine, HashToCurveError>

Produce a hash of the message, which also depends on the domain. The output of the hash is a curve point in the prime order subgroup of the given elliptic curve.

Implementors§

source§

impl<T, H2F, M2C> HashToCurve<T> for MapToCurveBasedHasher<T, H2F, M2C>where T: CurveGroup, H2F: HashToField<T::BaseField>, M2C: MapToCurve<T>,