Documentation ¶
Index ¶
- Variables
- func CalcQualifyNodes(mpks []*MasterPublicKey, complaints []*Complaint, threshold int) (qualifyIDs cryptoDKG.IDs, qualifyNodeIDs map[types.NodeID]struct{}, err error)
- func NewID(ID types.NodeID) cryptoDKG.ID
- type Complaint
- type Finalize
- type GroupPublicKey
- type MPKReady
- type MasterPublicKey
- type NodePublicKeys
- type PartialSignature
- type PrivateShare
- type Success
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotReachThreshold = fmt.Errorf("threshold not reach") ErrInvalidThreshold = fmt.Errorf("invalid threshold") )
Errors for typesDKG package.
Functions ¶
func CalcQualifyNodes ¶
func CalcQualifyNodes( mpks []*MasterPublicKey, complaints []*Complaint, threshold int) ( qualifyIDs cryptoDKG.IDs, qualifyNodeIDs map[types.NodeID]struct{}, err error)
CalcQualifyNodes returns the qualified nodes.
Types ¶
type Complaint ¶
type Complaint struct { ProposerID types.NodeID `json:"proposer_id"` Round uint64 `json:"round"` Reset uint64 `json:"reset"` Signature crypto.Signature `json:"signature"` }
Complaint describe a complaint in DKG protocol.
type Finalize ¶
type Finalize struct { ProposerID types.NodeID `json:"proposer_id"` Round uint64 `json:"round"` Reset uint64 `json:"reset"` Signature crypto.Signature `json:"signature"` }
Finalize describe a dkg finalize message in DKG protocol.
type GroupPublicKey ¶
type GroupPublicKey struct { Round uint64 QualifyIDs cryptoDKG.IDs QualifyNodeIDs map[types.NodeID]struct{} IDMap map[types.NodeID]cryptoDKG.ID GroupPublicKey *cryptoDKG.PublicKey Threshold int }
GroupPublicKey is the result of DKG protocol.
func NewGroupPublicKey ¶
func NewGroupPublicKey( round uint64, mpks []*MasterPublicKey, complaints []*Complaint, threshold int) ( *GroupPublicKey, error)
NewGroupPublicKey creats a GroupPublicKey instance.
func (*GroupPublicKey) VerifySignature ¶
VerifySignature verifies if the signature is correct.
type MPKReady ¶
type MPKReady struct { ProposerID types.NodeID `json:"proposer_id"` Round uint64 `json:"round"` Reset uint64 `json:"reset"` Signature crypto.Signature `json:"signature"` }
MPKReady describe a dkg ready message in DKG protocol.
type MasterPublicKey ¶
type MasterPublicKey struct { ProposerID types.NodeID `json:"proposer_id"` Round uint64 `json:"round"` Reset uint64 `json:"reset"` DKGID cryptoDKG.ID `json:"dkg_id"` Signature crypto.Signature `json:"signature"` }
MasterPublicKey decrtibe a master public key in DKG protocol.
func NewMasterPublicKey ¶
func NewMasterPublicKey() *MasterPublicKey
NewMasterPublicKey returns a new MasterPublicKey instance.
func (*MasterPublicKey) DecodeRLP ¶
func (d *MasterPublicKey) DecodeRLP(s *rlp.Stream) error
DecodeRLP implements rlp.Decoder
func (*MasterPublicKey) EncodeRLP ¶
func (d *MasterPublicKey) EncodeRLP(w io.Writer) error
EncodeRLP implements rlp.Encoder
func (*MasterPublicKey) Equal ¶
func (d *MasterPublicKey) Equal(other *MasterPublicKey) bool
Equal check equality of two DKG master public keys.
func (*MasterPublicKey) String ¶
func (d *MasterPublicKey) String() string
func (*MasterPublicKey) UnmarshalJSON ¶
func (d *MasterPublicKey) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaller.
type NodePublicKeys ¶
type NodePublicKeys struct { Round uint64 QualifyIDs cryptoDKG.IDs QualifyNodeIDs map[types.NodeID]struct{} IDMap map[types.NodeID]cryptoDKG.ID PublicKeys map[types.NodeID]*cryptoDKG.PublicKey Threshold int }
NodePublicKeys is the result of DKG protocol.
func NewNodePublicKeys ¶
func NewNodePublicKeys( round uint64, mpks []*MasterPublicKey, complaints []*Complaint, threshold int) ( *NodePublicKeys, error)
NewNodePublicKeys creats a NodePublicKeys instance.
type PartialSignature ¶
type PartialSignature struct { ProposerID types.NodeID `json:"proposer_id"` Round uint64 `json:"round"` Hash common.Hash `json:"hash"` PartialSignature cryptoDKG.PartialSignature `json:"partial_signature"` Signature crypto.Signature `json:"signature"` }
PartialSignature describe a partial signature in DKG protocol.
type PrivateShare ¶
type PrivateShare struct {}
PrivateShare describe a secret share in DKG protocol.
func (*PrivateShare) Equal ¶
func (p *PrivateShare) Equal(other *PrivateShare) bool
Equal checks equality between two PrivateShare instances.
type Success ¶
type Success struct { ProposerID types.NodeID `json:"proposer_id"` Round uint64 `json:"round"` Reset uint64 `json:"reset"` Signature crypto.Signature `json:"signature"` }
Success describe a dkg success message in DKG protocol.