keygen

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 24 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// To change these parameters, you must first delete the text fixture files in test/_fixtures/ and then run the keygen test alone.
	// Then the signing and resharing tests will work with the new n, t configuration using the newly written fixture files.
	TestParticipants = test.TestParticipants
	TestThreshold    = test.TestParticipants / 2
)
View Source
const (
	TaskName = "eddsa-keygen"
)

Variables

View Source
var File_protob_eddsa_keygen_proto protoreflect.FileDescriptor

Functions

func NewKGRound1Message

func NewKGRound1Message(from *tss.PartyID, ct cmt.HashCommitment) tss.ParsedMessage

func NewKGRound2Message1

func NewKGRound2Message1(
	to, from *tss.PartyID,
	share *vss.Share,
) tss.ParsedMessage

func NewKGRound2Message2

func NewKGRound2Message2(
	from *tss.PartyID,
	deCommitment cmt.HashDeCommitment,
	proof *schnorr.ZKProof,
) tss.ParsedMessage

func NewLocalParty

func NewLocalParty(
	params *tss.Parameters,
	out chan<- tss.Message,
	end chan<- LocalPartySaveData,
) tss.Party

Exported, used in `tss` client

Types

type KGRound1Message

type KGRound1Message struct {
	Commitment []byte `protobuf:"bytes,1,opt,name=commitment,proto3" json:"commitment,omitempty"`
	// contains filtered or unexported fields
}

Represents a BROADCAST message sent during Round 1 of the EDDSA TSS keygen protocol.

func (*KGRound1Message) Descriptor deprecated

func (*KGRound1Message) Descriptor() ([]byte, []int)

Deprecated: Use KGRound1Message.ProtoReflect.Descriptor instead.

func (*KGRound1Message) GetCommitment

func (x *KGRound1Message) GetCommitment() []byte

func (*KGRound1Message) ProtoMessage

func (*KGRound1Message) ProtoMessage()

func (*KGRound1Message) ProtoReflect

func (x *KGRound1Message) ProtoReflect() protoreflect.Message

func (*KGRound1Message) Reset

func (x *KGRound1Message) Reset()

func (*KGRound1Message) String

func (x *KGRound1Message) String() string

func (*KGRound1Message) UnmarshalCommitment

func (m *KGRound1Message) UnmarshalCommitment() *big.Int

func (*KGRound1Message) ValidateBasic

func (m *KGRound1Message) ValidateBasic() bool

type KGRound2Message1

type KGRound2Message1 struct {
	Share []byte `protobuf:"bytes,1,opt,name=share,proto3" json:"share,omitempty"`
	// contains filtered or unexported fields
}

Represents a P2P message sent to each party during Round 2 of the EDDSA TSS keygen protocol.

func (*KGRound2Message1) Descriptor deprecated

func (*KGRound2Message1) Descriptor() ([]byte, []int)

Deprecated: Use KGRound2Message1.ProtoReflect.Descriptor instead.

func (*KGRound2Message1) GetShare

func (x *KGRound2Message1) GetShare() []byte

func (*KGRound2Message1) ProtoMessage

func (*KGRound2Message1) ProtoMessage()

func (*KGRound2Message1) ProtoReflect

func (x *KGRound2Message1) ProtoReflect() protoreflect.Message

func (*KGRound2Message1) Reset

func (x *KGRound2Message1) Reset()

func (*KGRound2Message1) String

func (x *KGRound2Message1) String() string

func (*KGRound2Message1) UnmarshalShare

func (m *KGRound2Message1) UnmarshalShare() *big.Int

func (*KGRound2Message1) ValidateBasic

func (m *KGRound2Message1) ValidateBasic() bool

type KGRound2Message2

type KGRound2Message2 struct {
	DeCommitment [][]byte `protobuf:"bytes,1,rep,name=de_commitment,json=deCommitment,proto3" json:"de_commitment,omitempty"`
	ProofAlphaX  []byte   `protobuf:"bytes,2,opt,name=proof_alpha_x,json=proofAlphaX,proto3" json:"proof_alpha_x,omitempty"`
	ProofAlphaY  []byte   `protobuf:"bytes,3,opt,name=proof_alpha_y,json=proofAlphaY,proto3" json:"proof_alpha_y,omitempty"`
	ProofT       []byte   `protobuf:"bytes,4,opt,name=proof_t,json=proofT,proto3" json:"proof_t,omitempty"`
	// contains filtered or unexported fields
}

Represents a BROADCAST message sent to each party during Round 2 of the EDDSA TSS keygen protocol.

func (*KGRound2Message2) Descriptor deprecated

func (*KGRound2Message2) Descriptor() ([]byte, []int)

Deprecated: Use KGRound2Message2.ProtoReflect.Descriptor instead.

func (*KGRound2Message2) GetDeCommitment

func (x *KGRound2Message2) GetDeCommitment() [][]byte

func (*KGRound2Message2) GetProofAlphaX

func (x *KGRound2Message2) GetProofAlphaX() []byte

func (*KGRound2Message2) GetProofAlphaY

func (x *KGRound2Message2) GetProofAlphaY() []byte

func (*KGRound2Message2) GetProofT

func (x *KGRound2Message2) GetProofT() []byte

func (*KGRound2Message2) ProtoMessage

func (*KGRound2Message2) ProtoMessage()

func (*KGRound2Message2) ProtoReflect

func (x *KGRound2Message2) ProtoReflect() protoreflect.Message

func (*KGRound2Message2) Reset

func (x *KGRound2Message2) Reset()

func (*KGRound2Message2) String

func (x *KGRound2Message2) String() string

func (*KGRound2Message2) UnmarshalDeCommitment

func (m *KGRound2Message2) UnmarshalDeCommitment() []*big.Int

func (*KGRound2Message2) UnmarshalZKProof

func (m *KGRound2Message2) UnmarshalZKProof(ec elliptic.Curve) (*schnorr.ZKProof, error)

func (*KGRound2Message2) ValidateBasic

func (m *KGRound2Message2) ValidateBasic() bool

type LocalParty

type LocalParty struct {
	*tss.BaseParty
	// contains filtered or unexported fields
}

func (*LocalParty) FirstRound

func (p *LocalParty) FirstRound() tss.Round

func (*LocalParty) PartyID

func (p *LocalParty) PartyID() *tss.PartyID

func (*LocalParty) Start

func (p *LocalParty) Start() *tss.Error

func (*LocalParty) StoreMessage

func (p *LocalParty) StoreMessage(msg tss.ParsedMessage) (bool, *tss.Error)

func (*LocalParty) String

func (p *LocalParty) String() string

func (*LocalParty) Update

func (p *LocalParty) Update(msg tss.ParsedMessage) (ok bool, err *tss.Error)

func (*LocalParty) UpdateFromBytes

func (p *LocalParty) UpdateFromBytes(wireBytes []byte, from *tss.PartyID, isBroadcast bool) (bool, *tss.Error)

func (*LocalParty) ValidateMessage

func (p *LocalParty) ValidateMessage(msg tss.ParsedMessage) (bool, *tss.Error)

type LocalPartySaveData

type LocalPartySaveData struct {
	LocalSecrets

	// original indexes (ki in signing preparation phase)
	Ks []*big.Int

	// public keys (Xj = uj*G for each Pj)
	BigXj []*crypto.ECPoint // Xj

	// used for test assertions (may be discarded)
	EDDSAPub *crypto.ECPoint // y
}

Everything in LocalPartySaveData is saved locally to user's HD when done

func BuildLocalSaveDataSubset

func BuildLocalSaveDataSubset(sourceData LocalPartySaveData, sortedIDs tss.SortedPartyIDs) LocalPartySaveData

BuildLocalSaveDataSubset re-creates the LocalPartySaveData to contain data for only the list of signing parties.

func LoadKeygenTestFixtures

func LoadKeygenTestFixtures(qty int, optionalStart ...int) ([]LocalPartySaveData, tss.SortedPartyIDs, error)

func LoadKeygenTestFixturesRandomSet

func LoadKeygenTestFixturesRandomSet(qty, fixtureCount int) ([]LocalPartySaveData, tss.SortedPartyIDs, error)

func NewLocalPartySaveData

func NewLocalPartySaveData(partyCount int) (saveData LocalPartySaveData)

func (LocalPartySaveData) OriginalIndex

func (save LocalPartySaveData) OriginalIndex() (int, error)

recovers a party's original index in the set of parties during keygen

type LocalSecrets

type LocalSecrets struct {
	// secret fields (not shared, but stored locally)
	Xi, ShareID *big.Int // xi, kj
}

Jump to

Keyboard shortcuts

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