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:
Victor Lopez 2023-03-23 12:54:28 +01:00
parent c79351be99
commit 2ff96f40cb
No known key found for this signature in database
GPG key ID: 30561C13ED62BE9F

File diff suppressed because it is too large Load diff