Skip to content

Commit

Permalink
Assigner exit check constraint added to merkle path validation example.
Browse files Browse the repository at this point in the history
  • Loading branch information
nkaskov committed Nov 17, 2023
1 parent aee6e10 commit 3670452
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/cpp/validate_merkle_path_sha2_256.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ bool is_same(typename hashes::sha2<256>::block_type block0,
return block0[0] == block1[0] && block0[1] == block1[1];
}

[[circuit]] bool
[[circuit]] void
validate_path(std::array<typename hashes::sha2<256>::block_type, 0x05> merkle_path,
typename hashes::sha2<256>::block_type leave,
typename hashes::sha2<256>::block_type root) {
Expand All @@ -20,5 +20,5 @@ bool is_same(typename hashes::sha2<256>::block_type block0,
subroot = hash<hashes::sha2<256>>(subroot, merkle_path[i]);
}

return is_same(subroot, root);
__builtin_assigner_exit_check(is_same(subroot, root));
}

0 comments on commit 3670452

Please sign in to comment.