Closed Ssophoclis closed 4 years ago
I am experimenting with the circuit.circom circuit from the circom Tutorial:
template Multiplier() { signal private input a; signal private input b; signal output c; c <== a*b; } component main = Multiplier();
If I provide inputs which are longer than 16 digits such as:
{"a": 13905001134553859943, "b": 2}
the witness.json output is:
[ "1", "27810002269107720192", "13905001134553860096", "2" ]
Notice that the second to last number is the signal a which is 13905001134553860096 instead of 13905001134553859943 and the output signal is 27810002269107720192 instead of 27810002269107719886.
13905001134553860096
13905001134553859943
27810002269107720192
27810002269107719886
I am using "circom": "^0.5.11", "snarkjs": "^0.1.31"
"circom": "^0.5.11", "snarkjs": "^0.1.31"
This is a javascript issue. Javascript truncates integers to 56 bits. You should pass it as String or as BigInt.
I am experimenting with the circuit.circom circuit from the circom Tutorial:
If I provide inputs which are longer than 16 digits such as:
the witness.json output is:
Notice that the second to last number is the signal a which is
13905001134553860096
instead of13905001134553859943
and the output signal is27810002269107720192
instead of27810002269107719886
.I am using
"circom": "^0.5.11", "snarkjs": "^0.1.31"