Documentation ¶
Index ¶
- Variables
- func AggregateVerify(s *Signature, pubKeys []*PublicKey, msgs [][32]byte) bool
- func Engine() *bls12381.Engine
- func FastAggregateVerify(s *Signature, pubKeys []*PublicKey, msg [32]byte) bool
- func Verify(s *Signature, pubKey *PublicKey, msg []byte) bool
- type PublicKey
- type SecretKey
- type Signature
Constants ¶
This section is empty.
Variables ¶
var ( // ErrorSecSize returned when the secret bytes doesn't match the length ErrorSecSize = errors.New("secret key should be 32 bytes") // ErrorSecUnmarshal returned when the secret key is not valid ErrorSecUnmarshal = errors.New("secret key bytes are not on curve") // ErrorPubSize returned when the public key bytes doesn't match the length ErrorPubSize = errors.New("public key should be 48 bytes") // ErrorPubKeyUnmarshal returned when the pubkey is not valid ErrorPubKeyUnmarshal = errors.New("could not unmarshal bytes into public key") // ErrorSigSize returned when the signature bytes doesn't match the length ErrorSigSize = errors.New("signature should be 96 bytes") // ErrorSigUnmarshal returned when the pubkey is not valid ErrorSigUnmarshal = errors.New("could not unmarshal bytes into signature") )
Functions ¶
func AggregateVerify ¶
AggregateVerify verifies each public key against its respective message.
func FastAggregateVerify ¶
FastAggregateVerify verifies all the provided public keys with their aggregated signature.
Types ¶
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
PublicKey used in the BLS signature scheme.
func PublicKeyFromBytes ¶
PublicKeyFromBytes creates a BLS public key from a BigEndian byte slice.
type SecretKey ¶
type SecretKey struct {
// contains filtered or unexported fields
}
SecretKey used in the BLS signature scheme.
func SecretKeyFromBytes ¶
SecretKeyFromBytes creates a BLS private key from a BigEndian byte slice.
func (*SecretKey) Sign ¶
Sign a message using a secret key - in a beacon/validator client.
In IETF draft BLS specification: Sign(SK, message) -> signature: a signing algorithm that generates
a deterministic signature given a secret key SK and a message.
In ETH2.0 specification: def Sign(SK: int, message: Bytes) -> BLSSignature
type Signature ¶
type Signature struct {
// contains filtered or unexported fields
}
Signature used in the BLS signature scheme.
func AggregateSignatures ¶
AggregateSignatures converts a list of signatures into a single, aggregated sig.
func NewAggregateSignature ¶
func NewAggregateSignature() *Signature
NewAggregateSignature creates a blank aggregate signature.
func SignatureFromBytes ¶
SignatureFromBytes creates a BLS signature from a LittleEndian byte slice.