Documentation
¶
Overview ¶
Package dkg implements the protocol described in TODO
Index ¶
- type Deal
- type DistKeyGenerator
- func (d *DistKeyGenerator) Certified() bool
- func (d *DistKeyGenerator) Deals() (map[int]*Deal, error)
- func (d *DistKeyGenerator) DistKeyShare() (*DistKeyShare, error)
- func (d *DistKeyGenerator) ProcessDeal(dd *Deal) (*Response, error)
- func (d *DistKeyGenerator) ProcessJustification(j *Justification) error
- func (d *DistKeyGenerator) ProcessResponse(resp *Response) (*Justification, error)
- func (d *DistKeyGenerator) QUAL() []int
- type DistKeyShare
- type Justification
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deal ¶
type Deal struct {
// Index of the Dealer in the list of participants
Index uint32
// Deal issued for another participant
Deal *vss.EncryptedDeal
}
Deal holds the Deal for one participant as well as the index of the issuing Dealer.
NOTE: Doing that in vss.go would be possible but then the Dealer is always assumed to be a member of the participants. It's only the case here.
type DistKeyGenerator ¶
type DistKeyGenerator struct {
// contains filtered or unexported fields
}
DistKeyGenerator is the struct that runs the DKG protocol.
func NewDistKeyGenerator ¶
func NewDistKeyGenerator(suite abstract.Suite, longterm abstract.Scalar, participants []abstract.Point, r cipher.Stream, t int) (*DistKeyGenerator, error)
NewDistKeyGenerator returns a DistKeyGenerator out of the suite, the longterm secret key, the list of participants, the random stream to use and the threshold t parameter. It returns an error if the secret key's commitment can't be found in the list of participants.
func (*DistKeyGenerator) Certified ¶
func (d *DistKeyGenerator) Certified() bool
Certified returns true if at least t deals are certified (see vss.Verifier.DealCertified()). If the distribution is certified, the protocol can continue using d.SecretCommits(). XXX DKG requires all deals to be either acknowledged or refused
func (*DistKeyGenerator) Deals ¶
func (d *DistKeyGenerator) Deals() (map[int]*Deal, error)
Deals returns all the deals that must be broadcasted to all participants. The deal corresponding to this DKG is already added to this DKG and is ommitted from the returned map. To know to which participant a deal belongs to, loop over the keys as indices in the list of participants:
for i,dd := range distDeals {
sendTo(participants[i],dd)
}
This method panics if it can't process its own deal.
func (*DistKeyGenerator) DistKeyShare ¶
func (d *DistKeyGenerator) DistKeyShare() (*DistKeyShare, error)
DistKeyShare generates the distributed key relative to this receiver It throws an error if something is wrong such as not enough deals received. The shared secret can be computed when all deals have been sent and basically consists of a public point and a share. The public point is the sum of all aggregated individual public commits of each individual secrets. the share is evaluated from the global Private Polynomial, basically SUM of fj(i) for a receiver i.
func (*DistKeyGenerator) ProcessDeal ¶
func (d *DistKeyGenerator) ProcessDeal(dd *Deal) (*Response, error)
ProcessDeal takes a Deal created by Deals() and stores and verifies it. It returns a Response to broadcast to every other participants. It returns an error in case the deal has already been stored, or if the deal is incorrect (see `vss.Verifier.ProcessEncryptedDeal()`).
func (*DistKeyGenerator) ProcessJustification ¶
func (d *DistKeyGenerator) ProcessJustification(j *Justification) error
ProcessJustification takes a justification and validates it. It returns an error in case the justification is wrong.
func (*DistKeyGenerator) ProcessResponse ¶
func (d *DistKeyGenerator) ProcessResponse(resp *Response) (*Justification, error)
ProcessResponse takes a response from every other peer. If the response designates the deal of another participants than this dkg, this dkg stores it and returns nil with a possible error regarding the validity of the response. If the response designates a deal this dkg has issued, then the dkg will process the response, and returns a justification.
func (*DistKeyGenerator) QUAL ¶
func (d *DistKeyGenerator) QUAL() []int
QUAL returns the index in the list of participants that forms the QUALIFIED set as described in the "New-DKG" protocol by Rabin. Basically, it consists of all participants that are not disqualified after having exchanged all deals, responses and justification. This is the set that is used to extract the distributed public key with SecretCommits() and ProcessSecretCommits().
type DistKeyShare ¶
DistKeyShare holds the share of a distributed key for a participant.
func (*DistKeyShare) Polynomial ¶
func (d *DistKeyShare) Polynomial() *share.PubPoly
func (*DistKeyShare) PriShare ¶
func (d *DistKeyShare) PriShare() *share.PriShare
type Justification ¶
type Justification struct {
// Index of the Dealer who answered with this Justification
Index uint32
// Justification issued from the Dealer
Justification *vss.Justification
}
Justification holds the Justification from a Dealer as well as the index of the Dealer in question.