-
Notifications
You must be signed in to change notification settings - Fork 5
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 bls12381 #1
Conversation
|
||
func init() { | ||
// Reserve 1 core for general application work | ||
maxProcs := runtime.GOMAXPROCS(0) - 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uber go maxprocs is good here
curves/bls12381/secret_key.go
Outdated
func RandKey() (SecretKey, error) { | ||
// Generate 32 bytes of randomness | ||
var ikm [32]byte | ||
_, err := rand.NewGenerator().Read(ikm[:]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can one liner this
curves/bls12381/secret_key.go
Outdated
} | ||
|
||
func (s *bls12SecretKey) Sign(msg []byte) SignatureI { | ||
signature := new(blstSignature).Sign(s.p, msg, dst) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can 1 liner
curves/bls12381/secret_key.go
Outdated
|
||
// Marshal a secret key into a LittleEndian byte slice. | ||
func (s *bls12SecretKey) Marshal() []byte { | ||
keyBytes := s.p.Serialize() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 liner
|
||
// bls12SecretKey used in the BLS signature scheme. | ||
type bls12SecretKey struct { | ||
p *blst.SecretKey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a downside to embedding this?
This pr adds bls12381 to a curves pkg in order to be reused by comet and Cosmos SDK