mirror of
https://github.com/tornadocash/tornado-core.git
synced 2024-10-01 01:06:17 -04:00
split extra constraints back to 2
This commit is contained in:
parent
67ebbfbcb4
commit
1498c3a739
@ -51,11 +51,13 @@ template Withdraw(levels, rounds) {
|
|||||||
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
|
// 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 1 constraint
|
// Most likely it is not required, but it's better to stay on the safe side and it only takes 2 constraints
|
||||||
// Multiplication is used to prevent optimizer from removing this constraint
|
// Squares are used to prevent optimizer from removing those constraints
|
||||||
signal unused;
|
signal receiverSquare;
|
||||||
unused <== receiver * fee;
|
signal feeSquare;
|
||||||
|
receiverSquare <== receiver * receiver;
|
||||||
|
feeSquare <== fee * fee;
|
||||||
}
|
}
|
||||||
|
|
||||||
component main = Withdraw(16, 220);
|
component main = Withdraw(16, 220);
|
||||||
|
Loading…
Reference in New Issue
Block a user