Merge pull request #114 from 0xPolygonMiden/v0.2.0-release-prep Prepare v0.2 release
Bobbin Threadbare 43513081+bobbinth@users.noreply.github.com
Fri, 24 Mar 2023 23:50:41 -0700
6 files changed,
17 insertions(+),
9 deletions(-)
M
CHANGELOG.md
→
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)
M
Cargo.toml
→
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" }
M
README.md
→
README.md
@@ -15,6 +15,7 @@
* `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.
M
src/hash/blake/mod.rs
→
src/hash/blake/mod.rs
@@ -290,7 +290,7 @@ // this is a compile-time branch so it is for free
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) };
M
src/hash/rpo/mod.rs
→
src/hash/rpo/mod.rs
@@ -212,7 +212,7 @@ type BaseField = Felt;
fn hash_elements<E: FieldElement<BaseField = Self::BaseField>>(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.