Open noresistence opened 5 years ago
This warning was introduced in #22, to warn about constraints with coefficients larger than the prime p of the underlying prime field used by the backend. Any coefficients or outputs of your computation that are larger than this will be reduced modulo p, which might not be what you expect if you're working with very large values.
Note for the default BN128 curve, the parameters are defined here (bn128_modulus_r
is 253 bits).
What does
WARNING: Coefficient larger than prime
during setup mean? I just ran my code with a moderately larger input size than usual, and got 5MB worth of this warning in my output. The setup finishes without errors, though.Now I want to know: what effect has this warning? What might happen if I choose to ignore it? Will the resulting zk-SNARK not fulfill mathematical properties that it should? Or is this an issue that is not a big problem, because the size of coefficients will be reduced to a 'safe' size later in the process?
EDIT: for the record, the following steps (input generation, proof, verification) all complete successfully without warnings or errors and with the expected results.