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

Bump versions and misc tweaks #51

Merged
merged 1 commit into from
Oct 15, 2023
Merged

Conversation

Pratyush
Copy link
Member

Description

closes: #XXXX


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (master)
  • Linked to Github issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer

@Pratyush Pratyush requested a review from a team as a code owner October 14, 2023 20:31
@Pratyush Pratyush requested review from z-tech, mmagician and weikengchen and removed request for a team October 14, 2023 20:31
@weikengchen weikengchen merged commit c7e8ade into master Oct 15, 2023
4 checks passed
@weikengchen weikengchen deleted the bump-version-and-fixes branch October 15, 2023 02:10
@@ -63,7 +63,7 @@ impl<E: Pairing, QAP: R1CSToQAP> Groth16<E, QAP> {
let h_assignment = cfg_into_iter!(h)
.map(|s| s.into_bigint())
.collect::<Vec<_>>();
let h_acc = E::G1::msm_bigint(&pk.h_query, &h_assignment);
let h_acc = E::G1::msm_bigint(&pk.h_query, &h_assignment[..h_assignment.len() - 1]);
Copy link
Member

Choose a reason for hiding this comment

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

This broke the tests in arkworks-rs/circom-compat#68

@Pratyush I think the reasoning behind this change was that pk.h_query typically has domain - 1 elements right? In which case h_assignment is of length = domain, but the last element is 0.

For some reason, the proving key imported from a .zkey file has length = domain. I'm going to investigate later, but I'm dropping the info here as I go along, maybe you have a clue as for this difference.

cc @jbaylina

Copy link
Member Author

@Pratyush Pratyush Jul 17, 2024

Choose a reason for hiding this comment

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

I think we would need to change to use msm_unchecked, or something that doesn't check length equality, because the arkworks Groth16 is of length domain - 1. This is because $z_a \cdot z_b - z_c$ is of degree at most 2 * domain - 2, and so $h = (z_a \cdot z_b - z_c)/v_H$ is of degree at most domain - 2 and hence requires domain - 1 coefficients.

Regarding what to replace msm_bigint with, I don't remember if msm_bigint panics when the input lengths are equal or not...

Copy link
Member

Choose a reason for hiding this comment

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

msm_bigint works fine, it just takes the min length of the two. In arkworks-groth witness calculation this will be domain-1 but in circom, both inputs will be of length domain.

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

Successfully merging this pull request may close these issues.

3 participants