Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARNING: Coefficient larger than prime #62

Open
noresistence opened this issue Jun 26, 2019 · 1 comment
Open

WARNING: Coefficient larger than prime #62

noresistence opened this issue Jun 26, 2019 · 1 comment

Comments

@noresistence
Copy link

noresistence commented Jun 26, 2019

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.

@maxhowald
Copy link
Contributor

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants