pub struct MapToCurveBasedHasher<T, H2F, M2C>{ /* private fields */ }
Expand description
Helper struct that can be used to construct elements on the elliptic curve from arbitrary messages, by first hashing the message onto a field element and then mapping it to the elliptic curve defined over that field.
Trait Implementations§
Source§impl<T, H2F, M2C> HashToCurve<T> for MapToCurveBasedHasher<T, H2F, M2C>
impl<T, H2F, M2C> HashToCurve<T> for MapToCurveBasedHasher<T, H2F, M2C>
Source§fn hash(
&self,
msg: &[u8],
) -> Result<<T as CurveGroup>::Affine, HashToCurveError>
fn hash( &self, msg: &[u8], ) -> Result<<T as CurveGroup>::Affine, HashToCurveError>
Produce a hash of the message, using the hash to field and map to curve traits. This uses the IETF hash to curve’s specification for Random oracle encoding (hash_to_curve) defined by combining these components. See https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-09#section-3
Source§fn new(
domain: &[u8],
) -> Result<MapToCurveBasedHasher<T, H2F, M2C>, HashToCurveError>
fn new( domain: &[u8], ) -> Result<MapToCurveBasedHasher<T, H2F, M2C>, HashToCurveError>
Create a new hash to curve instance, with a given domain.
Auto Trait Implementations§
impl<T, H2F, M2C> Freeze for MapToCurveBasedHasher<T, H2F, M2C>where
H2F: Freeze,
impl<T, H2F, M2C> RefUnwindSafe for MapToCurveBasedHasher<T, H2F, M2C>
impl<T, H2F, M2C> Send for MapToCurveBasedHasher<T, H2F, M2C>
impl<T, H2F, M2C> Sync for MapToCurveBasedHasher<T, H2F, M2C>
impl<T, H2F, M2C> Unpin for MapToCurveBasedHasher<T, H2F, M2C>
impl<T, H2F, M2C> UnwindSafe for MapToCurveBasedHasher<T, H2F, M2C>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more