pub struct EllipticCurveMultisetHash { /* private fields */ }Expand description
EllipticCurveMultisetHash (ECMH) is a homomorphic multiset hash function. Concretely, each element is mapped
to a point on an elliptic curve on which the DL problem is hard (the Ristretto group in Curve25519),
and the hash is the sum of all such points.
For more information about the construction of ECMH and its security, see “Elliptic Curve Multiset Hash” by J. Maitin-Shepard et al..
Under the hood, it uses an Ristretto-flavoured Elligator 2 map to map a Sha512 hash of the provided data into points in the Ristretto group, and Sha256 to construct a digest from a serialization of the resulting RistrettoPoint, so digests are 32 bytes long.
Trait Implementations§
Source§impl Clone for EllipticCurveMultisetHash
impl Clone for EllipticCurveMultisetHash
Source§fn clone(&self) -> EllipticCurveMultisetHash
fn clone(&self) -> EllipticCurveMultisetHash
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EllipticCurveMultisetHash
impl Debug for EllipticCurveMultisetHash
Source§impl Default for EllipticCurveMultisetHash
impl Default for EllipticCurveMultisetHash
Source§fn default() -> EllipticCurveMultisetHash
fn default() -> EllipticCurveMultisetHash
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for EllipticCurveMultisetHash
impl<'de> Deserialize<'de> for EllipticCurveMultisetHash
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for EllipticCurveMultisetHash
Source§impl MultisetHash<32> for EllipticCurveMultisetHash
impl MultisetHash<32> for EllipticCurveMultisetHash
Source§fn insert_all<It, Data>(&mut self, items: It)
fn insert_all<It, Data>(&mut self, items: It)
Insert multiple items into this hash function.
Source§fn union(&mut self, other: &Self)
fn union(&mut self, other: &Self)
Add all the elements of another hash function into this hash function.
Source§fn remove<Data: AsRef<[u8]>>(&mut self, item: Data)
fn remove<Data: AsRef<[u8]>>(&mut self, item: Data)
Remove an element from this hash function.
Source§fn remove_all<It, Data>(&mut self, items: It)
fn remove_all<It, Data>(&mut self, items: It)
Remove multiple items from this hash function.
Auto Trait Implementations§
impl Freeze for EllipticCurveMultisetHash
impl RefUnwindSafe for EllipticCurveMultisetHash
impl Send for EllipticCurveMultisetHash
impl Sync for EllipticCurveMultisetHash
impl Unpin for EllipticCurveMultisetHash
impl UnsafeUnpin for EllipticCurveMultisetHash
impl UnwindSafe for EllipticCurveMultisetHash
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