Skip to content

Commit

Permalink
Merge pull request #212 from 0xbok/patch-1
Browse files Browse the repository at this point in the history
add a warning for `depth > MAX_DEPTH`
  • Loading branch information
cedoor authored Mar 18, 2024
2 parents 215dfb3 + 749de51 commit fb61c04
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/circuits/circom/binary-merkle-root.circom
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ include "comparators.circom";
// receives a dynamic depth as an input, which is utilized in calculating the
// true root of the Merkle tree. The actual depth of the Merkle tree
// may be equal to or less than the static maximum depth.
// NOTE: This circuit will successfully verify `out = 0` for `depth > MAX_DEPTH`.
// Make sure to enforce `depth <= MAX_DEPTH` outside the circuit.
template BinaryMerkleRoot(MAX_DEPTH) {
signal input leaf, depth, indices[MAX_DEPTH], siblings[MAX_DEPTH];

Expand Down

0 comments on commit fb61c04

Please sign in to comment.