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

Add gnark as bls-12-381 backend #551

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

Conversation

Kubuxu
Copy link
Contributor

@Kubuxu Kubuxu commented Sep 18, 2024

Given that kilic is deprecated (and caused us some issues recently), I'm opening this PR with BLS-12-381 backend using https://github.com/Consensys/gnark-crypto/
The Gnark's BLS-12-381 code was audited in the past (but there have been changes to it since), and it is actively maintained.

Signing performance on G2 is comparable to kilic, while the signing on G1 and public key aggregation performance is better than both circl and kilic.
https://gist.github.com/Stebalien/d6268b5c1abc4aa29857cf7787b205e8

Signed-off-by: Jakub Sztandera <[email protected]>
Copy link

🔒 Could not start CI tests due to missing safe PR label. Please contact a DEDIS maintainer.

Errcheck was already not checking other impls

Signed-off-by: Jakub Sztandera <[email protected]>
Copy link

Stebalien added a commit to filecoin-project/go-f3 that referenced this pull request Sep 22, 2024
It's probably going to take a while for upstream to merge the changes so
we're importing just the changed package (BDN) and the new
package (Gnark) into this repo. That way we avoid forking the entire
repo but can still import our changes.

Any changes to these pacakges should be submitted as PRs to upstream
_first_, then backported to this repo.

Includes:

- dedis/kyber#546
- dedis/kyber#551
- dedis/kyber#553
Stebalien added a commit to filecoin-project/go-f3 that referenced this pull request Sep 22, 2024
It's probably going to take a while for upstream to merge the changes so
we're importing just the changed package (BDN) and the new
package (Gnark) into this repo. That way we avoid forking the entire
repo but can still import our changes.

Any changes to these pacakges should be submitted as PRs to upstream
_first_, then backported to this repo.

Includes:

- dedis/kyber#546
- dedis/kyber#551
- dedis/kyber#553
Stebalien added a commit to filecoin-project/go-f3 that referenced this pull request Sep 23, 2024
It's probably going to take a while for upstream to merge the changes so
we're importing just the changed package (BDN) and the new
package (Gnark) into this repo. That way we avoid forking the entire
repo but can still import our changes.

Any changes to these pacakges should be submitted as PRs to upstream
_first_, then backported to this repo.

Includes:

- dedis/kyber#546
- dedis/kyber#551
- dedis/kyber#553
pairing/bls12381/gnark/g1.go Show resolved Hide resolved
pairing/bls12381/gnark/g2.go Show resolved Hide resolved
privhex := suite.Scalar()
err = privhex.UnmarshalBinary(privkey)
require.Nil(t, err)

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add an equality test for pubkey vs pubhex and priveky vs privhex to make sure the points are still the same?

Copy link
Contributor

Choose a reason for hiding this comment

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

@Kubuxu Does your 👍🏻 mean you'll be adding the test or should we do it ourselves?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fell off from my stack, going to try to get it done soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants