bls

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AggregateSignatures

func AggregateSignatures(signatures ...[]byte) (aggregatedSignature []byte, err error)

AggregateSignatures aggregates multiple signatures together

func LoadKeyPair

func LoadKeyPair(keyPairLocation string) (privateKey, publicKey []byte, err error)

LoadKeyPair loads a BLS keypair from a file

func NewKeyPair

func NewKeyPair() (privateKey, publicKey []byte, err error)

NewKeyPair creates a new BLS keypair

func NewKeyPairFromBytes

func NewKeyPairFromBytes(seed []byte) (privateKey, publicKey []byte, err error)

NewKeyPairFromBytes creates a new BLS keypair deterministically based on a given seed

func Sign

func Sign(data, privateKey []byte) (signature []byte, err error)

Sign signs some data using a BLS private key

func SignAndAggregate

func SignAndAggregate(data, privateKey, existingSignature []byte) (signature []byte, err error)

SignAndAggregate signs the data using the privateKey, then aggregate the signature with an existing signature

func StoreKeyPair

func StoreKeyPair(privateKey, publicKey []byte, fileLocation string) error

StoreKeyPair stores a BLS keypair to a file

func Verify

func Verify(data, signature []byte, pubKeys ...[]byte) (result bool, err error)

Verify verifies a BLS signature. It requires a public key for each private key that was used in generating the signature

Types

type KeyPair

type KeyPair struct {
	PublicKey  []byte `json:"publicKey"`
	PrivateKey []byte `json:"privateKey"`
}

Jump to

Keyboard shortcuts

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