bls

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Order = bn254.Order

Functions

This section is empty.

Types

type AggregatedKey

type AggregatedKey = PublicKey

type AggregatedSignature

type AggregatedSignature = Signature

type BLSSigner

type BLSSigner struct {
	Domain  []byte
	Account *KeyPair
}

func NewBLSSigner

func NewBLSSigner(domain Domain, account *KeyPair) *BLSSigner

func (*BLSSigner) Sign

func (signer *BLSSigner) Sign(message Message) (*Signature, error)

type BLSVerifier

type BLSVerifier struct {
	Domain []byte
}

func NewBLSVerifier

func NewBLSVerifier(domain Domain) *BLSVerifier

func (*BLSVerifier) AggregatePublicKeys

func (verifier *BLSVerifier) AggregatePublicKeys(keys []*PublicKey) *AggregatedKey

func (*BLSVerifier) AggregateSignatures

func (verifier *BLSVerifier) AggregateSignatures(signatures []*Signature) *AggregatedSignature

func (*BLSVerifier) Verify

func (verifier *BLSVerifier) Verify(message Message, signature *Signature, publicKey *PublicKey) (bool, error)

func (*BLSVerifier) VerifyAggregate

func (verifier *BLSVerifier) VerifyAggregate(messages []Message, publicKeys []*PublicKey, signature *AggregatedSignature) (bool, error)

func (*BLSVerifier) VerifyAggregateCommon

func (verifier *BLSVerifier) VerifyAggregateCommon(message Message, publicKeys []*PublicKey, signature *AggregatedSignature) (bool, error)

type Domain

type Domain = []byte

type KeyPair

type KeyPair struct {
	Public *PublicKey
	// contains filtered or unexported fields
}

func NewKeyPair

func NewKeyPair(r io.Reader) (*KeyPair, error)

func NewKeyPairFromBytes

func NewKeyPairFromBytes(in []byte) (*KeyPair, error)

func NewKeyPairFromSecret

func NewKeyPairFromSecret(in []byte) (*KeyPair, error)

func (*KeyPair) ToBytes

func (e *KeyPair) ToBytes() []byte

type Message

type Message = []byte

type PointG1

type PointG1 = bn254.PointG1 // 32 * 2 bytes -> signature

type PointG2

type PointG2 = bn254.PointG2 // 32 * 4 bytes -> pubkey

type PublicKey

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

func PublicKeyFromBytes

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

func (*PublicKey) ToBytes

func (p *PublicKey) ToBytes() []byte

type SecretKey

type SecretKey [32]byte

type Signature

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

func SignatureKeyFromBytes

func SignatureKeyFromBytes(in []byte) (*Signature, error)

func (*Signature) ToBytes

func (p *Signature) ToBytes() []byte

Jump to

Keyboard shortcuts

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