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

Bigint arithmetic #4

Closed
wants to merge 2 commits into from
Closed

Bigint arithmetic #4

wants to merge 2 commits into from

Conversation

daira
Copy link

@daira daira commented Aug 22, 2016

Support for bigint addition, multiplication, quotient+remainder, and comparison.

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");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this assertion?

Copy link
Author

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.

@ebfull
Copy link

ebfull commented Aug 22, 2016

ACK no blockers. Awesome work!

@ebfull
Copy link

ebfull commented Aug 22, 2016

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>
@daira
Copy link
Author

daira commented Aug 22, 2016

Rebased.

zkbot pushed a commit to zcash/zcash that referenced this pull request Aug 23, 2016
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
@ebfull ebfull closed this Sep 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants