Documentation
¶
Overview ¶
wrapper package for BLS threshold cryptography used in the Wasp node TODO DKG protocol must be rewritten because currently it is not 100% secure
Index ¶
- func RecoverPubPoly(suite *bn256.Suite, pubKeys []kyber.Point, t, n uint16) (*share.PubPoly, error)
- func ValidateDKSParams(t, n, index uint16) error
- func VerifyWithPublicKey(data, signature, pubKeyBin []byte) error
- type DKShare
- func (ks *DKShare) AggregateDKS(priShares []kyber.Scalar) error
- func (ks *DKShare) FinalizeDKS(pubKeys []kyber.Point) error
- func (ks *DKShare) Read(r io.Reader) error
- func (ks *DKShare) RecoverFullSignature(sigShares [][]byte, data []byte) (signaturescheme.Signature, error)
- func (ks *DKShare) SignShare(data []byte) (tbdn.SigShare, error)
- func (ks *DKShare) VerifyMasterSignature(data []byte, signature []byte) error
- func (ks *DKShare) VerifyOwnSigShare(data []byte, sigshare tbdn.SigShare) error
- func (ks *DKShare) VerifySigShare(data []byte, sigshare tbdn.SigShare) error
- func (ks *DKShare) Write(w io.Writer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RecoverPubPoly ¶
RecoverPubPoly recovers public polynomial from the partial public keys
func ValidateDKSParams ¶
func VerifyWithPublicKey ¶
VerifyWithPublicKey checks signature against arbitrary public key
Types ¶
type DKShare ¶
type DKShare struct {
Suite *bn256.Suite
N uint16
T uint16
// all N peers are indexed 0..N-1
Index uint16
// all nodes in the committee have DKShare records with same address
// Addresses is blake2 hash of master public key prefixed with one byte of signature type
Address *address.Address
// may be used to identify and authenticate individual committee node
PubKeys []kyber.Point // all public shares by peers
// TODO cleanup. remove redundant information, plus tests
PubKeyOwn kyber.Point
PubPoly *share.PubPoly
PubKeyMaster kyber.Point
// temporary fields used during DKG process
// not used after
// TODO refactor during cleanup, remove tmp fields from the permanent structure
// contains filtered or unexported fields
}
DKShare represents distributed key share for (T,N) threshold signatures based on BLS Structure is a partial share owned by the node to participate in the committee. The only 'priKey' part is secret, the rest is public
func NewRndDKShare ¶
NewRndDKShare creates empty structure
func UnmarshalDKShare ¶
UnmarshalDKShare parses DKShare, validates and calculates master public key
func (*DKShare) AggregateDKS ¶
AggregateDKS is a call in DKG process
func (*DKShare) FinalizeDKS ¶
FinalizeDKS is a call in DKG process
func (*DKShare) RecoverFullSignature ¶
func (ks *DKShare) RecoverFullSignature(sigShares [][]byte, data []byte) (signaturescheme.Signature, error)
RecoverFullSignature generates (recovers) master signature from partial sigshares. returns signature as defined in the value Tangle
func (*DKShare) SignShare ¶
SignShare signs the data with the own key share. returns SigShare, which contains signature and the index
func (*DKShare) VerifyMasterSignature ¶
VerifyMasterSignature checks signature against master public key
func (*DKShare) VerifyOwnSigShare ¶
VerifyOwnSigShare is only used for assertions
func (*DKShare) VerifySigShare ¶
VerifySigShare checks if partial signature (sigshare) of the data is valid