tbls

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: GPL-3.0 Imports: 5 Imported by: 2

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 CombineShares added in v0.7.0

func CombineShares(shares []*bls_sig.SecretKeyShare, t, n int) (*bls_sig.SecretKey, error)

CombineShares returns the root/group secret by combining threshold secret shares.

func Keygen added in v0.3.0

func Keygen() (*bls_sig.PublicKey, *bls_sig.SecretKey, error)

Keygen returns a new BLS key pair.

func KeygenWithSeed added in v0.3.0

func KeygenWithSeed(reader io.Reader) (*bls_sig.PublicKey, *bls_sig.SecretKey, error)

KeygenWithSeed returns a new BLS key pair seeded from the reader.

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 Scheme added in v0.4.0

func Scheme() *bls_sig.SigEth2

Scheme returns the BLS12-381 ETH2 signature scheme.

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 SplitSecret added in v0.3.0

func SplitSecret(secret *bls_sig.SecretKey, t, n int, reader io.Reader) ([]*bls_sig.SecretKeyShare, *share.FeldmanVerifier, error)

SplitSecret splits the secret and returns n secret shares and t verifiers.

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), Pubshares (the public shares corresponding to each secret key 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

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

func (TSS) PublicShares added in v0.5.0

func (t TSS) PublicShares() map[int]*bls_sig.PublicKey

func (TSS) Threshold

func (t TSS) Threshold() int

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

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