mirror of
https://github.com/arnaucube/miden-crypto.git
synced 2026-01-11 08:31:30 +01:00
feat: add parent node iterator for SimpleSMT
This commit is contained in:
@@ -281,13 +281,12 @@ impl MerkleStore {
|
||||
I: Iterator<Item = (u64, Word)> + ExactSizeIterator,
|
||||
{
|
||||
let smt = SimpleSmt::new(depth)?.with_leaves(entries)?;
|
||||
for branch in smt.branches.values() {
|
||||
let parent = Rpo256::merge(&[branch.left, branch.right]);
|
||||
for node in smt.inner_nodes() {
|
||||
self.nodes.insert(
|
||||
parent,
|
||||
node.value.into(),
|
||||
Node {
|
||||
left: branch.left,
|
||||
right: branch.right,
|
||||
left: node.left.into(),
|
||||
right: node.right.into(),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user