From 0c4c27b7b68a087a6664e65a5f14a6eb3fd7e433 Mon Sep 17 00:00:00 2001 From: poma Date: Sun, 24 Nov 2019 13:29:14 +0400 Subject: [PATCH 1/2] remove `private` modifiers from non-main templates --- circuits/merkleTree.circom | 4 ++-- circuits/withdraw.circom | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/circuits/merkleTree.circom b/circuits/merkleTree.circom index 1764f14..329f9dc 100644 --- a/circuits/merkleTree.circom +++ b/circuits/merkleTree.circom @@ -29,8 +29,8 @@ template DualMux() { template MerkleTree(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]; diff --git a/circuits/withdraw.circom b/circuits/withdraw.circom index 8bf83fc..4d803fc 100644 --- a/circuits/withdraw.circom +++ b/circuits/withdraw.circom @@ -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; From a58d60623b522749aa5fad53240e25f750249bda Mon Sep 17 00:00:00 2001 From: poma Date: Sun, 24 Nov 2019 13:29:57 +0400 Subject: [PATCH 2/2] rename MerkleTree to make more clear that it has no output --- circuits/merkleTree.circom | 2 +- circuits/withdraw.circom | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/circuits/merkleTree.circom b/circuits/merkleTree.circom index 329f9dc..afcd178 100644 --- a/circuits/merkleTree.circom +++ b/circuits/merkleTree.circom @@ -26,7 +26,7 @@ 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 input pathElements[levels]; diff --git a/circuits/withdraw.circom b/circuits/withdraw.circom index 4d803fc..d92a324 100644 --- a/circuits/withdraw.circom +++ b/circuits/withdraw.circom @@ -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++) {