dilithium

package
v4.0.0-...-b8b0360 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const AggregatedSignature = "dilithium aggregated signature"

AggregatedSignature represents aggregated signature produced by AggregateBatch()

Variables

This section is empty.

Functions

func AggregateCompressedSignatures

func AggregateCompressedSignatures(multiSigs [][]byte) (common.Signature, error)

func AggregateSignatures

func AggregateSignatures(sigs []common.Signature) common.Signature

func NewAggregateSignature

func NewAggregateSignature() common.Signature

func RandKey

func RandKey() (common.SecretKey, error)

func UnaggregatedSignatures

func UnaggregatedSignatures(sigs []common.Signature) []byte

func VerifyMultipleSignatures

func VerifyMultipleSignatures(sigs [][]byte, msgs [][32]byte, pubKeys [][]common.PublicKey) (bool, error)

func VerifySignature

func VerifySignature(sig []byte, msg [32]byte, pubKey common.PublicKey) (bool, error)

Types

type DilithiumKey

type DilithiumKey = common.SecretKey

DilithiumKey represents a BLS secret or private key.

func SecretKeyFromBytes

func SecretKeyFromBytes(seed []byte) (DilithiumKey, error)

TODO (cyyber): Rename SecretKeyFromBytes to SecretKeyFromSeed

type PublicKey

type PublicKey = common.PublicKey

PublicKey represents a BLS public key.

func AggregateMultiplePubkeys

func AggregateMultiplePubkeys(pubs []PublicKey) PublicKey

func AggregatePublicKeys

func AggregatePublicKeys(pubs [][]byte) (PublicKey, error)

func PublicKeyFromBytes

func PublicKeyFromBytes(pubKey []byte) (PublicKey, error)

type Signature

type Signature = common.Signature

Signature represents a BLS signature.

func MultipleSignaturesFromBytes

func MultipleSignaturesFromBytes(sigs [][]byte) ([]Signature, error)

func SignatureFromBytes

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

type SignatureBatch

type SignatureBatch struct {
	Signatures   [][]byte
	PublicKeys   [][]PublicKey
	Messages     [][32]byte
	Descriptions []string
}

SignatureBatch refers to the defined set of signatures and its respective public keys and messages required to verify it.

func NewSet

func NewSet() *SignatureBatch

NewSet constructs an empty signature batch object.

func (*SignatureBatch) AggregateBatch

func (s *SignatureBatch) AggregateBatch() (*SignatureBatch, error)

AggregateBatch aggregates common messages in the provided batch to reduce the number of pairings required when we finally verify the whole batch.

func (*SignatureBatch) Copy

func (s *SignatureBatch) Copy() *SignatureBatch

Copy the attached signature batch and return it to the caller.

func (*SignatureBatch) Join

Join merges the provided signature batch to out current one.

func (*SignatureBatch) RemoveDuplicates

func (s *SignatureBatch) RemoveDuplicates() (int, *SignatureBatch, error)

RemoveDuplicates removes duplicate signature sets from the signature batch.

func (*SignatureBatch) Verify

func (s *SignatureBatch) Verify() (bool, error)

Verify the current signature batch using the batch verify algorithm.

func (*SignatureBatch) VerifyVerbosely

func (s *SignatureBatch) VerifyVerbosely() (bool, error)

VerifyVerbosely verifies signatures as a whole at first, if fails, fallback to verify each single signature to identify invalid ones.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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