zksync_crypto_primitives 0.1.0

ZKsync core cryptographic primitives
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
pub mod blake2;
pub mod keccak;
pub mod sha256;

/// Definition of hasher suitable for calculating state hash.
pub trait Hasher {
    type Hash: AsRef<[u8]>;

    /// Gets the hash of the byte sequence.
    fn hash_bytes(&self, value: &[u8]) -> Self::Hash;

    /// Merges two hashes into one.
    fn compress(&self, lhs: &Self::Hash, rhs: &Self::Hash) -> Self::Hash;
}