dkg

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTimeout = time.Duration(1) * time.Minute

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Suite    Suite
	Key      *key.Pair
	NewNodes *key.Group
	OldNodes *key.Group

	Share     *key.Share
	Threshold int

	// XXX currently not used
	Timeout time.Duration
}

Config holds all necessary information to run a dkg protocol. This config is transformed to be passed down to the kyber dkg library.

type Handler

type Handler struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Handler is the stateful struct that runs a DKG with the peers

func NewHandler

func NewHandler(n Network, c *Config) (*Handler, error)

NewHandler returns a fresh dkg handler using this private key.

func (*Handler) Process

func (h *Handler) Process(c context.Context, packet *dkg_proto.DKGPacket)

Process process an incoming message from the network.

func (*Handler) QualifiedGroup

func (h *Handler) QualifiedGroup() *key.Group

QualifiedGroup returns the group of qualified participants,i.e. the list of participants that successfully finished the DKG round without any blaming from any other participants. This group must be saved to be re-used later on in case of a renewal for the share. TODO For the moment it's only taking the new set of nodes completely. Once we allow for failing nodes during DKG, we must take the qualified group.

func (*Handler) Start

func (h *Handler) Start()

Start sends the first message to run the protocol

func (*Handler) WaitError

func (h *Handler) WaitError() chan error

WaitError returns a channel over which any fatal error for the protocol is sent to.

func (*Handler) WaitExit added in v0.4.0

func (h *Handler) WaitExit() chan bool

WaitExit returns a channel which is signalled over when a node that is leaving a group, i.e. public key only present in the old list of nodes, has seen all necessary responses to attest the validity of the new deals.

func (*Handler) WaitShare

func (h *Handler) WaitShare() chan Share

WaitShare returns a channel over which the share will be sent over when ready.

type Network

type Network interface {
	Send(net.Peer, *dkg_proto.DKGPacket) error
}

Network is used by the Handler to send a DKG protocol packet over the network. XXX Not really needed, should use the net/protobuf interface instead

type Share

type Share = dkg.DistKeyShare

Share represents the private information that a node holds after a successful DKG. This information MUST stay private !

type Suite

type Suite = dkg.Suite

Jump to

Keyboard shortcuts

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