Documentation
¶
Index ¶
- func EnsureSelfIDInGroup(selfID party.ID, group []party.ID) []party.ID
- func HandleNetworkProtocol(id party.ID, h pv0.Handler, network Network)
- func Keygen(id party.ID, ids party.IDSlice, n Network, threshold int, wg *sync.WaitGroup, ...) (*cmp.Config, error)
- func Refresh(c *cmp.Config, n Network, wg *sync.WaitGroup, pl *pool.Pool) (*cmp.Config, error)
- func Sign(c *cmp.Config, m []byte, signers party.IDSlice, n Network, wg *sync.WaitGroup, ...) (*crypto.MPCECDSASignature, error)
- func Verify(c *cmp.Config, m []byte, sig *crypto.MPCECDSASignature) bool
- type Network
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureSelfIDInGroup ¶
EnsureSelfIDInGroup ensures that the given self ID is in the given group.
func HandleNetworkProtocol ¶
HandleNetworkProtocol is a helper function that loops over all the parties and calls the given handler.
func Keygen ¶
func Keygen(id party.ID, ids party.IDSlice, n Network, threshold int, wg *sync.WaitGroup, pl *pool.Pool) (*cmp.Config, error)
It creates a new handler for the keygen protocol, runs the handler loop, and returns the result
func Refresh ¶
It creates a new handler for the refresh protocol, runs the handler loop, and returns the result
Types ¶
type Network ¶
type Network interface { // Ls returns a list of peers that are connected to the network. Ls() []party.ID // A function that takes in a party ID and returns a channel of protocol messages. Next(id party.ID) <-chan *pv0.Message // Sending a message to the network. Send(msg *pv0.Message) // A channel that is closed when the party is done with the protocol. Done(id party.ID) chan struct{} // A function that is called when a party is done with the protocol. Quit(id party.ID) // IsOnlineNetwork returns true if the network is an online network. IsOnlineNetwork() bool }
A Network is a channel that sends messages to parties and receives messages from parties.
func NewOfflineNetwork ¶
It creates a new `OfflineNetwork` object, and initializes it with a list of parties, and a map of channels
Click to show internal directories.
Click to hide internal directories.