pepper-project / pequin

A system for verifying outsourced computations, and applying SNARKs. Simplified release of the main Pepper codebase.
Other
122 stars 46 forks source link

fix assert_zero to pass if Y == p #44

Closed fleupold closed 5 years ago

fleupold commented 5 years ago

Currently ASSERT_ZERO(n) is not taking n % p and thus would return false e.g. for n = p (which is in fact 0 % p).

This change converts the value we compare to 0 into an mpz_t (which does the modulo operation) and adds a slightly more convenient error message, in case the assert fails.