2020-10-30 19:06:33 +00:00
|
|
|
// Package common provides the BLS interfaces that are implemented by the various BLS wrappers.
|
2020-06-25 00:47:51 +00:00
|
|
|
//
|
|
|
|
// 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.
|
2020-10-30 19:06:33 +00:00
|
|
|
package common
|
2020-06-25 00:47:51 +00:00
|
|
|
|
|
|
|
// SecretKey represents a BLS secret or private key.
|
|
|
|
type SecretKey interface {
|
|
|
|
PublicKey() PublicKey
|
|
|
|
Sign(msg []byte) Signature
|
|
|
|
Marshal() []byte
|
|
|
|
}
|
|
|
|
|
|
|
|
// PublicKey represents a BLS public key.
|
|
|
|
type PublicKey interface {
|
|
|
|
Marshal() []byte
|
|
|
|
Copy() PublicKey
|
|
|
|
Aggregate(p2 PublicKey) PublicKey
|
2020-10-30 19:06:33 +00:00
|
|
|
IsInfinite() bool
|
2020-06-25 00:47:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Signature represents a BLS signature.
|
|
|
|
type Signature interface {
|
|
|
|
Verify(pubKey PublicKey, msg []byte) bool
|
2021-04-02 15:53:08 +00:00
|
|
|
// Deprecated: Use FastAggregateVerify or use this method in spectests only.
|
2020-06-25 00:47:51 +00:00
|
|
|
AggregateVerify(pubKeys []PublicKey, msgs [][32]byte) bool
|
|
|
|
FastAggregateVerify(pubKeys []PublicKey, msg [32]byte) bool
|
2021-07-02 19:27:08 +00:00
|
|
|
Eth2FastAggregateVerify(pubKeys []PublicKey, msg [32]byte) bool
|
2020-06-25 00:47:51 +00:00
|
|
|
Marshal() []byte
|
|
|
|
Copy() Signature
|
|
|
|
}
|