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 BLS signature scheme #314

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

Feat: Add BLS signature scheme #314

wants to merge 15 commits into from

Conversation

yelhousni
Copy link
Collaborator

No description provided.

@yelhousni
Copy link
Collaborator Author

Needs #312 and #313 to be merged

@yelhousni yelhousni self-assigned this Apr 5, 2023
@yelhousni yelhousni added new feature consolidate strengthen an existing feature labels Apr 5, 2023
@yelhousni yelhousni added this to the v0.10.0 milestone Apr 5, 2023
@yelhousni yelhousni requested a review from ivokub April 5, 2023 14:12
@sandritis2
Copy link

@gbotrel gbotrel changed the base branch from develop to master August 22, 2023 21:08
@samlaf
Copy link

samlaf commented Aug 25, 2023

Any ETA on when you guys think this is going to get merged?

@yelhousni
Copy link
Collaborator Author

Any ETA on when you guys think this is going to get merged?

The scheme is pretty much implemented (just need to be rebased on top of last master). The PR review was delayed because of other high priority work (Linea related) popped up. I hope we can go back to this soon!

@samlaf
Copy link

samlaf commented Sep 16, 2023

Been playing with this library a bit. I'm curious, why is there no aggregation function on PublicKey and Signature structs? The only way I could find to do aggregation was this clumsy way:

func main() {
	msg := []byte("testing BLS aggregation")

	sk1, _ := bls.GenerateKey(rand.Reader)
	pk1 := sk1.PublicKey
	sig1Bytes, _ := sk1.Sign(msg, nil)
	sig1 := new(bls.Signature)
	_, err := sig1.SetBytes(sig1Bytes)
	if err != nil {
		panic(err)
	}

	sk2, _ := bls.GenerateKey(rand.Reader)
	pk2 := sk2.PublicKey
	sig2Bytes, _ := sk2.Sign(msg, nil)
	sig2 := new(bls.Signature)
	_, err = sig2.SetBytes(sig2Bytes)
	if err != nil {
		panic(err)
	}

	aggPk := new(bls.PublicKey)
	aggPk.A.Set(pk1.A.Add(&pk1.A, &pk2.A))
	aggSig := new(bls.Signature)
	aggSig.S.Set(sig1.S.Add(&sig1.S, &sig2.S))

	ok, err := aggPk.Verify(aggSig.Bytes(), msg, nil)
	if err != nil {
		panic(err)
	}
	fmt.Println("Signature verified?", ok)
}

Am I doing something wrong?

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

Successfully merging this pull request may close these issues.

None yet

3 participants