Documentation
¶
Overview ¶
Package puredkg implements the DKG protocol. It's independent of any transport, but rather expects to be driven from the outside.
Index ¶
- Constants
- type AccusationMsg
- type ApologyMsg
- type KeyperIndex
- type Phase
- type PolyCommitmentMsg
- type PolyEvalMsg
- type PureDKG
- func (pure *PureDKG) ComputeResult() (Result, error)
- func (pure *PureDKG) Finalize()
- func (pure *PureDKG) HandleAccusationMsg(msg AccusationMsg) error
- func (pure *PureDKG) HandleApologyMsg(msg ApologyMsg) error
- func (pure *PureDKG) HandlePolyCommitmentMsg(msg PolyCommitmentMsg) error
- func (pure *PureDKG) HandlePolyEvalMsg(msg PolyEvalMsg) error
- func (pure *PureDKG) ShortInfo() string
- func (pure *PureDKG) StartPhase1Dealing() (PolyCommitmentMsg, []PolyEvalMsg, error)
- func (pure *PureDKG) StartPhase2Accusing() []AccusationMsg
- func (pure *PureDKG) StartPhase3Apologizing() []ApologyMsg
- type Result
Constants ¶
const ( Off = Phase(iota) Dealing Accusing Apologizing Finalized )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccusationMsg ¶
type AccusationMsg struct {
Eon uint64
Accuser, Accused KeyperIndex
}
AccusationMsg is broadcast, Accuser is the sender.
type ApologyMsg ¶
type ApologyMsg struct {
Eon uint64
Accuser, Accused KeyperIndex
Eval *big.Int
}
ApologyMsg is broadcast, Accused is the sender.
type KeyperIndex ¶
type KeyperIndex = uint64
type PolyCommitmentMsg ¶
type PolyCommitmentMsg struct {
Eon uint64
Sender KeyperIndex
Gammas *shcrypto.Gammas
}
PolyCommitmentMsg is broadcast to all keypers.
type PolyEvalMsg ¶
type PolyEvalMsg struct {
Eon uint64
Sender KeyperIndex
Receiver KeyperIndex
Eval *big.Int
}
PolyEvalMsg is sent over a secure channel to a single receiver.
type PureDKG ¶
type PureDKG struct {
Phase Phase
Eon uint64
NumKeypers uint64
Threshold uint64
Keyper KeyperIndex
Polynomial *shcrypto.Polynomial
Commitments []*shcrypto.Gammas
Evals []*big.Int
Accusations map[accusationKey]struct{}
Apologies map[accusationKey]*big.Int
}
PureDKG implements the distributed key generation process for a single keyper.
func NewPureDKG ¶
func NewPureDKG(eon uint64, numKeypers uint64, threshold uint64, keyper KeyperIndex) PureDKG
func (*PureDKG) ComputeResult ¶
ComputeResult computes the eon secret key share and public key output of the DKG process. An error is returned if this is called before finalization or if too few keypers participated.
func (*PureDKG) HandleAccusationMsg ¶
func (pure *PureDKG) HandleAccusationMsg(msg AccusationMsg) error
HandleAccusationMsg handles an AccusationMsg.
func (*PureDKG) HandleApologyMsg ¶
func (pure *PureDKG) HandleApologyMsg(msg ApologyMsg) error
HandleApologyMsg handles an ApologyMsg.
func (*PureDKG) HandlePolyCommitmentMsg ¶
func (pure *PureDKG) HandlePolyCommitmentMsg(msg PolyCommitmentMsg) error
HandlePolyCommitmentMsg handles a PolyCommitmentMsg.
func (*PureDKG) HandlePolyEvalMsg ¶
func (pure *PureDKG) HandlePolyEvalMsg(msg PolyEvalMsg) error
HandlePolyEvalMsg handles a PolyEvalMsg.
func (*PureDKG) ShortInfo ¶
ShortInfo returns a short string to be used in log output, which describes the current state of the DKG.
func (*PureDKG) StartPhase1Dealing ¶
func (pure *PureDKG) StartPhase1Dealing() (PolyCommitmentMsg, []PolyEvalMsg, error)
func (*PureDKG) StartPhase2Accusing ¶
func (pure *PureDKG) StartPhase2Accusing() []AccusationMsg
func (*PureDKG) StartPhase3Apologizing ¶
func (pure *PureDKG) StartPhase3Apologizing() []ApologyMsg
type Result ¶
type Result struct {
Eon uint64
NumKeypers uint64
Threshold uint64
Keyper KeyperIndex
PublicKey *shcrypto.EonPublicKey
}