common

package
v0.0.0-...-5cda5f8 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT, MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(s []*tss.PartyID, e *tss.PartyID) bool

func GetMsgRound

func GetMsgRound(msg []byte, partyID *tss.PartyID, isBroadcast bool) (abnormal.RoundInfo, error)

func MsgToHashInt

func MsgToHashInt(digest []byte) *big.Int

func MsgToHashString

func MsgToHashString(msg []byte) (string, error)

Types

type BulkWireMsg

type BulkWireMsg struct {
	WiredBulkMsg  []byte
	MsgIdentifier string
	Routing       *tss.MessageRouting
}

func NewBulkWireMsg

func NewBulkWireMsg(msg []byte, id string, r *tss.MessageRouting) BulkWireMsg

type LocalCacheItem

type LocalCacheItem struct {
	Msg  *messages.WireMessage
	Hash string

	ConfirmedList map[string]string
	// contains filtered or unexported fields
}

func NewLocalCacheItem

func NewLocalCacheItem(msg *messages.WireMessage, hash string) *LocalCacheItem

func (*LocalCacheItem) GetPeers

func (l *LocalCacheItem) GetPeers() []string

func (*LocalCacheItem) TotalConfirmParty

func (l *LocalCacheItem) TotalConfirmParty() int

TotalConfirmParty number of parties that already confirmed their hash

func (*LocalCacheItem) UpdateConfirmList

func (l *LocalCacheItem) UpdateConfirmList(P2PID, hash string)

UpdateConfirmList add the given party's hash into the confirm list

type Status

type Status byte
const (
	NA Status = iota
	Success
	Fail
)

type TssCommon

type TssCommon struct {
	TssMsg chan *p2p.Message

	P2PPeersLock sync.RWMutex
	P2PPeers     []peer.ID
	// contains filtered or unexported fields
}

func NewTssCommon

func NewTssCommon(peerID string, broadcastChannel chan *messages.BroadcastMsgChan, conf TssConfig, msgID string, privKey *ecdsa.PrivateKey, thresHold int) *TssCommon

func (*TssCommon) GetAbnormalMgr

func (t *TssCommon) GetAbnormalMgr() *abnormal2.Manager

func (*TssCommon) GetConf

func (t *TssCommon) GetConf() TssConfig

func (*TssCommon) GetLocalPeerID

func (t *TssCommon) GetLocalPeerID() string

func (*TssCommon) GetPartyIDtoP2PID

func (t *TssCommon) GetPartyIDtoP2PID() map[string]peer.ID

func (*TssCommon) GetTaskDone

func (t *TssCommon) GetTaskDone() chan struct{}

func (*TssCommon) GetThreshHold

func (t *TssCommon) GetThreshHold() int

func (*TssCommon) InsertPartyIDtoP2PID

func (t *TssCommon) InsertPartyIDtoP2PID(newMap map[string]peer.ID)

func (*TssCommon) NotifyTaskDone

func (t *TssCommon) NotifyTaskDone() error

func (*TssCommon) ProcessInboundMessages

func (t *TssCommon) ProcessInboundMessages(finishChan chan struct{}, wg *sync.WaitGroup)

func (*TssCommon) ProcessOneMessage

func (t *TssCommon) ProcessOneMessage(wrappedMsg *messages.WrappedMessage, peerID string) error

func (*TssCommon) ProcessOutCh

func (t *TssCommon) ProcessOutCh(msg tss.Message, msgType messages.TSSMessageTpe) error

func (*TssCommon) SetLocalPeerID

func (t *TssCommon) SetLocalPeerID(peerID string)

func (*TssCommon) SetPartyInfo

func (t *TssCommon) SetPartyInfo(partyInfo *abnormal2.PartyInfo)

func (*TssCommon) TryGetLocalCacheItem

func (t *TssCommon) TryGetLocalCacheItem(key string) *LocalCacheItem

type TssConfig

type TssConfig struct {
	// KeyGenTimeoutSeconds defines how long do we wait the keygen parties to pass messages along
	KeyGenTimeout time.Duration
	// KeySignTimeoutSeconds defines how long do we wait keysign
	KeySignTimeout time.Duration
	// Pre-parameter define the pre-parameter generations timeout
	PreParamTimeout time.Duration
	// enable the tss monitor
	EnableMonitor bool
}

Jump to

Keyboard shortcuts

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