mirror of
https://github.com/tornadocash/tornado-nova
synced 2024-02-02 14:53:56 +01:00
remove input range check
This commit is contained in:
parent
98b2e238b9
commit
5b9f1567e7
@ -43,7 +43,6 @@ template Transaction(levels, nIns, nOuts, zeroLeaf) {
|
|||||||
component inKeypair[nIns];
|
component inKeypair[nIns];
|
||||||
component inUtxoHasher[nIns];
|
component inUtxoHasher[nIns];
|
||||||
component nullifierHasher[nIns];
|
component nullifierHasher[nIns];
|
||||||
component inAmountCheck[nIns];
|
|
||||||
component tree[nIns];
|
component tree[nIns];
|
||||||
component checkRoot[nIns];
|
component checkRoot[nIns];
|
||||||
var sumIns = 0;
|
var sumIns = 0;
|
||||||
@ -77,9 +76,9 @@ template Transaction(levels, nIns, nOuts, zeroLeaf) {
|
|||||||
checkRoot[tx].in[1] <== tree[tx].root;
|
checkRoot[tx].in[1] <== tree[tx].root;
|
||||||
checkRoot[tx].enabled <== inAmount[tx];
|
checkRoot[tx].enabled <== inAmount[tx];
|
||||||
|
|
||||||
// Check that amount fits into 248 bits to prevent overflow
|
// We don't need to range check input amounts, since all inputs are valid UTXOs that
|
||||||
inAmountCheck[tx] = Num2Bits(248);
|
// were already checked as outputs in the previous transaction (or zero amount UTXOs that don't
|
||||||
inAmountCheck[tx].in <== inAmount[tx];
|
// need to be checked either).
|
||||||
|
|
||||||
sumIns += inAmount[tx];
|
sumIns += inAmount[tx];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user