gennaro2p

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

README

Two-party GG20

This package wraps dkg/genarro and specializes it for the 2-party case.

Documentation

Overview

Package gennaro2p wraps dkg/genarro and specializes it for the 2-party case. Simpler API, no distinction between broadcast and peer messages, and only counterparty messages are used as round inputs since self-inputs are always ignored.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DkgResult

type DkgResult struct {
	PublicKey    *curves.EcPoint
	SecretShare  *v1.ShamirShare
	PublicShares map[uint32]*curves.EcPoint
}

type Participant

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

Participant is a DKG player that contains information needed to perform DKG rounds and yield a secret key share and public key when finished

func NewParticipant

func NewParticipant(id, counterPartyId uint32, blind *curves.EcPoint,
	scalar curves.EcScalar, curve elliptic.Curve,
) (*Participant, error)

NewParticipant creates a participant ready to perform a DKG blind must be a generator and must be synchronized between counterparties. The first participant can set it to `nil` and a secure blinding factor will be generated.

func (*Participant) Finalize

func (p *Participant) Finalize(msg *Round2Message) (*DkgResult, error)

Completes the DKG using the counterparty's output from round 2.

func (*Participant) Round1

func (p *Participant) Round1(secret []byte) (*Round1Message, error)

Runs DKG round 1. If `secret` is nil, shares of a new, random signing key are generated. Otherwise, the existing secret shares will be refreshed but the privkey and pubkey will remain unchanged.

func (*Participant) Round2

func (p *Participant) Round2(msg *Round1Message) (*Round2Message, error)

Runs DKG round 2 using the counterparty's output from round 1.

type Round1Message

type Round1Message struct {
	Verifiers     []*v1.ShareVerifier
	SecretShare   *v1.ShamirShare
	BlindingShare *v1.ShamirShare
	Blind         *curves.EcPoint
}

type Round2Message

type Round2Message struct {
	Verifiers []*v1.ShareVerifier
}

Jump to

Keyboard shortcuts

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