Expand description
This module contains a selection of cryptographic hash functions implementing a common HashFunction trait.
§Example
let digest1 = Sha256::digest(b"Hello, world!");
let mut hash_function = Sha256::default();
hash_function.update(b"Hello, ");
hash_function.update(b"world!");
let digest2 = hash_function.finalize();
assert_eq!(digest1, digest2);Structs§
- Digest
- Represents a digest of
DIGEST_LENbytes. - Elliptic
Curve Multiset Hash 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.- Hash
Function Wrapper - This wraps a digest::Digest as a HashFunction.
Traits§
- Hash
- This trait is implemented by all messages that can be hashed.
- Hash
Function - Trait implemented by hash functions providing a output of fixed length
- Multiset
Hash - A Multiset Hash is a homomorphic hash function, which hashes arbitrary multisets of objects such that the hash of the union of two multisets is easy to compute from the hashes of the two multisets.
- Reverse
Wrapper - This trait allows using a HashFunctionWrapper where a digest::Digest was expected.
Type Aliases§
- Blake2b256
- The BLAKE2-256 hash function with 256 bit digests.
- Keccak256
- The KECCAK hash function with 256 bit digests.
- Sha3_
256 - The SHA-3 hash function with 256 bit digests.
- Sha3_
512 - The SHA-3 hash function with 512 bit digests.
- Sha256
- The SHA-2 hash function with 256 bit digests.
- Sha512
- The SHA-512 hash function with 512 bit digests.