auxiliary

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: 32 Imported by: 0

README

Description

Generate Paillier and ring-Pedersen parameters for pre-signing.

Documentation

Index

Constants

View Source
const (

	// Safe big len using random for ssid
	SafeBitLen = 1024
)
View Source
const (
	TaskName = "auxiliary"
)

Variables

View Source
var File_auxiliary_proto protoreflect.FileDescriptor
View Source
var ProofParameter = crypto.NewProofConfig(tss.S256().Params().N)

Functions

func GeneratePaillier

func GeneratePaillier(rand io.Reader) (*paillier.PrivateKey, error)

func GeneratePreParamsWithContextAndRandom

func GeneratePreParamsWithContextAndRandom(ctx context.Context, rand io.Reader, optionalConcurrency ...int) (*paillier.PrivateKey, error)

GeneratePreParams finds two safe primes and computes the Paillier secret required for the protocol. This can be a time consuming process so it is recommended to do it out-of-band. If not specified, a concurrency value equal to the number of available CPU cores will be used. If pre-parameters could not be generated before the context is done, an error is returned.

func NewAuxRound1Message

func NewAuxRound1Message(from *tss.PartyID, hash []byte) tss.ParsedMessage

func NewAuxRound2Message

func NewAuxRound2Message(
	from *tss.PartyID,
	ssid []byte,
	srid []byte,
	paillierPK *paillier.PublicKey,
	pedPK *zkPaillier.PederssenOpenParameter,
	prmProof []byte,
	rho []byte,
	u []byte,
) tss.ParsedMessage

func NewAuxRound3Message

func NewAuxRound3Message(
	to, from *tss.PartyID,
	facProof *facproof.NoSmallFactorMessage,
	modProof *modproof.PaillierBlumMessage,
) (tss.ParsedMessage, error)

func NewLocalParty

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

Exported, used in `tss` client

Types

type AuxRound1Message

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

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

func (*AuxRound1Message) Descriptor deprecated

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

Deprecated: Use AuxRound1Message.ProtoReflect.Descriptor instead.

func (*AuxRound1Message) GetHash

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

func (*AuxRound1Message) ProtoMessage

func (*AuxRound1Message) ProtoMessage()

func (*AuxRound1Message) ProtoReflect

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

func (*AuxRound1Message) Reset

func (x *AuxRound1Message) Reset()

func (*AuxRound1Message) String

func (x *AuxRound1Message) String() string

func (*AuxRound1Message) ValidateBasic

func (m *AuxRound1Message) ValidateBasic() bool

type AuxRound2Message

type AuxRound2Message 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"`
	PaillierN []byte `protobuf:"bytes,3,opt,name=paillier_n,json=paillierN,proto3" json:"paillier_n,omitempty"`
	PedersenS []byte `protobuf:"bytes,4,opt,name=pedersen_s,json=pedersenS,proto3" json:"pedersen_s,omitempty"`
	PedersenT []byte `protobuf:"bytes,5,opt,name=pedersen_t,json=pedersenT,proto3" json:"pedersen_t,omitempty"`
	PrmProof  []byte `protobuf:"bytes,6,opt,name=prm_proof,json=prmProof,proto3" json:"prm_proof,omitempty"`
	Rho       []byte `protobuf:"bytes,7,opt,name=rho,proto3" json:"rho,omitempty"`
	U         []byte `protobuf:"bytes,8,opt,name=u,proto3" json:"u,omitempty"`
	// contains filtered or unexported fields
}

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

func (*AuxRound2Message) Descriptor deprecated

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

Deprecated: Use AuxRound2Message.ProtoReflect.Descriptor instead.

func (*AuxRound2Message) GetPaillierN

func (x *AuxRound2Message) GetPaillierN() []byte

func (*AuxRound2Message) GetPedersenS

func (x *AuxRound2Message) GetPedersenS() []byte

func (*AuxRound2Message) GetPedersenT

func (x *AuxRound2Message) GetPedersenT() []byte

func (*AuxRound2Message) GetPrmProof

func (x *AuxRound2Message) GetPrmProof() []byte

func (*AuxRound2Message) GetRho

func (x *AuxRound2Message) GetRho() []byte

func (*AuxRound2Message) GetSrid

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

func (*AuxRound2Message) GetSsid

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

func (*AuxRound2Message) GetU

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

func (*AuxRound2Message) ProtoMessage

func (*AuxRound2Message) ProtoMessage()

func (*AuxRound2Message) ProtoReflect

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

func (*AuxRound2Message) Reset

func (x *AuxRound2Message) Reset()

func (*AuxRound2Message) String

func (x *AuxRound2Message) String() string

func (*AuxRound2Message) UnmarshalPaillierPK

func (m *AuxRound2Message) UnmarshalPaillierPK() *paillier.PublicKey

func (*AuxRound2Message) UnmarshalPedersenPK

func (m *AuxRound2Message) UnmarshalPedersenPK() *zkPaillier.PederssenOpenParameter

func (*AuxRound2Message) UnmarshalPrmProof

func (m *AuxRound2Message) UnmarshalPrmProof() (*prmproof.RingPederssenParameterMessage, error)

func (*AuxRound2Message) ValidateBasic

func (m *AuxRound2Message) ValidateBasic() bool

type AuxRound3Message

type AuxRound3Message struct {
	FacProof []byte `protobuf:"bytes,1,opt,name=fac_proof,json=facProof,proto3" json:"fac_proof,omitempty"`
	ModProof []byte `protobuf:"bytes,2,opt,name=mod_proof,json=modProof,proto3" json:"mod_proof,omitempty"`
	// contains filtered or unexported fields
}

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

func (*AuxRound3Message) Descriptor deprecated

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

Deprecated: Use AuxRound3Message.ProtoReflect.Descriptor instead.

func (*AuxRound3Message) GetFacProof

func (x *AuxRound3Message) GetFacProof() []byte

func (*AuxRound3Message) GetModProof

func (x *AuxRound3Message) GetModProof() []byte

func (*AuxRound3Message) ProtoMessage

func (*AuxRound3Message) ProtoMessage()

func (*AuxRound3Message) ProtoReflect

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

func (*AuxRound3Message) Reset

func (x *AuxRound3Message) Reset()

func (*AuxRound3Message) String

func (x *AuxRound3Message) String() string

func (*AuxRound3Message) UnmarshalFacProof

func (m *AuxRound3Message) UnmarshalFacProof() (*facproof.NoSmallFactorMessage, error)

func (*AuxRound3Message) UnmarshalModProof

func (m *AuxRound3Message) UnmarshalModProof() (*modproof.PaillierBlumMessage, error)

func (*AuxRound3Message) ValidateBasic

func (m *AuxRound3Message) 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) PaillierSK

func (p *LocalParty) PaillierSK() *paillier.PrivateKey

func (*LocalParty) PartyID

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

func (*LocalParty) SetPaillierSK

func (p *LocalParty) SetPaillierSK(sk *paillier.PrivateKey)

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

	ShareID *big.Int

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

	PaillierPKs []*paillier.PublicKey
	PedersenPKs []*zkPaillier.PederssenOpenParameter
}

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 LoadAuxTestFixtures

func LoadAuxTestFixtures(kind, qty int, optionalStart ...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 {
	PaillierSK *paillier.PrivateKey
}

Jump to

Keyboard shortcuts

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