Documentation ¶
Index ¶
- Variables
- func AdderGenericHandle(msg *Message, pm *PeerManager, peerID string) error
- func ConvertDKGResult(k *Pubkey, cfgShare string, cfgBKs map[string]BK) (*dkg.Result, error)
- func FromECDSAPub(pub *ecdsa.PublicKey) []byte
- func GenerateSignature(r, s *big.Int, pubkey *Pubkey, msg []byte) ([]byte, error)
- func IsLowS(k *ecdsa.PublicKey, s *big.Int) (bool, error)
- func Keccak256(data ...[]byte) []byte
- func NewServiceAddExisting(pubkey *Pubkey, share string, threshold uint32, newClientID string, ...) *serviceAddExisting
- func NewServiceAddNew(pubkey *Pubkey, threshold, rank uint32, BKs map[string]BK) *serviceAddNew
- func NewServiceDkg(threshold, rank uint32, curve elliptic.Curve) *serviceDkg
- func NewServiceSigner(pubkey *Pubkey, share string, BKs map[string]BK, message []byte) *serviceSigner
- func PubkeyToAddress(p ecdsa.PublicKey) common.Address
- func Receive(tss GenericTSS, ctx context.Context, errs chan error, c *websocket.Conn)
- func RecoverPrivateKey(curve elliptic.Curve, threshold uint32, pubKey *ecpointgrouplaw.ECPoint, ...) (*ecdsa.PrivateKey, error)
- func RecoverPrivateKeyWrapper(clientPeerID string, pubkeyStr PubkeyStr, serverShareStr string, ...) (*ecdsa.PrivateKey, error)
- func S256() elliptic.Curve
- func Send(tss GenericTSS, ctx context.Context, errs chan error, c *websocket.Conn)
- func ToLowS(k *ecdsa.PublicKey, s *big.Int) (*big.Int, error)
- type BK
- type ClientAdd
- type ClientDkg
- type ClientSigner
- type DKGResult
- type DkgResult
- type ExistingClientAdd
- func (p *ExistingClientAdd) GetDoneChan() chan struct{}
- func (p *ExistingClientAdd) GetNextMessageToSend(peerID string) ([]byte, error)
- func (p *ExistingClientAdd) GetNextMessageToSendAll() (Message, error)
- func (p *ExistingClientAdd) HandleMessage(msg *Message) error
- func (p *ExistingClientAdd) Process() (*DkgResult, error)
- type GenericTSS
- type KeccakState
- type Message
- type PeerManager
- func (p *PeerManager) AddPeer(peerID string)
- func (p *PeerManager) GetNextMessageToSend(peerID string) ([]byte, error)
- func (p *PeerManager) GetNextMessageToSendAll() (Message, error)
- func (p *PeerManager) GetNextMessageToSendPeer(peerID string) (Message, error)
- func (p *PeerManager) HandleMessage(msg types.Message) error
- func (p *PeerManager) MustSend(peerID string, message interface{})
- func (p *PeerManager) NumPeers() uint32
- func (p *PeerManager) PeerIDs() []string
- func (p *PeerManager) RegisterHandleMessage(handleFunc func(types.Message) error)
- func (p *PeerManager) SelfID() string
- type ProcessResult
- type Pubkey
- type PubkeyStr
- type RecoveryPeer
- type ServerAdd
- type ServerDkg
- type ServerSigner
- type Signature
- type SigningParameters
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotEnoughPeers = errors.New("not enough input peers, need at least 2") ErrAbsentCurve = errors.New("curve is nil") ErrPubKeyMismatch = errors.New("pubkey derived from recovered privkey is not equal to pubkey provided") )
View Source
var ( // ErrConversion for big int conversion error ErrConversion = errors.New("conversion error") )
Functions ¶
func AdderGenericHandle ¶ added in v1.2.0
func AdderGenericHandle(msg *Message, pm *PeerManager, peerID string) error
func ConvertDKGResult ¶
ConvertDKGResult converts DKG result from config.
func FromECDSAPub ¶
func GenerateSignature ¶
func NewServiceAddExisting ¶ added in v1.2.0
func NewServiceAddNew ¶ added in v1.2.0
func NewServiceDkg ¶
func NewServiceSigner ¶
func RecoverPrivateKey ¶ added in v0.2.0
func RecoverPrivateKey(curve elliptic.Curve, threshold uint32, pubKey *ecpointgrouplaw.ECPoint, peers []RecoveryPeer) (*ecdsa.PrivateKey, error)
func RecoverPrivateKeyWrapper ¶ added in v0.2.0
Types ¶
type ClientAdd ¶ added in v1.2.0
type ClientAdd struct {
// contains filtered or unexported fields
}
/////// New Client
func NewClientAdd ¶ added in v1.2.0
func (*ClientAdd) GetDoneChan ¶ added in v1.2.0
func (p *ClientAdd) GetDoneChan() chan struct{}
func (*ClientAdd) GetNextMessageToSend ¶ added in v1.2.0
func (*ClientAdd) GetNextMessageToSendAll ¶ added in v1.2.0
func (*ClientAdd) HandleMessage ¶ added in v1.2.0
type ClientDkg ¶
type ClientDkg struct {
// contains filtered or unexported fields
}
Client
func NewClientDkg ¶
func (*ClientDkg) GetNextMessageToSend ¶
func (*ClientDkg) HandleMessage ¶
type ClientSigner ¶
type ClientSigner struct {
// contains filtered or unexported fields
}
Client
func NewClientSigner ¶
func (*ClientSigner) DkgOrSign ¶ added in v1.1.0
func (p *ClientSigner) DkgOrSign() int
func (*ClientSigner) GetNextMessageToSend ¶
func (p *ClientSigner) GetNextMessageToSend() ([]byte, error)
func (*ClientSigner) HandleMessage ¶
func (p *ClientSigner) HandleMessage(msg types.Message) error
func (*ClientSigner) Process ¶
func (p *ClientSigner) Process() (*Signature, error)
func (*ClientSigner) Test ¶
func (p *ClientSigner) Test() []byte
type DkgResult ¶
func MergeDkgResults ¶ added in v1.2.0
func PostProcessResult ¶ added in v1.2.0
func PostProcessResult(result ProcessResult) (*DkgResult, error)
type ExistingClientAdd ¶ added in v1.2.0
type ExistingClientAdd struct {
// contains filtered or unexported fields
}
/////// Existing client
func NewExistingClientAdd ¶ added in v1.2.0
func (*ExistingClientAdd) GetDoneChan ¶ added in v1.2.0
func (p *ExistingClientAdd) GetDoneChan() chan struct{}
func (*ExistingClientAdd) GetNextMessageToSend ¶ added in v1.2.0
func (p *ExistingClientAdd) GetNextMessageToSend(peerID string) ([]byte, error)
func (*ExistingClientAdd) GetNextMessageToSendAll ¶ added in v1.2.0
func (p *ExistingClientAdd) GetNextMessageToSendAll() (Message, error)
func (*ExistingClientAdd) HandleMessage ¶ added in v1.2.0
func (p *ExistingClientAdd) HandleMessage(msg *Message) error
func (*ExistingClientAdd) Process ¶ added in v1.2.0
func (p *ExistingClientAdd) Process() (*DkgResult, error)
type GenericTSS ¶
type KeccakState ¶
because it doesn't copy the internal state, but also modifies the internal state.
type PeerManager ¶
type PeerManager struct {
// contains filtered or unexported fields
}
func NewPeerManager ¶
func NewPeerManager(id string) *PeerManager
func (*PeerManager) AddPeer ¶
func (p *PeerManager) AddPeer(peerID string)
AddPeers adds peers to peer list.
func (*PeerManager) GetNextMessageToSend ¶
func (p *PeerManager) GetNextMessageToSend(peerID string) ([]byte, error)
Not appropriate for Adder
func (*PeerManager) GetNextMessageToSendAll ¶ added in v1.2.0
func (p *PeerManager) GetNextMessageToSendAll() (Message, error)
func (*PeerManager) GetNextMessageToSendPeer ¶ added in v1.2.0
func (p *PeerManager) GetNextMessageToSendPeer(peerID string) (Message, error)
func (*PeerManager) HandleMessage ¶
func (p *PeerManager) HandleMessage(msg types.Message) error
func (*PeerManager) MustSend ¶
func (p *PeerManager) MustSend(peerID string, message interface{})
func (*PeerManager) NumPeers ¶
func (p *PeerManager) NumPeers() uint32
func (*PeerManager) PeerIDs ¶
func (p *PeerManager) PeerIDs() []string
func (*PeerManager) RegisterHandleMessage ¶
func (p *PeerManager) RegisterHandleMessage(handleFunc func(types.Message) error)
func (*PeerManager) SelfID ¶
func (p *PeerManager) SelfID() string
type ProcessResult ¶ added in v1.2.0
type ProcessResult struct { PublicKey *ecpointgrouplaw.ECPoint Bks map[string]*birkhoffinterpolation.BkParameter PeerID string }
type Pubkey ¶
func (*Pubkey) GetAddress ¶
func (*Pubkey) GetECPoint ¶ added in v0.2.0
func (k *Pubkey) GetECPoint() (*ecpointgrouplaw.ECPoint, error)
type RecoveryPeer ¶ added in v0.2.0
type RecoveryPeer struct {
// contains filtered or unexported fields
}
type ServerAdd ¶ added in v1.2.0
type ServerAdd struct {
// contains filtered or unexported fields
}
/////// Server
func NewServerAdd ¶ added in v1.2.0
func (*ServerAdd) GetDoneChan ¶ added in v1.2.0
func (p *ServerAdd) GetDoneChan() chan struct{}
func (*ServerAdd) GetNextMessageToSend ¶ added in v1.2.0
func (*ServerAdd) GetOriginalWallet ¶ added in v1.2.0
func (*ServerAdd) HandleMessage ¶ added in v1.2.0
Handle messages coming from clients : if the target is the server, consume; else, add to list of messages to be sent through MustSend
type ServerDkg ¶
type ServerDkg struct {
// contains filtered or unexported fields
}
func NewServerDkg ¶
func (*ServerDkg) GetNextMessageToSend ¶
func (*ServerDkg) HandleMessage ¶
type ServerSigner ¶
type ServerSigner struct {
// contains filtered or unexported fields
}
Server
func NewServerSigner ¶
func (*ServerSigner) DkgOrSign ¶ added in v1.1.0
func (p *ServerSigner) DkgOrSign() int
func (*ServerSigner) GetNextMessageToSend ¶
func (p *ServerSigner) GetNextMessageToSend() ([]byte, error)
func (*ServerSigner) HandleMessage ¶
func (p *ServerSigner) HandleMessage(msg types.Message) error
func (*ServerSigner) Process ¶
func (p *ServerSigner) Process() (*Signature, error)
type SigningParameters ¶
Click to show internal directories.
Click to hide internal directories.