mirror of
https://github.com/tornadocash/tornado-core.git
synced 2024-11-22 01:37:07 +01:00
Merge pull request #26 from peppersec/audit-circuit-fix-2
Audit circuit fix 2
This commit is contained in:
commit
2de4f9c721
@ -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];
|
||||
|
@ -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++) {
|
||||
|
Loading…
Reference in New Issue
Block a user