github.com/prysmaticlabs/prysm@v1.4.4/shared/bls/common/interface.go (about)

     1  // Package common provides the BLS interfaces that are implemented by the various BLS wrappers.
     2  //
     3  // This package should not be used by downstream consumers. These interfaces are re-exporter by
     4  // github.com/prysmaticlabs/prysm/shared/bls. This package exists to prevent an import circular
     5  // dependency.
     6  package common
     7  
     8  // SecretKey represents a BLS secret or private key.
     9  type SecretKey interface {
    10  	PublicKey() PublicKey
    11  	Sign(msg []byte) Signature
    12  	Marshal() []byte
    13  }
    14  
    15  // PublicKey represents a BLS public key.
    16  type PublicKey interface {
    17  	Marshal() []byte
    18  	Copy() PublicKey
    19  	Aggregate(p2 PublicKey) PublicKey
    20  	IsInfinite() bool
    21  }
    22  
    23  // Signature represents a BLS signature.
    24  type Signature interface {
    25  	Verify(pubKey PublicKey, msg []byte) bool
    26  	// Deprecated: Use FastAggregateVerify or use this method in spectests only.
    27  	AggregateVerify(pubKeys []PublicKey, msgs [][32]byte) bool
    28  	FastAggregateVerify(pubKeys []PublicKey, msg [32]byte) bool
    29  	Eth2FastAggregateVerify(pubKeys []PublicKey, msg [32]byte) bool
    30  	Marshal() []byte
    31  	Copy() Signature
    32  }