Documentation ¶
Index ¶
- Constants
- Variables
- func VerifyAggregate(pubkeys []*PublicKey, msgs [][]byte, signature *Signature, domain uint64) bool
- func VerifyAggregateCommon(pubkeys []*PublicKey, msg []byte, signature *Signature, domain uint64) bool
- func VerifySig(pub *PublicKey, msg []byte, sig *Signature, domain uint64) (bool, error)
- type PublicKey
- type SecretKey
- type Signature
Constants ¶
const ( // DomainProposal is a signature for proposing a block. DomainProposal = iota // DomainAttestation is a signature for an attestation. DomainAttestation // DomainDeposit is a signature for validating a deposit. DomainDeposit // DomainExit is a signature for a validator exit. DomainExit // DomainRandao is for the randao signature. DomainRandao )
Variables ¶
var EmptySignature, _ = DeserializeSignature([48]byte{
0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
})
EmptySignature is an empty signature.
Functions ¶
func VerifyAggregate ¶
VerifyAggregate verifies a signature over many messages.
Types ¶
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
PublicKey corresponding to secret key used in the BLS scheme.
func AggregatePubKeys ¶
AggregatePubKeys aggregates some public keys into one.
func DeserializePublicKey ¶
DeserializePublicKey deserialies a public key from the provided bytes.
func NewAggregatePublicKey ¶
func NewAggregatePublicKey() *PublicKey
NewAggregatePublicKey creates a blank public key.
func (*PublicKey) AggregatePubKey ¶
AggregatePubKey adds another public key to this one.
type SecretKey ¶
type SecretKey struct {
// contains filtered or unexported fields
}
SecretKey used in the BLS scheme.
func DeserializeSecretKey ¶
DeserializeSecretKey deserializes a secret key from bytes.
func RandSecretKey ¶
RandSecretKey generates a random key given a byte reader.
func (SecretKey) DerivePublicKey ¶
DerivePublicKey derives a public key from a secret key.
type Signature ¶
type Signature struct {
// contains filtered or unexported fields
}
Signature used in the BLS signature scheme.
func AggregateSigs ¶
AggregateSigs puts multiple signatures into one using the underlying BLS sum functions.
func DeserializeSignature ¶
DeserializeSignature deserializes a binary signature into the actual signature.
func NewAggregateSignature ¶
func NewAggregateSignature() *Signature
NewAggregateSignature creates a blank signature key.
func Sign ¶
Sign a message using a secret key - in a beacon/validator client, this key will come from and be unlocked from the account keystore.
func (*Signature) AggregateSig ¶
AggregateSig adds another signature to this one.