mirror of
https://github.com/tornadocash/tornado-core.git
synced 2025-04-26 09:59:27 -04:00
Merge branch 'master' of github.com:poma/mixer-huyixer
This commit is contained in:
commit
5634c0cfb4
@ -30,7 +30,6 @@ template CommitmentHasher() {
|
|||||||
template Withdraw(levels, rounds) {
|
template Withdraw(levels, rounds) {
|
||||||
signal input root;
|
signal input root;
|
||||||
signal input nullifierHash;
|
signal input nullifierHash;
|
||||||
// TODO: Check if we need some kind of explicit constraints or something for those 2 inputs
|
|
||||||
signal input receiver; // not taking part in any computations
|
signal input receiver; // not taking part in any computations
|
||||||
signal input fee; // not taking part in any computations
|
signal input fee; // not taking part in any computations
|
||||||
signal private input nullifier;
|
signal private input nullifier;
|
||||||
@ -51,6 +50,12 @@ template Withdraw(levels, rounds) {
|
|||||||
tree.pathElements[i] <== pathElements[i];
|
tree.pathElements[i] <== pathElements[i];
|
||||||
tree.pathIndex[i] <== pathIndex[i];
|
tree.pathIndex[i] <== pathIndex[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add hidden signal to make sure that tampering with receiver or fee will invalidate the snark proof
|
||||||
|
// Most likely it is not required, but it's better to stay on the safe side and it only takes 1 constraint
|
||||||
|
// Multiplication is used to prevent optimizer from removing this constraint
|
||||||
|
signal unused;
|
||||||
|
unused <== receiver * fee;
|
||||||
}
|
}
|
||||||
|
|
||||||
component main = Withdraw(16, 220);
|
component main = Withdraw(16, 220);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user