mirror of
https://github.com/tornadocash/tornado-core.git
synced 2024-12-23 09:44:25 +01:00
remove explicit constraints on inputs
This commit is contained in:
parent
0484408e82
commit
9efab84e65
@ -31,9 +31,9 @@ template Withdraw(levels, rounds) {
|
||||
signal input root;
|
||||
signal input nullifierHash;
|
||||
signal input receiver; // not taking part in any computations
|
||||
signal input relayer; // not taking part in any computations
|
||||
signal input fee; // not taking part in any computations
|
||||
signal input refund; // not taking part in any computations
|
||||
signal input relayer; // not taking part in any computations
|
||||
signal input fee; // not taking part in any computations
|
||||
signal input refund; // not taking part in any computations
|
||||
signal private input nullifier;
|
||||
signal private input secret;
|
||||
signal private input pathElements[levels];
|
||||
@ -52,18 +52,6 @@ template Withdraw(levels, rounds) {
|
||||
tree.pathElements[i] <== pathElements[i];
|
||||
tree.pathIndex[i] <== pathIndex[i];
|
||||
}
|
||||
|
||||
// Add hidden signals 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 2 constraints
|
||||
// Squares are used to prevent optimizer from removing those constraints
|
||||
signal receiverSquare;
|
||||
signal feeSquare;
|
||||
signal relayerSquare;
|
||||
signal refundSquare;
|
||||
receiverSquare <== receiver * receiver;
|
||||
feeSquare <== fee * fee;
|
||||
relayerSquare <== relayer * relayer;
|
||||
refundSquare <== refund * refund;
|
||||
}
|
||||
|
||||
component main = Withdraw(16, 220);
|
||||
|
Loading…
Reference in New Issue
Block a user