feat: refactor simple smt to use empty subtree constants

Prior to this commit, there was an internal procedure with the merkle
trees to compute empty sub-tree for arbitrary depths.

However, this isn't ideal as this code can be reused in any merkle
implementation that uses RPO as backend.

This commit introduces a structure that will generate these empty
subtrees values.
This commit is contained in:
Victor Lopez
2023-02-19 18:30:57 +01:00
parent 7ffa0cd97d
commit 3a6a4fcce6
6 changed files with 560 additions and 77 deletions

View File

@@ -18,7 +18,7 @@ fn smt_rpo(c: &mut Criterion) {
(i, word)
})
.collect();
let tree = SimpleSmt::new(entries, depth).unwrap();
let tree = SimpleSmt::new(depth).unwrap().with_leaves(entries).unwrap();
trees.push(tree);
}
}