mirror of
https://github.com/tornadocash/tornado-core.git
synced 2024-11-23 18:31:24 +01:00
Add explicit constrains for recepient, relayer and fee
This commit is contained in:
parent
d4e6031982
commit
a533ad9ffb
@ -50,6 +50,18 @@ template Withdraw(levels) {
|
||||
tree.pathElements[i] <== pathElements[i];
|
||||
tree.pathIndices[i] <== pathIndices[i];
|
||||
}
|
||||
|
||||
// Add hidden signals to make sure that tampering with recipient 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 recipientSquare;
|
||||
signal feeSquare;
|
||||
signal relayerSquare;
|
||||
signal refundSquare;
|
||||
recipientSquare <== recipient * recipient;
|
||||
feeSquare <== fee * fee;
|
||||
relayerSquare <== relayer * relayer;
|
||||
refundSquare <== refund * refund;
|
||||
}
|
||||
|
||||
component main = Withdraw(20);
|
||||
|
Loading…
Reference in New Issue
Block a user