pub trait HashToCurve<X: ExpandMessage>: MapToCurve + for<'a> Add<&'a Self, Output = Self> {
// Provided methods
fn hash_to_curve(message: impl AsRef<[u8]>, dst: &[u8]) -> Self { ... }
fn encode_to_curve(message: impl AsRef<[u8]>, dst: &[u8]) -> Self { ... }
}
Expand description
Implementation of random oracle maps to the curve.
Provided Methods§
Sourcefn hash_to_curve(message: impl AsRef<[u8]>, dst: &[u8]) -> Self
fn hash_to_curve(message: impl AsRef<[u8]>, dst: &[u8]) -> Self
Implements a uniform encoding from byte strings to elements of Self
.
This function is suitable for most applications requiring a random
oracle returning points in Self
.
Sourcefn encode_to_curve(message: impl AsRef<[u8]>, dst: &[u8]) -> Self
fn encode_to_curve(message: impl AsRef<[u8]>, dst: &[u8]) -> Self
Implements a non-uniform encoding from byte strings to elements of Self
.
The distribution of its output is not uniformly random in Self
: the set of
possible outputs of this function is only a fraction of the points in Self
, and
some elements of this set are more likely to be output than others. See
section 10.1 of draft-irtf-cfrg-hash-to-curve-12
for a more precise definition of encode_to_curve
’s output distribution.
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.