Skip to content

feat: subgroup G1/G2 membership BW6-761 and BLS12-377#1030

Merged
yelhousni merged 7 commits intomasterfrom
feat/bw6-subgroupcheck
Feb 9, 2024
Merged

feat: subgroup G1/G2 membership BW6-761 and BLS12-377#1030
yelhousni merged 7 commits intomasterfrom
feat/bw6-subgroupcheck

Conversation

@yelhousni
Copy link
Copy Markdown
Contributor

@yelhousni yelhousni commented Jan 31, 2024

Description

This PR adds G1 and G2 subgroup memberships for BW6-761. It's up to the user to call these circuits for example before a pairing call.

Type of change

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

How has this been tested?

Added new tests for subgroup membership tests.

How has this been benchmarked?

  • For BLS12-377:
G1 curve membership G2 curve membership G1 subgroup membership G2 subgroup membership
SCS 11 32 971 2,267

So a total of 3,280 (without separate equality checks of each sub-circuit) if we want to test all membership for e.g. before a pairing circuit.

  • For BW6-761:
G1 curve membership G2 curve membership G1 subgroup membership G2 subgroup membership
SCS 15,412 15,390 1,210,276 1,210,276

So a total of 2,189,173 (without separate equality checks of each sub-circuit) if we want to test all membership for e.g. before a pairing circuit.

N.B.: note that for KZG verifier we (might) only need G1 membership as G2 points are fixed and corresponding lines pre-computed in the SRS.

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

@yelhousni yelhousni added this to the v0.9.0 milestone Jan 31, 2024
@yelhousni yelhousni requested a review from ivokub January 31, 2024 17:50
@yelhousni yelhousni self-assigned this Jan 31, 2024
@yelhousni yelhousni changed the title feat: subgroup G1/G2 membership BW6-761 feat: subgroup G1/G2 membership BW6-761 and BLS12-377 Feb 1, 2024
@yelhousni yelhousni requested a review from gbotrel February 1, 2024 19:27
Copy link
Copy Markdown
Collaborator

@ivokub ivokub left a comment

Choose a reason for hiding this comment

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

Looks good. For sw_bw6761 package we also have doc_test.go for the runnable example. Maybe we can add the group membership test there? Right now we only have a comment that we do not check the membership.

@yelhousni
Copy link
Copy Markdown
Contributor Author

Looks good. For sw_bw6761 package we also have doc_test.go for the runnable example. Maybe we can add the group membership test there? Right now we only have a comment that we do not check the membership.

Added 👍

@yelhousni yelhousni merged commit 05e1e93 into master Feb 9, 2024
@yelhousni yelhousni deleted the feat/bw6-subgroupcheck branch February 9, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants