Documentation ¶
Overview ¶
Package blst implements a go-wrapper around a library implementing the BLS12-381 curve and signature scheme. This package exposes a public API for verifying and aggregating BLS signatures used by Ethereum.
This implementation uses the library written by Supranational, blst.
Index ¶
Constants ¶
const ( SignatureLength = 96 PubkeyLength = 48 // PubkeyLength defines the byte length of a BLSSignature. )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PubKey ¶
func PublicKeyFromBytes ¶ added in v0.1.1
PublicKeyFromBytes creates a BLS public key from a BigEndian byte slice.
type PublicKey ¶ added in v0.1.1
type PublicKey struct {
// contains filtered or unexported fields
}
PublicKey used in the BLS signature scheme.
type SecretKey ¶
type SecretKey interface { PublicKey() PubKey Sign(msg []byte) SignatureI Marshal() []byte }
SecretKey represents a BLS secret or private key.
func GenPrivKeyFromSeed ¶ added in v0.1.2
GenPrivKeyFromSeed creates a new private key directly from the seed passed as parameter
func RandKey ¶ added in v0.1.1
RandKey creates a new private key using a random method provided as an io.Reader.
func SecretKeyFromBytes ¶ added in v0.1.1
SecretKeyFromBytes creates a BLS private key from a BigEndian byte slice.
type Signature ¶ added in v0.1.1
type Signature struct {
// contains filtered or unexported fields
}
Signature used in the BLS signature scheme.
func (*Signature) Copy ¶ added in v0.1.1
func (s *Signature) Copy() SignatureI
Copy returns a full deep copy of a signature.
type SignatureI ¶
type SignatureI interface { Verify(pubKey PubKey, msg []byte) bool Marshal() []byte Copy() SignatureI }
SignatureI represents a BLS signature.
func SignatureFromBytes ¶ added in v0.1.1
func SignatureFromBytes(sig []byte) (SignatureI, error)
SignatureFromBytes creates a BLS signature from a LittleEndian byte slice.
func SignatureFromBytesNoValidation ¶ added in v0.1.1
func SignatureFromBytesNoValidation(sig []byte) (SignatureI, error)
SignatureFromBytesNoValidation creates a BLS signature from a LittleEndian byte slice. It does not validate that the signature is in the BLS group