-
Notifications
You must be signed in to change notification settings - Fork 38
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
Bigint arithmetic #4
Conversation
template<mp_size_t n> template<mp_size_t m> | ||
inline bigint<n+m> bigint<n>::operator*(const bigint<m>& other) const | ||
{ | ||
static_assert(n >= m, "first arg must not be smaller than second arg for bigint mul"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this assertion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the documentation of mpn_mul at https://gmplib.org/manual/Low_002dlevel-Functions.html . I thought it was weird too, but didn't want to add the complexity of swapping the arguments when necessary.
ACK no blockers. Awesome work! |
Can this be rebased onto zcash/libsnark's master so that the zcash PR is solid? |
…comparison. Signed-off-by: Daira Hopwood <daira@jacaranda.org>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
937ddc2
to
d65904a
Compare
Rebased. |
Implement zkSNARK compression Implement zkSNARK compression. The serialization format of zkSNARKs has now been specified in our protocol specification. G1/G2 elements are now compressed into 33 byte and 65 byte formats, repsectively. `MONTGOMERY_OUTPUT` is enabled everywhere to make proving/verifying keys load faster and be consistent with the MPC. Proofs are now 296 bytes. This PR also updates the proving and verifying keys. Closes #1103. Closes #471. See also zcash/libsnark#3 and zcash/libsnark#4
Support for bigint addition, multiplication, quotient+remainder, and comparison.