Merge pull request #26 from peppersec/audit-circuit-fix-2

Audit circuit fix 2
This commit is contained in:
Pertsev Alexey 2019-11-25 19:46:25 +03:00 committed by GitHub
commit 2de4f9c721
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -26,11 +26,11 @@ template DualMux() {
// Verifies that merkle proof is correct for given merkle root and a leaf
// pathIndices input is an array of 0/1 selectors telling whether given pathElement is on the left or right side of merkle path
template MerkleTree(levels) {
template MerkleTreeChecker(levels) {
signal input leaf;
signal input root;
signal private input pathElements[levels];
signal private input pathIndices[levels];
signal input pathElements[levels];
signal input pathIndices[levels];
component selectors[levels];
component hashers[levels];

View File

@ -4,8 +4,8 @@ include "merkleTree.circom";
// computes Pedersen(nullifier + secret)
template CommitmentHasher() {
signal private input nullifier;
signal private input secret;
signal input nullifier;
signal input secret;
signal output commitment;
signal output nullifierHash;
@ -43,7 +43,7 @@ template Withdraw(levels) {
hasher.secret <== secret;
hasher.nullifierHash === nullifierHash;
component tree = MerkleTree(levels);
component tree = MerkleTreeChecker(levels);
tree.leaf <== hasher.commitment;
tree.root <== root;
for (var i = 0; i < levels; i++) {