bls

package
v0.0.0-...-4d9f4f2 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PublicKey

type PublicKey struct {
	// contains filtered or unexported fields
}

PublicKey is a public key.

func AggregatePublicKeys

func AggregatePublicKeys(p []*PublicKey) *PublicKey

AggregatePublicKeys adds public keys together.

func AggregatePublicKeysVec

func AggregatePublicKeysVec(p []*PublicKey, vec []uint32) *PublicKey

AggregatePublicKeysVec aggregates public keys based on given vector.

func NewAggregatePubkey

func NewAggregatePubkey() *PublicKey

NewAggregatePubkey creates a blank public key.

func PublicKeyFromBytes

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

PublicKeyFromBytes creates a BLS public key from a byte slice.

func (*PublicKey) Aggregate

func (p *PublicKey) Aggregate(other *PublicKey)

Aggregate adds two public keys together.

func (*PublicKey) Copy

func (p *PublicKey) Copy() *PublicKey

Copy copies the public key and returns it.

func (*PublicKey) DecodeRLP

func (p *PublicKey) DecodeRLP(stream *rlp.Stream) error

DecodeRLP implements RLP Decoder interface.

func (*PublicKey) EncodeRLP

func (p *PublicKey) EncodeRLP(w io.Writer) error

EncodeRLP implements RLP Encoder interface.

func (*PublicKey) Equals

func (p *PublicKey) Equals(other *PublicKey) bool

Equals checks if two public keys are equal

func (*PublicKey) IsEmpty

func (p *PublicKey) IsEmpty() bool

IsEmpty checks if pubkey is empty.

func (*PublicKey) String

func (p *PublicKey) String() string

func (*PublicKey) ToBytes

func (p *PublicKey) ToBytes() common.Bytes

ToBytes serializes a public key to bytes.

type SecretKey

type SecretKey struct {
	// contains filtered or unexported fields
}

SecretKey represents a BLS private key.

func GenKey

func GenKey(seed io.Reader) (*SecretKey, error)

func RandKey

func RandKey() (*SecretKey, error)

RandKey generates a random secret key.

func SecretKeyFromBytes

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

SecretKeyFromBytes creates a BLS private key from a byte slice.

func (*SecretKey) Equals

func (s *SecretKey) Equals(other *SecretKey) bool

Equals checks if two secret keys are equal

func (*SecretKey) PopProve

func (s *SecretKey) PopProve() *Signature

PopProve generates a proof of poccession of the secrect key.

func (*SecretKey) PublicKey

func (s *SecretKey) PublicKey() *PublicKey

PublicKey converts the private key into a public key.

func (*SecretKey) Sign

func (s *SecretKey) Sign(message []byte) *Signature

Sign signs a message with a secret key.

func (*SecretKey) String

func (s *SecretKey) String() string

func (*SecretKey) ToBytes

func (s *SecretKey) ToBytes() common.Bytes

ToBytes serializes a secret key to bytes.

type Signature

type Signature struct {
	// contains filtered or unexported fields
}

Signature is a message signature.

func AggregateSignatures

func AggregateSignatures(s []*Signature) *Signature

AggregateSignatures adds up all of the signatures.

func AggregateSignaturesVec

func AggregateSignaturesVec(s []*Signature, vec []uint32) *Signature

AggregateSignaturesVec aggregates signatures based on given vector.

func NewAggregateSignature

func NewAggregateSignature() *Signature

NewAggregateSignature creates a blank aggregate signature.

func SignatureFromBytes

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

SignatureFromBytes creates a BLS signature from a byte slice.

func (*Signature) Aggregate

func (s *Signature) Aggregate(other *Signature)

Aggregate adds one signature to another

func (*Signature) Copy

func (s *Signature) Copy() *Signature

Copy returns a copy of the signature.

func (*Signature) DecodeRLP

func (s *Signature) DecodeRLP(stream *rlp.Stream) error

DecodeRLP implements RLP Decoder interface.

func (*Signature) EncodeRLP

func (s *Signature) EncodeRLP(w io.Writer) error

EncodeRLP implements RLP Encoder interface.

func (*Signature) Equals

func (s *Signature) Equals(other *Signature) bool

Equals checks if two signatures are equal

func (*Signature) IsEmpty

func (s *Signature) IsEmpty() bool

IsEmpty checks if signature is empty.

func (*Signature) PopVerify

func (s *Signature) PopVerify(p *PublicKey) bool

PopVerify verifies a proof of possesion of a public key.

func (*Signature) String

func (s *Signature) String() string

func (*Signature) ToBytes

func (s *Signature) ToBytes() common.Bytes

ToBytes serializes a signature in compressed form.

func (*Signature) Verify

func (s *Signature) Verify(m []byte, p *PublicKey) bool

Verify verifies a signature against a message and a public key.

Jump to

Keyboard shortcuts

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