keygen

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: MIT Imports: 26 Imported by: 0

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 = 2
	TestThreshold    = test.TestParticipants / 2
	Ecdsa            = 0
	Eddsa            = 1
)
View Source
const (
	TaskName = "threshold-keygen"
)

Variables

View Source
var File_tkeygen_proto protoreflect.FileDescriptor

Functions

func LoadKeygenTestFixtures

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

func LoadKeygenTestFixturesRandomSet

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

func NewKGRound1Message

func NewKGRound1Message(from *tss.PartyID, hash []byte, polyCommitment cmt.HashCommitment) tss.ParsedMessage

func NewKGRound2Message1

func NewKGRound2Message1(
	from *tss.PartyID,
	ssid []byte,
	srid []byte,
	deCommitment cmt.HashDeCommitment,
	commitmentA *crypto.ECPoint,
	u []byte,
	chainCode []byte,
) tss.ParsedMessage

func NewKGRound2Message2

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

func NewKGRound3Message

func NewKGRound3Message(
	from *tss.PartyID,
	schProof []byte,
) tss.ParsedMessage

func NewLocalParty

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

Exported, used in `tss` client

Types

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) SetNewSecretX

func (p *LocalParty) SetNewSecretX(x *big.Int)

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 TKgRound1Message

type TKgRound1Message struct {
	Hash           []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
	PolyCommitment []byte `protobuf:"bytes,2,opt,name=poly_commitment,json=polyCommitment,proto3" json:"poly_commitment,omitempty"`
	// contains filtered or unexported fields
}

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

func (*TKgRound1Message) Descriptor deprecated

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

Deprecated: Use TKgRound1Message.ProtoReflect.Descriptor instead.

func (*TKgRound1Message) GetHash

func (x *TKgRound1Message) GetHash() []byte

func (*TKgRound1Message) GetPolyCommitment

func (x *TKgRound1Message) GetPolyCommitment() []byte

func (*TKgRound1Message) ProtoMessage

func (*TKgRound1Message) ProtoMessage()

func (*TKgRound1Message) ProtoReflect

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

func (*TKgRound1Message) Reset

func (x *TKgRound1Message) Reset()

func (*TKgRound1Message) String

func (x *TKgRound1Message) String() string

func (*TKgRound1Message) UnmarshalPolyCommitment

func (m *TKgRound1Message) UnmarshalPolyCommitment() *big.Int

func (*TKgRound1Message) ValidateBasic

func (m *TKgRound1Message) ValidateBasic() bool

type TKgRound2Message1

type TKgRound2Message1 struct {
	Ssid          []byte   `protobuf:"bytes,1,opt,name=ssid,proto3" json:"ssid,omitempty"`
	Srid          []byte   `protobuf:"bytes,2,opt,name=srid,proto3" json:"srid,omitempty"`
	PolyG         [][]byte `protobuf:"bytes,3,rep,name=poly_g,json=polyG,proto3" json:"poly_g,omitempty"`
	SchCommitment []byte   `protobuf:"bytes,4,opt,name=sch_commitment,json=schCommitment,proto3" json:"sch_commitment,omitempty"`
	U             []byte   `protobuf:"bytes,5,opt,name=u,proto3" json:"u,omitempty"`
	ChainCode     []byte   `protobuf:"bytes,6,opt,name=chain_code,json=chainCode,proto3" json:"chain_code,omitempty"`
	// contains filtered or unexported fields
}

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

func (*TKgRound2Message1) Descriptor deprecated

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

Deprecated: Use TKgRound2Message1.ProtoReflect.Descriptor instead.

func (*TKgRound2Message1) GetChainCode

func (x *TKgRound2Message1) GetChainCode() []byte

func (*TKgRound2Message1) GetPolyG

func (x *TKgRound2Message1) GetPolyG() [][]byte

func (*TKgRound2Message1) GetSchCommitment

func (x *TKgRound2Message1) GetSchCommitment() []byte

func (*TKgRound2Message1) GetSrid

func (x *TKgRound2Message1) GetSrid() []byte

func (*TKgRound2Message1) GetSsid

func (x *TKgRound2Message1) GetSsid() []byte

func (*TKgRound2Message1) GetU

func (x *TKgRound2Message1) GetU() []byte

func (*TKgRound2Message1) ProtoMessage

func (*TKgRound2Message1) ProtoMessage()

func (*TKgRound2Message1) ProtoReflect

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

func (*TKgRound2Message1) Reset

func (x *TKgRound2Message1) Reset()

func (*TKgRound2Message1) String

func (x *TKgRound2Message1) String() string

func (*TKgRound2Message1) UnmarshalDeCommitment

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

func (*TKgRound2Message1) UnmarshalSchCommitment

func (m *TKgRound2Message1) UnmarshalSchCommitment() (*crypto.ECPoint, error)

func (*TKgRound2Message1) ValidateBasic

func (m *TKgRound2Message1) ValidateBasic() bool

type TKgRound2Message2

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

Represents a P2P message sent to all parties during Round 2 of the TSS signing protocol.

func (*TKgRound2Message2) Descriptor deprecated

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

Deprecated: Use TKgRound2Message2.ProtoReflect.Descriptor instead.

func (*TKgRound2Message2) GetShare

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

func (*TKgRound2Message2) ProtoMessage

func (*TKgRound2Message2) ProtoMessage()

func (*TKgRound2Message2) ProtoReflect

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

func (*TKgRound2Message2) Reset

func (x *TKgRound2Message2) Reset()

func (*TKgRound2Message2) String

func (x *TKgRound2Message2) String() string

func (*TKgRound2Message2) UnmarshalShare

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

func (*TKgRound2Message2) ValidateBasic

func (m *TKgRound2Message2) ValidateBasic() bool

type TKgRound3Message

type TKgRound3Message struct {
	SchProof []byte `protobuf:"bytes,1,opt,name=sch_proof,json=schProof,proto3" json:"sch_proof,omitempty"`
	// contains filtered or unexported fields
}

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

func (*TKgRound3Message) Descriptor deprecated

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

Deprecated: Use TKgRound3Message.ProtoReflect.Descriptor instead.

func (*TKgRound3Message) GetSchProof

func (x *TKgRound3Message) GetSchProof() []byte

func (*TKgRound3Message) ProtoMessage

func (*TKgRound3Message) ProtoMessage()

func (*TKgRound3Message) ProtoReflect

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

func (*TKgRound3Message) Reset

func (x *TKgRound3Message) Reset()

func (*TKgRound3Message) String

func (x *TKgRound3Message) String() string

func (*TKgRound3Message) UnmarshalSchProof

func (m *TKgRound3Message) UnmarshalSchProof() *big.Int

func (*TKgRound3Message) ValidateBasic

func (m *TKgRound3Message) ValidateBasic() bool

Jump to

Keyboard shortcuts

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