halo2curves_axiom::bls12_381::hash_to_curve

Trait HashToCurve

Source
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§

Source

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.

Source

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.

Implementors§

Source§

impl<G, X> HashToCurve<X> for G
where G: MapToCurve + for<'a> Add<&'a Self, Output = Self>, X: ExpandMessage,