feat: add empty subtree constants to cover u8::MAX depth
Prior to this commit, we limited the constants count to 64 for the empty subtrees depth computation. This is a hard-assumption that every tree of Miden will have a depth up to 64 - and will cause undefined behavior if it doesn't. With the introduction of `MerkleStore::merge_roots` and the deprecation of `mtree_cwm` instruction from the VM, this assumption is broken and the user might end with trees with depth greater than 64. This broken assumption could lead to attack vectors. We can easily fix that by extending the pre-computed hashes list to the maximum of `u8` (i.e. 255). This will have zero impact on functionality, and will be completely safe to use without hard assumptions.
This commit is contained in:
parent
c79351be99
commit
2ff96f40cb
1 changed files with 1409 additions and 278 deletions
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue