prysm-pulse/shared/bls/common/interface.go
Nishant Das 211d9bc0b9
Update BLST And Herumi (#7632)
* fix build from source

* clean up

* update again

* change everything

* workaround for now

* fix versioning

* all passing now

* fix build issues

* clean up

* revert use of MulVerify

* gaz

* stub

* Apply suggestions from code review

Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>

* fix all

* fix test

* todo

* fix stub

* revert back

* make deep source happy

* Update shared/bls/herumi/public_key.go

* Update shared/bls/blst/signature.go

* Update shared/bls/blst/signature_test.go

* imports

* move iface to common, export errors

* rm iface build

Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
Co-authored-by: terence tsao <terence@prysmaticlabs.com>
2020-10-30 19:06:33 +00:00

32 lines
921 B
Go

// Package common provides the BLS interfaces that are implemented by the various BLS wrappers.
//
// This package should not be used by downstream consumers. These interfaces are re-exporter by
// github.com/prysmaticlabs/prysm/shared/bls. This package exists to prevent an import circular
// dependency.
package common
// SecretKey represents a BLS secret or private key.
type SecretKey interface {
PublicKey() PublicKey
Sign(msg []byte) Signature
Marshal() []byte
IsZero() bool
}
// PublicKey represents a BLS public key.
type PublicKey interface {
Marshal() []byte
Copy() PublicKey
Aggregate(p2 PublicKey) PublicKey
IsInfinite() bool
}
// Signature represents a BLS signature.
type Signature interface {
Verify(pubKey PublicKey, msg []byte) bool
AggregateVerify(pubKeys []PublicKey, msgs [][32]byte) bool
FastAggregateVerify(pubKeys []PublicKey, msg [32]byte) bool
Marshal() []byte
Copy() Signature
}