tbls

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Aggregate

func Aggregate(partialSigs []*bls_sig.PartialSignature) (*bls_sig.Signature, error)

Aggregate returns an aggregated signature.

func PartialSign

func PartialSign(sks *bls_sig.SecretKeyShare, msg []byte) (*bls_sig.PartialSignature, error)

PartialSign signs given message(msg) using given Secret Key Share(sks) and returns a Partial Signature.

func Sign

func Sign(sk *bls_sig.SecretKey, msg []byte) (*bls_sig.Signature, error)

Sign signs given message(msg) using given Secret Key(sk) and returns a Signature.

func Verify

func Verify(pk *bls_sig.PublicKey, msg []byte, sig *bls_sig.Signature) (bool, error)

Verify verifies the given signature(sig) on message(msg) with given public key (pk).

func VerifyAndAggregate

func VerifyAndAggregate(tss TSS, partialSigs []*bls_sig.PartialSignature, msg []byte) (*bls_sig.Signature, []byte, error)

VerifyAndAggregate verifies all partial signatures against a message and aggregates them. It returns the aggregated signature and slice of valid partial signature identifiers.

Types

type TSS

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

TSS (threshold signing scheme) wraps PubKey (PublicKey), Verifiers (the public shares corresponding to each secret share) and threshold (number of shares).

func GenerateTSS

func GenerateTSS(t, n int, reader io.Reader) (TSS, []*bls_sig.SecretKeyShare, error)

GenerateTSS returns a new random instance of threshold signing scheme and associated SecretKeyShares. It generates n number of secret key shares where t of them can be combined to sign a message.

func NewTSS

func NewTSS(verifier *share.FeldmanVerifier, numShares int) (TSS, error)

func (TSS) NumShares

func (t TSS) NumShares() int

NumShares returns the number of shares in the threshold signature scheme.

func (TSS) PublicKey

func (t TSS) PublicKey() *bls_sig.PublicKey

PublicKey returns the threshold signature scheme's root public key.

func (TSS) PublicShare

func (t TSS) PublicShare(shareIdx int) (*bls_sig.PublicKey, error)

PublicShare returns a share's public key by share index (identifier).

func (TSS) Threshold

func (t TSS) Threshold() int

Threshold returns the minimum number of partial signatures required to aggregate the threshold signature.

func (TSS) Verifier

func (t TSS) Verifier() *share.FeldmanVerifier

Verifier returns the feldman verifier containing the public shares of the threshold signature scheme.

Directories

Path Synopsis
Package tblsconv provides functions to convert into and from kryptology bls_sig types.
Package tblsconv provides functions to convert into and from kryptology bls_sig types.

Jump to

Keyboard shortcuts

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