bls

package
v1.67.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: BSD-3-Clause Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	BLSPrivateKeyLength = 32
	BLSPublicKeyLength  = 48
	BLSSignatureLength  = 96
)

setting

View Source
const ID = 259

ID id

View Source
const Name = "bls"

Name name

Variables

This section is empty.

Functions

func ConvertToPublicKey

func ConvertToPublicKey(pub crypto.PubKey) (*g1pubs.PublicKey, error)

ConvertToPublicKey convert to BLS PublicKey

func ConvertToSignature

func ConvertToSignature(sig crypto.Signature) (*g1pubs.Signature, error)

ConvertToSignature convert to BLS Signature

Types

type Driver

type Driver struct{}

Driver driver

func (Driver) Aggregate

func (d Driver) Aggregate(sigs []crypto.Signature) (crypto.Signature, error)

Aggregate aggregates signatures together into a new signature.

func (Driver) AggregatePublic

func (d Driver) AggregatePublic(pubs []crypto.PubKey) (crypto.PubKey, error)

AggregatePublic aggregates public keys together into a new PublicKey.

func (Driver) GenKey

func (d Driver) GenKey() (crypto.PrivKey, error)

GenKey create private key

func (Driver) PrivKeyFromBytes

func (d Driver) PrivKeyFromBytes(b []byte) (privKey crypto.PrivKey, err error)

PrivKeyFromBytes create private key from bytes

func (Driver) PubKeyFromBytes

func (d Driver) PubKeyFromBytes(b []byte) (pubKey crypto.PubKey, err error)

PubKeyFromBytes create public key from bytes

func (Driver) SignatureFromBytes

func (d Driver) SignatureFromBytes(b []byte) (sig crypto.Signature, err error)

SignatureFromBytes create signature from bytes

func (Driver) Validate added in v1.65.2

func (d Driver) Validate(msg, pub, sig []byte) error

Validate validate msg and signature

func (Driver) VerifyAggregatedN

func (d Driver) VerifyAggregatedN(pubs []crypto.PubKey, ms [][]byte, sig crypto.Signature) error

VerifyAggregatedN verifies each public key against each message.

func (Driver) VerifyAggregatedOne

func (d Driver) VerifyAggregatedOne(pubs []crypto.PubKey, m []byte, sig crypto.Signature) error

VerifyAggregatedOne verifies each public key against a message.

type PrivKeyBLS

type PrivKeyBLS [BLSPrivateKeyLength]byte

PrivKeyBLS PrivKey

func (PrivKeyBLS) Bytes

func (privKey PrivKeyBLS) Bytes() []byte

Bytes convert to bytes

func (PrivKeyBLS) Equals

func (privKey PrivKeyBLS) Equals(other crypto.PrivKey) bool

Equals check privkey is equal

func (PrivKeyBLS) PubKey

func (privKey PrivKeyBLS) PubKey() crypto.PubKey

PubKey convert to public key

func (PrivKeyBLS) Sign

func (privKey PrivKeyBLS) Sign(msg []byte) crypto.Signature

Sign create signature

func (PrivKeyBLS) String

func (privKey PrivKeyBLS) String() string

String convert to string

type PubKeyBLS

type PubKeyBLS [BLSPublicKeyLength]byte

PubKeyBLS PubKey

func (PubKeyBLS) Bytes

func (pubKey PubKeyBLS) Bytes() []byte

Bytes convert to bytes

func (PubKeyBLS) Equals

func (pubKey PubKeyBLS) Equals(other crypto.PubKey) bool

Equals check public key is equal

func (PubKeyBLS) KeyString

func (pubKey PubKeyBLS) KeyString() string

KeyString Must return the full bytes in hex. Used for map keying, etc.

func (PubKeyBLS) String

func (pubKey PubKeyBLS) String() string

String convert to string

func (PubKeyBLS) VerifyBytes

func (pubKey PubKeyBLS) VerifyBytes(msg []byte, sig crypto.Signature) bool

VerifyBytes verify signature

type SignatureBLS

type SignatureBLS [BLSSignatureLength]byte

SignatureBLS Signature

func (SignatureBLS) Bytes

func (sig SignatureBLS) Bytes() []byte

Bytes convert signature to bytes

func (SignatureBLS) Equals

func (sig SignatureBLS) Equals(other crypto.Signature) bool

Equals check signature equals

func (SignatureBLS) IsZero

func (sig SignatureBLS) IsZero() bool

IsZero check signature is zero

func (SignatureBLS) String

func (sig SignatureBLS) String() string

String convert signature to string

type SignatureS

type SignatureS struct {
	crypto.Signature
}

SignatureS signature struct

Jump to

Keyboard shortcuts

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