We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b6be49d commit bb6a03aCopy full SHA for bb6a03a
1 file changed
packages/binary-merkle-root/src/lib.nr
@@ -17,6 +17,9 @@ pub fn binary_merkle_root<let MAX_DEPTH: u32>(
17
// Start from the leaf node
18
let mut node = leaf;
19
20
+ // Validate that the provided depth does not exceed the static MAX_DEPTH
21
+ assert(depth <= MAX_DEPTH);
22
+
23
// Iterate through the Merkle proof up to MAX_DEPTH
24
for i in 0..MAX_DEPTH {
25
// Only compute hash if the current level is within the tree depth
0 commit comments