dkg

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

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

DefaultTimeout is the timeout used by default when unspecified in the config

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
	Timeout        time.Duration
	Reader         io.Reader
	UserReaderOnly bool
	Clock          clock.Clock
}

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, l log.Logger) (*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.Packet)

Process process an incoming message from the network.

func (*Handler) QualifiedGroup

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

QualifiedGroup returns the group that correctly finished running the DKG protocol. It may be a subset of the group given in the NewNodes field in the config. Indeed, not all members may have been online or have completed the protocol sucessfully. This group must be saved to be re-used later on in case of a renewal for the share. This method MUST only be called if the dkg has finished as signalled on the `WaitShare` channel. XXX Best to group that with the WaitShare channel.

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.Packet) error
}

Network is used by the Handler to send a DKG protocol packet over the network.

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

Suite is the suite used by the crypto dkg package

Jump to

Keyboard shortcuts

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