tcrypto

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: Apache-2.0, BSD-2-Clause Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tcrypto stands for Threshold Cryptography. It provides a structure for storing a distributed key share and several high level functions to work with it.

Distributed key shares are usually generated using a DKG procedure. See the `dkg` package for the generation part. This package provides a way to use them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DKShare

type DKShare struct {
	Address       ledgerstate.Address
	Index         *uint16 // nil, if the current node is not a member of a group sharing the key.
	N             uint16
	T             uint16
	SharedPublic  kyber.Point
	PublicCommits []kyber.Point
	PublicShares  []kyber.Point
	PrivateShare  kyber.Scalar
	NodePubKeys   []*ed25519.PublicKey
	// contains filtered or unexported fields
}

DKShare stands for the information stored on a node as a result of the DKG procedure.

func DKShareFromBytes added in v0.1.0

func DKShareFromBytes(buf []byte, suite Suite) (*DKShare, error)

DKShareFromBytes reads DKShare from bytes.

func NewDKShare added in v0.1.0

func NewDKShare(
	index uint16,
	n uint16,
	t uint16,
	sharedPublic kyber.Point,
	publicCommits []kyber.Point,
	publicShares []kyber.Point,
	privateShare kyber.Scalar,
	nodePubKeys []*ed25519.PublicKey,
) (*DKShare, error)

NewDKShare creates new share of the key.

func (*DKShare) Bytes added in v0.1.0

func (s *DKShare) Bytes() []byte

Bytes returns byte representation of the share.

func (*DKShare) Read

func (s *DKShare) Read(r io.Reader) error

func (*DKShare) RecoverFullSignature

func (s *DKShare) RecoverFullSignature(sigShares [][]byte, data []byte) (*bls.SignatureWithPublicKey, error)

RecoverFullSignature generates (recovers) master signature from partial sigshares. returns signature as defined in the value Tangle

func (*DKShare) SignShare

func (s *DKShare) SignShare(data []byte) (tbls.SigShare, error)

SignShare signs the data with the own key share. returns SigShare, which contains signature and the index

func (*DKShare) VerifyMasterSignature

func (s *DKShare) VerifyMasterSignature(data, signature []byte) error

VerifyMasterSignature checks signature against master public key NOTE: Not used.

func (*DKShare) VerifyOwnSigShare

func (s *DKShare) VerifyOwnSigShare(data []byte, sigshare tbls.SigShare) error

VerifyOwnSigShare is only used for assertions NOTE: Not used.

func (*DKShare) VerifySigShare

func (s *DKShare) VerifySigShare(data []byte, sigshare tbls.SigShare) error

VerifySigShare verifies the signature of a particular share.

func (*DKShare) Write

func (s *DKShare) Write(w io.Writer) error

Write returns byte representation of this struct.

type Suite added in v0.1.0

type Suite interface {
	kyber.Group
	pairing.Suite
	key.Suite
}

func DefaultSuite added in v0.2.0

func DefaultSuite() Suite

Jump to

Keyboard shortcuts

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