Documentation
¶
Overview ¶
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.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInfinitePubKey = errors.New("received an infinite public key")
ErrInfinitePubKey describes an error due to an infinite public key.
var ErrInfiniteSignature = errors.New("received an infinite signature")
ErrInfiniteSignature describes an error due to an infinite signature.
var ErrSecretUnmarshal = errors.New("could not unmarshal bytes into secret key")
ErrSecretUnmarshal describes an error which happens during unmarshalling a secret key.
var ErrZeroKey = errors.New("received secret key is zero")
ErrZeroKey describes an error due to a zero secret key.
var InfinitePublicKey = [48]byte{0xC0}
InfinitePublicKey represents an infinite public key.
var ZeroSecretKey = [32]byte{}
ZeroSecretKey represents a zero secret key.
Functions ¶
This section is empty.
Types ¶
type Implementation ¶
type Implementation interface {
SecretKeyFromBytes(privKey []byte) (SecretKey, error)
PublicKeyFromBytes(pubKey []byte) (PublicKey, error)
SignatureFromBytes(sig []byte) (Signature, error)
AggregatePublicKeys(pubs [][]byte) (PublicKey, error)
Aggregate(sigs []Signature) Signature
AggregateSignatures(sigs []Signature) Signature
NewAggregateSignature() Signature
RandKey() (SecretKey, error)
}
Implementation represents a BLS signatures implementation
type PublicKey ¶
type PublicKey interface {
Marshal() []byte
Copy() PublicKey
Aggregate(p2 PublicKey) PublicKey
Hash() ([20]byte, error)
ToAccount(prefix *params.AccountPrefixes) string
}
PublicKey represents a BLS public key.
type Rand ¶
Rand is alias for underlying random generator.
func NewGenerator ¶
func NewGenerator() *Rand
NewGenerator returns a new generator that uses random values from crypto/rand as a source (cryptographically secure random number generator). Panics if crypto/rand input cannot be read. Use it for everything where crypto secure non-deterministic randomness is required. Performance takes a hit, so use sparingly.