pub trait HashToCurve<T>: Sizedwhere
T: CurveGroup,{
// Required methods
fn new(domain: &[u8]) -> Result<Self, HashToCurveError>;
fn hash(
&self,
message: &[u8],
) -> Result<<T as CurveGroup>::Affine, HashToCurveError>;
}
Expand description
Trait for hashing arbitrary data to a group element on an elliptic curve
Required Methods§
Sourcefn new(domain: &[u8]) -> Result<Self, HashToCurveError>
fn new(domain: &[u8]) -> Result<Self, HashToCurveError>
Create a new hash to curve instance, with a given domain.
Sourcefn hash(
&self,
message: &[u8],
) -> Result<<T as CurveGroup>::Affine, HashToCurveError>
fn hash( &self, message: &[u8], ) -> Result<<T as CurveGroup>::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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.