Skip to content

feat: added HashToG2 circuit for BLS12-381#481

Closed
weijiguo wants to merge 11 commits intoConsensys:masterfrom
lightec-xyz:lightec_master
Closed

feat: added HashToG2 circuit for BLS12-381#481
weijiguo wants to merge 11 commits intoConsensys:masterfrom
lightec-xyz:lightec_master

Conversation

@weijiguo
Copy link
Copy Markdown

@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
Copy Markdown

CLAassistant commented Jan 28, 2024

CLA assistant check
All committers have signed the CLA.

@weijiguo
Copy link
Copy Markdown
Author

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

@weijiguo
Copy link
Copy Markdown
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
Copy Markdown
Author

weijiguo commented Feb 5, 2025

fptower is still internal, though

@ivokub
Copy link
Copy Markdown
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.

@ivokub
Copy link
Copy Markdown
Collaborator

ivokub commented Apr 9, 2025

More cleanly applied here: #674. There I also expose methods which help with computing the SSWU isogeny.

Closing this pull request for now.

@ivokub ivokub closed this Apr 9, 2025
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