bls

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2022 License: MIT Imports: 3 Imported by: 31

Documentation

Index

Constants

View Source
const BLSPublicKeyLength int = 48
View Source
const BLSSecretKeyLength int = 32
View Source
const BLSSignatureLength int = 96

Variables

This section is empty.

Functions

func GenerateNewKeypair

func GenerateNewKeypair() (*SecretKey, *PublicKey, error)

func VerifySignature

func VerifySignature(sig *Signature, pk *PublicKey, msg []byte) bool

func VerifySignatureBytes

func VerifySignatureBytes(msg, sigBytes, pkBytes []byte) (bool, error)

Types

type PublicKey

type PublicKey = blst.P1Affine

func PublicKeyFromBytes

func PublicKeyFromBytes(pkBytes []byte) (*PublicKey, error)

PublicKeyFromBytes creates a BLS public key from a BigEndian byte slice.

func PublicKeyFromSecretKey

func PublicKeyFromSecretKey(sk *SecretKey) *PublicKey

type SecretKey

type SecretKey = blst.SecretKey

func GenerateRandomSecretKey

func GenerateRandomSecretKey() (*SecretKey, error)

func SecretKeyFromBytes

func SecretKeyFromBytes(skBytes []byte) (*SecretKey, error)

type Signature

type Signature = blst.P2Affine

func Sign

func Sign(sk *SecretKey, msg []byte) *Signature

func SignatureFromBytes

func SignatureFromBytes(sigBytes []byte) (*Signature, error)

SignatureFromBytes creates a BLS signature from a LittleEndian byte slice.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL