Documentation ¶
Index ¶
- Constants
- func Eval(index *ristretto255.Scalar, commits []*ristretto255.Element) *ristretto255.Element
- func PeerShare(id peer.ID, commits Commitments) (*ristretto255.Element, error)
- type CommitMsg
- type Commitments
- type ContextString
- type DKG
- func (v *DKG) Commit(ctx []byte) (err error)
- func (v DKG) CommitMsg() *CommitMsg
- func (v *DKG) GroupKey(c *Commitments)
- func (v *DKG) KeyGen(s Shares, c Commitments)
- func (v *DKG) KeyShare(s *Shares)
- func (v *DKG) SecretShare() error
- func (v DKG) ShareMessage(id peer.ID) *ShareMsg
- func (v DKG) Verify(s *ristretto255.Scalar, commits []*ristretto255.Element) error
- type KeyPair
- type Keys
- type Messages
- type Public
- type ShareMsg
- type Shares
Constants ¶
ShareMsgSize = 4 byte ID + 32 byte secret share
Variables ¶
This section is empty.
Functions ¶
func Eval ¶
func Eval(index *ristretto255.Scalar, commits []*ristretto255.Element) *ristretto255.Element
Eval a set of commitments at a given index
func PeerShare ¶
func PeerShare(id peer.ID, commits Commitments) (*ristretto255.Element, error)
PeerShare reconstructs a peer's public key share from the set of all commitments
Types ¶
type CommitMsg ¶
type CommitMsg struct { ID peer.ID // Peer ID Public // Public commitments to the coefficients of F }
CommitMsg is used to broadcast commitments to the coefficients of F
type Commitments ¶
Commitments holds peer commitments to the coefficents of F
type DKG ¶
type DKG struct { ID peer.ID // this peer's ID T uint32 // threshold N uint32 // number of peers F polynomial.Polynomial // (t - 1) degree polynomial over Z_q Public // public portion of the scheme K Keys // generated keys }
DKG contains information used for distributed key generation
func (*DKG) KeyGen ¶
func (v *DKG) KeyGen(s Shares, c Commitments)
KeyGen uses the output of a DKG run to generate a key share and a group pubkey
func (*DKG) SecretShare ¶
SecretShare generates n-1 secret shares by evaluating F at each index Note: index 0 is invalid to avoid leaking the secret
func (DKG) ShareMessage ¶
ShareMessage extracts secret shares from a DKG run
func (DKG) Verify ¶
func (v DKG) Verify(s *ristretto255.Scalar, commits []*ristretto255.Element) error
Verify a secret share against a set of commitments
type KeyPair ¶
type KeyPair struct { Priv ristretto255.Scalar // private signing share Pub ristretto255.Element // public verification share }
KeyPair is a signing key share
type Keys ¶
type Keys struct { GroupPubKey ristretto255.Element KeyPair }
Keys holds a signing share
type Public ¶
type Public struct { C []*ristretto255.Element // public commitments to the coefficients of F mod q Sig *nizk.NIZK // Schnorr signature of the constant term }
Public is the public portion of the DKG scheme