Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyGenConfig ¶
type KeyGenConfig interface {
// GetPartyID returns this party's ID
GetPartyID() string
// GetThreshold returns the threshold value
GetThreshold() int
// GetPublicKey returns the group's public key
GetPublicKey() *ecdsa.PublicKey
GetShare() *big.Int
GetSharePublicKey() *ecdsa.PublicKey
// GetPartyIDs returns all party IDs
GetPartyIDs() []string
// Serialize returns the config as bytes
Serialize() ([]byte, error)
}
KeyGenConfig represents the result of key generation
type Message ¶
type Message interface {
// GetFrom returns the sender ID
GetFrom() string
// GetTo returns the recipient IDs (nil for broadcast)
GetTo() []string
// GetData returns the message data
GetData() []byte
// IsBroadcast returns true if this is a broadcast message
IsBroadcast() bool
}
Message represents a protocol message
type Party ¶
type Party interface {
// Update processes an incoming message
Update(msg Message) error
// Messages returns a channel of outgoing messages
Messages() <-chan Message
// Errors returns a channel of errors
Errors() <-chan error
// Done returns true when the protocol is complete
Done() bool
// Result returns the protocol result
Result() (interface{}, error)
}
Party represents a participant in the protocol
type PreSignature ¶
type PreSignature interface {
// GetID returns the presignature ID
GetID() string
// Validate validates the presignature
Validate() error
}
PreSignature represents a preprocessed signature
type Protocol ¶
type Protocol interface {
// KeyGen starts a distributed key generation
KeyGen(selfID string, partyIDs []string, threshold int) (Party, error)
// Refresh refreshes shares from an existing config
Refresh(config KeyGenConfig) (Party, error)
// Sign starts a signing protocol
Sign(config KeyGenConfig, signers []string, messageHash []byte) (Party, error)
// PreSign starts a presigning protocol
PreSign(config KeyGenConfig, signers []string) (Party, error)
// PreSignOnline completes a signature with a presignature
PreSignOnline(config KeyGenConfig, preSignature PreSignature, messageHash []byte) (Party, error)
// Name returns the protocol name (e.g., "GG20", "CGGMP21")
Name() string
}
Protocol represents a threshold signature protocol implementation
type Signature ¶
type Signature interface {
// GetR returns the R component
GetR() *big.Int
// GetS returns the S component
GetS() *big.Int
// Verify verifies the signature
Verify(pubKey *ecdsa.PublicKey, message []byte) bool
// Serialize returns the signature as bytes
Serialize() ([]byte, error)
}
Signature represents a signature
Click to show internal directories.
Click to hide internal directories.