Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ID ¶
func (*ID) GetHexString ¶
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
PrivateKey is a private key in Ethereum 2. It is a point on the BLS12-381 curve.
func EmptyPrivateKey ¶
func EmptyPrivateKey() *PrivateKey
func GeneratePrivateKey ¶
func GeneratePrivateKey() (*PrivateKey, error)
GeneratePrivateKey generates a random BLS private key.
func PrivateKeyFromBytes ¶
func PrivateKeyFromBytes(priv []byte) (*PrivateKey, error)
PrivateKeyFromBytes creates a BLS private key from a byte slice.
func (*PrivateKey) Marshal ¶
func (p *PrivateKey) Marshal() []byte
Marshal a secret key into a byte slice.
func (*PrivateKey) PublicKey ¶
func (p *PrivateKey) PublicKey() *PublicKey
PublicKey obtains the public key corresponding to the BLS secret key.
func (*PrivateKey) SerializeToHexStr ¶
func (p *PrivateKey) SerializeToHexStr() string
func (*PrivateKey) Set ¶
func (p *PrivateKey) Set(pkeys []*PrivateKey, id *ID) error
func (*PrivateKey) Sign ¶
func (p *PrivateKey) Sign(msg []byte) *Signature
Sign a message using a secret key.
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
PublicKey used in the BLS signature scheme.
func EmptyPublicKey ¶
func EmptyPublicKey() *PublicKey
func PublicKeyFromBytes ¶
PublicKeyFromBytes creates a BLS public key from a byte slice.
func (*PublicKey) Aggregate ¶
Aggregate two public keys. This updates the value of the existing key.
func (*PublicKey) SerializeToHexStr ¶
type Signature ¶
type Signature struct {
// contains filtered or unexported fields
}
Signature is a BLS signature.
func AggregateSignatures ¶
AggregateSignatures aggregates signatures.
func SignatureFromBytes ¶
SignatureFromBytes creates a BLS signature from a byte slice.
func SignatureFromSig ¶
SignatureFromSig creates a BLS signature from an existing signature.
func (*Signature) VerifyAggregate ¶
VerifyAggregate verifies each public key against its respective message. Note: this is vulnerable to a rogue public-key attack.