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

feat: add IsOnG2 for BN254 #1204

Merged
merged 4 commits into from
Jul 16, 2024
Merged

feat: add IsOnG2 for BN254 #1204

merged 4 commits into from
Jul 16, 2024

Conversation

ivokub
Copy link
Collaborator

@ivokub ivokub commented Jul 16, 2024

Description

This method allows to check for non-membership. In case we need to assert membership it is still more efficient to use AssertIsOnG2 as then we don't have to call IsZero for non-native elements which is more expensive that AssertIsEqual.

@yelhousni - can you recommend better naming for the methods? I think this could generalize to other curves, but right now needed for Linea, so omitted the implementation.

Type of change

  • New feature (non-breaking change which adds functionality)

How has this been tested?

  • TestIsOnTwistSolve
  • TestIsOnG2Solve

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I did not modify files generated from templates
  • golangci-lint does not output errors locally
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@ivokub ivokub added the consolidate strengthen an existing feature label Jul 16, 2024
@ivokub ivokub requested a review from yelhousni July 16, 2024 13:56
@ivokub ivokub self-assigned this Jul 16, 2024
Copy link
Contributor

@yelhousni yelhousni left a comment

Choose a reason for hiding this comment

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

LGTM

std/algebra/emulated/sw_bn254/pairing.go Outdated Show resolved Hide resolved
@ivokub ivokub merged commit 1453c00 into master Jul 16, 2024
7 checks passed
@ivokub ivokub deleted the feat/bn254-nonmembership branch July 16, 2024 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consolidate strengthen an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants