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: added HashToG2 circuit for BLS12-381 #481

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

weijiguo
Copy link

@weijiguo weijiguo commented Jan 28, 2024

Description

This PR exposes the g2SqrtRatio function as G2SqrtRatio so that it could be used as a hint in gnark to calculate the HashToG2 circuit for BLS12-381.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

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

How has this been tested?

  • Tested in the gnark library as part of the HashToG2 function for BLS12-381.

How has this been benchmarked?

No.

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

@CLAassistant
Copy link

CLAassistant commented Jan 28, 2024

CLA assistant check
All committers have signed the CLA.

@weijiguo
Copy link
Author

This PR is part of efforts to address Consensys/gnark#648

@weijiguo
Copy link
Author

weijiguo commented Feb 5, 2025

Hi @ivokub I am now trying to deal with the issue you mentioned earlier about modifying the generated file instead of the template: Consensys/gnark#1040 (comment)

While I attempt to change the template function name from {{$CurveName}}SqrtRatio to {{$CurveTitle}}SqrtRatio, I realize that I might also need to run the generator and update the generated codes as well. Is this what you would expect?

Also, g1SqrtRatio function names are also updated after code generation. Is this OK? Do you want to update the copyright year as well (current value is 2020).

Please ping back.

Thanks,
Weiji

@weijiguo
Copy link
Author

weijiguo commented Feb 5, 2025

fptower is still internal, though

@ivokub
Copy link
Collaborator

ivokub commented Feb 6, 2025

Hi @ivokub I am now trying to deal with the issue you mentioned earlier about modifying the generated file instead of the template: Consensys/gnark#1040 (comment)

While I attempt to change the template function name from {{$CurveName}}SqrtRatio to {{$CurveTitle}}SqrtRatio, I realize that I might also need to run the generator and update the generated codes as well. Is this what you would expect?

Also, g1SqrtRatio function names are also updated after code generation. Is this OK? Do you want to update the copyright year as well (current value is 2020).

Please ping back.

Thanks, Weiji

Thanks, I'll have a look.

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.

3 participants