Documentation
¶
Index ¶
- Variables
- type BulkWireMsg
- type Tss
- type TssConfig
- type TssInstance
- func (t *TssInstance) InitTssInfo(msgId string, msgNum int, privKey crypto.PrivKey, threshold uint64, ...) (err error)
- func (t *TssInstance) Keygen(req keygen.Request) (*keygen.Response, error)
- func (t *TssInstance) Keysign(req keysign.Request) (*keysign.Response, error)
- func (t *TssInstance) NotifyTaskDone() error
- func (t *TssInstance) ProcessInboundMessages(wg *sync.WaitGroup)
- func (t *TssInstance) ProcessOneMessage(msg *pb.Message) error
- func (t *TssInstance) ProcessOutCh(tssMsg btss.Message, msgType message.TssMsgType) error
- func (t *TssInstance) PutTssMsg(msg *pb.Message)
- func (t *TssInstance) SignMessage(msgsToSign [][]byte, localStateItem *storage.KeygenLocalState, ...) ([]*bcommon.SignatureData, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BulkWireMsg ¶
type BulkWireMsg struct {
WiredBulkMsgs []byte
MsgIdentifier string
Routing *btss.MessageRouting
}
The TaskMessage body content
func NewBulkWireMsg ¶
func NewBulkWireMsg(msg []byte, id string, r *btss.MessageRouting) BulkWireMsg
type TssConfig ¶
type TssConfig struct {
EnableTSS bool `mapstructure:"enable_tss" json:"enable_tss"`
//PartyTimeout time.Duration `mapstructure:"party_timeout" json:"party_timeout"`
KeyGenTimeout time.Duration `mapstructure:"key_gen_timeout" json:"key_gen_timeout"`
KeySignTimeout time.Duration `mapstructure:"key_sign_timeout" json:"key_sign_timeout"`
PreParamTimeout time.Duration `mapstructure:"pre_param_timeout" json:"pre_param_timeout"`
TssConfPath string `mapstructure:"tss_conf_path" json:"tss_conf_path"`
}
type TssInstance ¶
type TssInstance struct {
// receive task Messages
TssMsgChan chan *pb.Message
// contains filtered or unexported fields
}
TssInstance is the structure that can provide all Keygen and Keysign features
func NewTssInstance ¶
func NewTssInstance( conf TssConfig, privKey crypto.PrivKey, preParams *bkg.LocalPreParams, keygenLocalState *storage.KeygenLocalState, peerMgr peer_mgr.OrderPeerManager, logger logrus.FieldLogger, ) (tssInstance *TssInstance, err error)
NewTss creates a new instance of Tss
func (*TssInstance) InitTssInfo ¶
func (t *TssInstance) InitTssInfo( msgId string, msgNum int, privKey crypto.PrivKey, threshold uint64, conf TssConfig, preParams *bkg.LocalPreParams, keygenLocalState *storage.KeygenLocalState, peerMgr peer_mgr.OrderPeerManager, logger logrus.FieldLogger, ) (err error)
The current instance may be reused. Need to clear some information before using it
func (*TssInstance) Keygen ¶
Keygen generates the key share of the participants of the threshold signature
func (*TssInstance) NotifyTaskDone ¶
func (t *TssInstance) NotifyTaskDone() error
NotifyTaskDone broadcasts a message, the current task is over ======================================================
func (*TssInstance) ProcessInboundMessages ¶
func (t *TssInstance) ProcessInboundMessages(wg *sync.WaitGroup)
ProcessInboundMessages process the different types of p2p msgs received==============================================
func (*TssInstance) ProcessOneMessage ¶
func (t *TssInstance) ProcessOneMessage(msg *pb.Message) error
ProcessOneMessage process one p2p msgs received======================================================================
func (*TssInstance) ProcessOutCh ¶
func (t *TssInstance) ProcessOutCh(tssMsg btss.Message, msgType message.TssMsgType) error
ProcessOutCh sends msg out ========================================================================================== add msgType to the library message, send it as requested or broadcast
func (*TssInstance) PutTssMsg ¶
func (t *TssInstance) PutTssMsg(msg *pb.Message)
func (*TssInstance) SignMessage ¶
func (t *TssInstance) SignMessage(msgsToSign [][]byte, localStateItem *storage.KeygenLocalState, signers []crypto.PubKey) ([]*bcommon.SignatureData, error)