Repository navigation
Conversation
…at a zero or pole
This branch has not been deployed
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.
This PR closes #213
The failing assert is the Weil pairing value, not the Tate one. The test helper
weil_pairingpicks a random point S so the divisors have disjoint support, but it only rules out S = P, -Q and P-Q. The functions built in the Miller loop for f_{r,P} have their zeros and poles at multiples of P, so whenever Q+S or S happens to be a multiple of P (or -S or P-S a multiple of Q),miller_loopskips a zero and a pole together and returns the wrong value without tripping thezeros == 0assert.It changes the following:
S is now redrawn until Q+S and S aren't multiples of P and -S and P-S aren't multiples of Q. That covers the three cases that were excluded before. Only the test helper changes,
pairingitself is fine.To check it I ran
weil_pairing3000 times on the points from case 2. On main 9 of those runs gave the wrong value, with this change 0 did. The pairing tests and fmt pass.