Conversation
millerLoopLines inverts P.Y without a guard, so a G1 point at infinity (0,0) makes Pair, PairingCheck and MillerLoop unsatisfiable on BW6-761. BN254 and BLS12-381 already select yInv=0 for Y=0 (Consensys-Incorporated#1559), which turns the lines for that point into 1. Do the same here.
yelhousni
approved these changes
Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On BW6-761,
Pair,PairingCheckandMillerLoopfail when one of the G1 points is the point at infinity (0,0). gnark-crypto accepts the same inputs.Before:
After: both pass.
millerLoopLinescomputes1/P.Ydirectly. The BN254 and BLS12-381 pairings selectyInv = 0whenP.Y == 0(added in #1559), which makes every line evaluation for that point equal to 1 so the point contributes nothing to the product. BW6-761 didn't get that guard; this adds the same three lines.The BW6-761 pairing row in
internal/stats/latest_stats.csvgoes up by 74 (groth16) / 145 (plonk) constraints and is regenerated.Tests:
TestPairG1Infinity(e(0,Q1)·e(P2,Q2) compared to gnark-crypto) andTestPairingCheckG1Infinity(e(0,Q1)·e(0,Q2) == 1), both failing on master.std/algebra/emulated/sw_bw6761,internal/statsand the BW6-in-BN254 recursion tests pass.