diff --git a/CHANGELOG.md b/CHANGELOG.md index 767f151..5d3fc0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 0.2.0 (2023-03-24) + +- Implemented `MerkleStore` (#93, #94, #95, #107 #112). +- Added benchmarks for `MerkleStore` vs. other structs (#97). +- Added Merkle path containers (#99). +- Fixed depth handling in `MerklePathSet` (#110). + ## 0.1.4 (2023-02-22) - Re-export winter-crypto Hasher, Digest & ElementHasher (#72) diff --git a/Cargo.toml b/Cargo.toml index c5901e3..069e286 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "miden-crypto" -version = "0.1.4" +version = "0.2.0" description = "Miden Cryptographic primitives" authors = ["miden contributors"] readme = "README.md" license = "MIT" repository = "https://github.com/0xPolygonMiden/crypto" -documentation = "https://docs.rs/miden-crypto/0.1.4" +documentation = "https://docs.rs/miden-crypto/0.2.0" categories = ["cryptography", "no-std"] keywords = ["miden", "crypto", "hash", "merkle"] edition = "2021" @@ -30,11 +30,11 @@ std = ["blake3/std", "winter_crypto/std", "winter_math/std", "winter_utils/std"] [dependencies] blake3 = { version = "1.3", default-features = false } -winter_crypto = { version = "0.5", package = "winter-crypto", default-features = false } -winter_math = { version = "0.5", package = "winter-math", default-features = false } -winter_utils = { version = "0.5", package = "winter-utils", default-features = false } +winter_crypto = { version = "0.6", package = "winter-crypto", default-features = false } +winter_math = { version = "0.6", package = "winter-math", default-features = false } +winter_utils = { version = "0.6", package = "winter-utils", default-features = false } [dev-dependencies] criterion = { version = "0.4", features = ["html_reports"] } proptest = "1.1.0" -rand_utils = { version = "0.5", package = "winter-rand-utils" } +rand_utils = { version = "0.6", package = "winter-rand-utils" } diff --git a/LICENSE b/LICENSE index b29a140..c6fe12c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Polygon Miden +Copyright (c) 2023 Polygon Miden Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index e01e1f2..f595325 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ For performance benchmarks of these hash functions and their comparison to other * `MerkleTree`: a regular fully-balanced binary Merkle tree. The depth of this tree can be at most 64. * `SimpleSmt`: a Sparse Merkle Tree, mapping 63-bit keys to 4-element leaf values. * `MerklePathSet`: a collection of Merkle authentication paths all resolving to the same root. The length of the paths can be at most 64. +* `MerkleStore`: a collection of Merkle trees of different heights designed to efficiently store trees with common subtrees. The module also contains additional supporting components such as `NodeIndex`, `MerklePath`, and `MerkleError` to assist with tree indexation, opening proofs, and reporting inconsistent arguments/state. diff --git a/src/hash/blake/mod.rs b/src/hash/blake/mod.rs index 5255228..eb07ad6 100644 --- a/src/hash/blake/mod.rs +++ b/src/hash/blake/mod.rs @@ -290,7 +290,7 @@ where let digest = if Felt::IS_CANONICAL { blake3::hash(E::elements_as_bytes(elements)) } else { - let base_elements = E::as_base_elements(elements); + let base_elements = E::slice_as_base_elements(elements); let blen = base_elements.len() << 3; let mut bytes = unsafe { uninit_vector(blen) }; diff --git a/src/hash/rpo/mod.rs b/src/hash/rpo/mod.rs index 1cde967..95f2c97 100644 --- a/src/hash/rpo/mod.rs +++ b/src/hash/rpo/mod.rs @@ -212,7 +212,7 @@ impl ElementHasher for Rpo256 { fn hash_elements>(elements: &[E]) -> Self::Digest { // convert the elements into a list of base field elements - let elements = E::as_base_elements(elements); + let elements = E::slice_as_base_elements(elements); // initialize state to all zeros, except for the first element of the capacity part, which // is set to 1 if the number of elements is not a multiple of RATE_WIDTH.