dkg

package
v0.0.0-...-6d8402f Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0, MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coordinator

type Coordinator struct {
	// contains filtered or unexported fields
}

func NewDKGCoordinator

func NewDKGCoordinator(publicURL string, scheme crypto.ThresholdScheme) *Coordinator

func (*Coordinator) ProcessPacket

func (d *Coordinator) ProcessPacket(packet api.SidecarDKGPacket) error

func (*Coordinator) RunDKG

func (d *Coordinator) RunDKG(identities []crypto.Identity, sessionID []byte, keypair crypto.Keypair) (*Output, error)

func (*Coordinator) RunReshare

func (d *Coordinator) RunReshare(identities []crypto.Identity, sessionID []byte, keypair crypto.Keypair, state GroupFile) (*Output, error)

type DKGBoard

type DKGBoard struct {
	// contains filtered or unexported fields
}

func NewDKGBoard

func NewDKGBoard(senders []string) *DKGBoard

func (*DKGBoard) IncomingDeal

func (d *DKGBoard) IncomingDeal() <-chan dkg.DealBundle

func (*DKGBoard) IncomingJustification

func (d *DKGBoard) IncomingJustification() <-chan dkg.JustificationBundle

func (*DKGBoard) IncomingResponse

func (d *DKGBoard) IncomingResponse() <-chan dkg.ResponseBundle

func (*DKGBoard) PushDeals

func (d *DKGBoard) PushDeals(bundle *dkg.DealBundle)

func (*DKGBoard) PushJustifications

func (d *DKGBoard) PushJustifications(bundle *dkg.JustificationBundle)

func (*DKGBoard) PushResponses

func (d *DKGBoard) PushResponses(bundle *dkg.ResponseBundle)

type DistPublic

type DistPublic struct {
	Coefficients []kyber.Point
}

type FileStore

type FileStore struct {
	// contains filtered or unexported fields
}

func NewFileStore

func NewFileStore(path string) *FileStore

func (*FileStore) Load

func (f *FileStore) Load(sessionID string) (GroupFiles, error)

Load loads a set of group files associated with a given sessionID if none exist, it returns an empty `GroupFiles` object

func (*FileStore) LoadSingle

func (f *FileStore) LoadSingle(sessionID string, encryptedShareHash []byte) (GroupFile, error)

LoadSingle loads a group file given an encryptedShareHash in some scenarios, we can complete a reshare and store a share, though someone in the wider group had errors; in this case, the caller will re-run the reshare, and tell use which share to use by passing the hash of the encrypted share

func (*FileStore) Save

func (f *FileStore) Save(group GroupFile) error

Save checks for any state for a given sessionID, and stores the new group file as part of it

type GroupFile

type GroupFile struct {
	SessionID                   string            `json:"session_id"`
	Nodes                       []crypto.Identity `json:"nodes"`
	PublicPolynomialCommitments []byte            `json:"public_polynomial_commitments"`
	KeyShare                    []byte            `json:"key_share"`
	EncryptedKeyShareHash       []byte            `json:"encrypted_key_share_hash"`
}

func NewGroupFile

func NewGroupFile(sessionID string, pubPoly []byte, nodes []crypto.Identity, share, encryptedShare []byte) (GroupFile, error)

type GroupFiles

type GroupFiles struct {
	SessionID  string      `json:"session_id"`
	GroupFiles []GroupFile `json:"group_files"`
}

type Output

type Output struct {
	PublicKeyShare  []byte
	GroupPublicPoly []byte
	KeyShare        []byte
	NodePublicKeys  [][]byte
}

func AsResult

func AsResult(scheme crypto.ThresholdScheme, countOfNodes int, result *dkg.Result) (Output, error)

type Share

type Share struct {
	dkg.DistKeyShare
	Scheme crypto.ThresholdScheme
}

Share represents the private information that a node holds after a successful DKG. This information MUST stay private !

func (*Share) PrivateShare

func (s *Share) PrivateShare() *share.PriShare

PrivateShare returns the private share used to produce a partial signature

func (*Share) PubPoly

func (s *Share) PubPoly() *share.PubPoly

PubPoly returns the public polynomial that can be used to verify any individual partial signature

func (*Share) Public

func (s *Share) Public() DistPublic

Public returns the distributed public key associated with the distributed key share

Jump to

Keyboard shortcuts

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