Documentation
¶
Index ¶
- Constants
- Variables
- func GenKeyPair() (PrivateKey, PublicKey)
- func Verify(sig Signature, pk PublicKey, msg []byte) (bool, error)
- func VerifyMultiSig(sig Signature, pks []PublicKey, msg []byte) (bool, error)
- type BlsMultiPubKey
- type BlsMultiSig
- type BlsPubKey
- type BlsSig
- type PrivateKey
- type PublicKey
- func (pk PublicKey) Bytes() []byte
- func (pk PublicKey) Equal(k PublicKey) bool
- func (pk PublicKey) Marshal() ([]byte, error)
- func (pk PublicKey) MarshalTo(data []byte) (int, error)
- func (pk PublicKey) MustMarshal() []byte
- func (pk PublicKey) Size() int
- func (pk *PublicKey) Unmarshal(data []byte) error
- type Signature
- func (sig Signature) Bytes() []byte
- func (sig Signature) Equal(s Signature) bool
- func (sig Signature) Marshal() ([]byte, error)
- func (sig Signature) MarshalTo(data []byte) (int, error)
- func (sig Signature) MustMarshal() []byte
- func (sig Signature) Size() int
- func (sig Signature) String() string
- func (sig *Signature) Unmarshal(data []byte) error
- func (sig Signature) ValidateBasic() error
Constants ¶
View Source
const ( // SignatureSize is the size, in bytes, of a compressed BLS signature SignatureSize = 48 // PubKeySize is the size, in bytes, of a compressed BLS public key PubKeySize = 96 // SeedSize is the size, in bytes, of private key seeds SeedSize = 32 )
Variables ¶
View Source
var DST = []byte("BLS_SIG_BLS12381G1_XMD:SHA-256_SSWU_RO_NUL_")
Domain Separation Tag for signatures on G1 (minimal-signature-size)
Functions ¶
func GenKeyPair ¶
func GenKeyPair() (PrivateKey, PublicKey)
GenKeyPair generates a random BLS key pair based on a given seed the public key is compressed with 96 byte size
Types ¶
type BlsMultiPubKey ¶
type BlsMultiPubKey = blst.P2Aggregate
type BlsMultiSig ¶
type BlsMultiSig = blst.P1Aggregate
type PrivateKey ¶
type PrivateKey []byte
func GenPrivKey ¶
func GenPrivKey() PrivateKey
func GenPrivKeyFromSecret ¶
func GenPrivKeyFromSecret(secret []byte) PrivateKey
func (PrivateKey) PubKey ¶
func (sk PrivateKey) PubKey() PublicKey
type PublicKey ¶
type PublicKey []byte
func AggrPKList ¶
AggrPKList aggregates BLS public keys into a single BLS public key
func (PublicKey) MustMarshal ¶
type Signature ¶
type Signature []byte
func AggrSigList ¶
AggrSigList aggregates BLS sigs into a single BLS signature
func NewBLSSigFromHex ¶
func Sign ¶
func Sign(sk PrivateKey, msg []byte) Signature
Sign signs on a msg using a BLS secret key the returned sig is compressed version with 48 byte size
func (Signature) MustMarshal ¶
func (Signature) ValidateBasic ¶
Click to show internal directories.
Click to hide internal directories.