Skip to content

Fix logic mismatch in newR1C for better Groth16 optimization #1482

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tomasandroil
Copy link

Previously, the comment suggested that the goal was to minimize the number of variables in the B matrix, but the implementation did the opposite — swapping L and R when L was longer. This PR corrects the condition to match the intended optimization logic, aligning with Groth16 performance best practices.

Fixes # (no issue number yet)


Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

  • Manual inspection of Groth16 output matrices
  • Unit test (TBD - logic is straightforward but may benefit from regression test)

@gbotrel gbotrel requested a review from ThomasPiellard April 22, 2025 13:03
@gbotrel
Copy link
Collaborator

gbotrel commented Apr 22, 2025

@ThomasPiellard can you check that one? I recall empirically, the code as is (before this PR) actually produce better perf

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.

2 participants