Documentation
¶
Overview ¶
Package threshold provides adapters that implement crypto/threshold interfaces by wrapping the MPC protocol implementations (CGGMP21, FROST).
Index ¶
- type CGGMP21Scheme
- func (s *CGGMP21Scheme) ID() cryptothreshold.SchemeID
- func (s *CGGMP21Scheme) KeyShareSize() int
- func (s *CGGMP21Scheme) Name() string
- func (s *CGGMP21Scheme) NewAggregator(groupKey cryptothreshold.PublicKey) (cryptothreshold.Aggregator, error)
- func (s *CGGMP21Scheme) NewDKG(config cryptothreshold.DKGConfig) (cryptothreshold.DKG, error)
- func (s *CGGMP21Scheme) NewSigner(share cryptothreshold.KeyShare) (cryptothreshold.Signer, error)
- func (s *CGGMP21Scheme) NewTrustedDealer(config cryptothreshold.DealerConfig) (cryptothreshold.TrustedDealer, error)
- func (s *CGGMP21Scheme) NewVerifier(groupKey cryptothreshold.PublicKey) (cryptothreshold.Verifier, error)
- func (s *CGGMP21Scheme) ParseKeyShare(data []byte) (cryptothreshold.KeyShare, error)
- func (s *CGGMP21Scheme) ParsePublicKey(data []byte) (cryptothreshold.PublicKey, error)
- func (s *CGGMP21Scheme) ParseSignature(data []byte) (cryptothreshold.Signature, error)
- func (s *CGGMP21Scheme) ParseSignatureShare(data []byte) (cryptothreshold.SignatureShare, error)
- func (s *CGGMP21Scheme) PublicKeySize() int
- func (s *CGGMP21Scheme) SignatureShareSize() int
- func (s *CGGMP21Scheme) SignatureSize() int
- type FROSTScheme
- func (s *FROSTScheme) ID() cryptothreshold.SchemeID
- func (s *FROSTScheme) KeyShareSize() int
- func (s *FROSTScheme) Name() string
- func (s *FROSTScheme) NewAggregator(groupKey cryptothreshold.PublicKey) (cryptothreshold.Aggregator, error)
- func (s *FROSTScheme) NewDKG(config cryptothreshold.DKGConfig) (cryptothreshold.DKG, error)
- func (s *FROSTScheme) NewSigner(share cryptothreshold.KeyShare) (cryptothreshold.Signer, error)
- func (s *FROSTScheme) NewTrustedDealer(config cryptothreshold.DealerConfig) (cryptothreshold.TrustedDealer, error)
- func (s *FROSTScheme) NewVerifier(groupKey cryptothreshold.PublicKey) (cryptothreshold.Verifier, error)
- func (s *FROSTScheme) ParseKeyShare(data []byte) (cryptothreshold.KeyShare, error)
- func (s *FROSTScheme) ParsePublicKey(data []byte) (cryptothreshold.PublicKey, error)
- func (s *FROSTScheme) ParseSignature(data []byte) (cryptothreshold.Signature, error)
- func (s *FROSTScheme) ParseSignatureShare(data []byte) (cryptothreshold.SignatureShare, error)
- func (s *FROSTScheme) PublicKeySize() int
- func (s *FROSTScheme) SignatureShareSize() int
- func (s *FROSTScheme) SignatureSize() int
- type Manager
- func (m *Manager) Close()
- func (m *Manager) GetProtocol(name string) (protocol.Protocol, error)
- func (m *Manager) GetProtocolForScheme(scheme SignatureScheme) (protocol.Protocol, error)
- func (m *Manager) ListProtocols() []string
- func (m *Manager) RegisterProtocol(name string, proto protocol.Protocol)
- type SignatureScheme
- type UnifiedThresholdAPI
- func (api *UnifiedThresholdAPI) Close()
- func (api *UnifiedThresholdAPI) GetSupportedSchemes() []SignatureScheme
- func (api *UnifiedThresholdAPI) IsSchemeSupported(scheme SignatureScheme) bool
- func (api *UnifiedThresholdAPI) KeyGen(scheme SignatureScheme, selfID string, partyIDs []string, threshold int) (protocol.Party, error)
- func (api *UnifiedThresholdAPI) PreSign(config protocol.KeyGenConfig, signers []string) (protocol.Party, error)
- func (api *UnifiedThresholdAPI) PreSignOnline(config protocol.KeyGenConfig, preSignature protocol.PreSignature, ...) (protocol.Party, error)
- func (api *UnifiedThresholdAPI) Refresh(scheme SignatureScheme, config protocol.KeyGenConfig) (protocol.Party, error)
- func (api *UnifiedThresholdAPI) Sign(scheme SignatureScheme, config protocol.KeyGenConfig, signers []string, ...) (protocol.Party, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CGGMP21Scheme ¶
type CGGMP21Scheme struct {
// contains filtered or unexported fields
}
CGGMP21Scheme implements threshold.Scheme for CGGMP21 (threshold ECDSA).
func (*CGGMP21Scheme) ID ¶
func (s *CGGMP21Scheme) ID() cryptothreshold.SchemeID
func (*CGGMP21Scheme) KeyShareSize ¶
func (s *CGGMP21Scheme) KeyShareSize() int
func (*CGGMP21Scheme) Name ¶
func (s *CGGMP21Scheme) Name() string
func (*CGGMP21Scheme) NewAggregator ¶
func (s *CGGMP21Scheme) NewAggregator(groupKey cryptothreshold.PublicKey) (cryptothreshold.Aggregator, error)
func (*CGGMP21Scheme) NewDKG ¶
func (s *CGGMP21Scheme) NewDKG(config cryptothreshold.DKGConfig) (cryptothreshold.DKG, error)
func (*CGGMP21Scheme) NewSigner ¶
func (s *CGGMP21Scheme) NewSigner(share cryptothreshold.KeyShare) (cryptothreshold.Signer, error)
func (*CGGMP21Scheme) NewTrustedDealer ¶
func (s *CGGMP21Scheme) NewTrustedDealer(config cryptothreshold.DealerConfig) (cryptothreshold.TrustedDealer, error)
func (*CGGMP21Scheme) NewVerifier ¶
func (s *CGGMP21Scheme) NewVerifier(groupKey cryptothreshold.PublicKey) (cryptothreshold.Verifier, error)
func (*CGGMP21Scheme) ParseKeyShare ¶
func (s *CGGMP21Scheme) ParseKeyShare(data []byte) (cryptothreshold.KeyShare, error)
func (*CGGMP21Scheme) ParsePublicKey ¶
func (s *CGGMP21Scheme) ParsePublicKey(data []byte) (cryptothreshold.PublicKey, error)
func (*CGGMP21Scheme) ParseSignature ¶
func (s *CGGMP21Scheme) ParseSignature(data []byte) (cryptothreshold.Signature, error)
func (*CGGMP21Scheme) ParseSignatureShare ¶
func (s *CGGMP21Scheme) ParseSignatureShare(data []byte) (cryptothreshold.SignatureShare, error)
func (*CGGMP21Scheme) PublicKeySize ¶
func (s *CGGMP21Scheme) PublicKeySize() int
func (*CGGMP21Scheme) SignatureShareSize ¶
func (s *CGGMP21Scheme) SignatureShareSize() int
func (*CGGMP21Scheme) SignatureSize ¶
func (s *CGGMP21Scheme) SignatureSize() int
type FROSTScheme ¶
type FROSTScheme struct {
// contains filtered or unexported fields
}
FROSTScheme implements threshold.Scheme for FROST (threshold EdDSA).
func (*FROSTScheme) ID ¶
func (s *FROSTScheme) ID() cryptothreshold.SchemeID
func (*FROSTScheme) KeyShareSize ¶
func (s *FROSTScheme) KeyShareSize() int
func (*FROSTScheme) Name ¶
func (s *FROSTScheme) Name() string
func (*FROSTScheme) NewAggregator ¶
func (s *FROSTScheme) NewAggregator(groupKey cryptothreshold.PublicKey) (cryptothreshold.Aggregator, error)
func (*FROSTScheme) NewDKG ¶
func (s *FROSTScheme) NewDKG(config cryptothreshold.DKGConfig) (cryptothreshold.DKG, error)
func (*FROSTScheme) NewSigner ¶
func (s *FROSTScheme) NewSigner(share cryptothreshold.KeyShare) (cryptothreshold.Signer, error)
func (*FROSTScheme) NewTrustedDealer ¶
func (s *FROSTScheme) NewTrustedDealer(config cryptothreshold.DealerConfig) (cryptothreshold.TrustedDealer, error)
func (*FROSTScheme) NewVerifier ¶
func (s *FROSTScheme) NewVerifier(groupKey cryptothreshold.PublicKey) (cryptothreshold.Verifier, error)
func (*FROSTScheme) ParseKeyShare ¶
func (s *FROSTScheme) ParseKeyShare(data []byte) (cryptothreshold.KeyShare, error)
func (*FROSTScheme) ParsePublicKey ¶
func (s *FROSTScheme) ParsePublicKey(data []byte) (cryptothreshold.PublicKey, error)
func (*FROSTScheme) ParseSignature ¶
func (s *FROSTScheme) ParseSignature(data []byte) (cryptothreshold.Signature, error)
func (*FROSTScheme) ParseSignatureShare ¶
func (s *FROSTScheme) ParseSignatureShare(data []byte) (cryptothreshold.SignatureShare, error)
func (*FROSTScheme) PublicKeySize ¶
func (s *FROSTScheme) PublicKeySize() int
func (*FROSTScheme) SignatureShareSize ¶
func (s *FROSTScheme) SignatureShareSize() int
func (*FROSTScheme) SignatureSize ¶
func (s *FROSTScheme) SignatureSize() int
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages multiple threshold signature protocols
func NewManager ¶
func NewManager() *Manager
NewManager creates a new protocol manager with all supported protocols
func (*Manager) GetProtocol ¶
GetProtocol returns a protocol by name
func (*Manager) GetProtocolForScheme ¶
func (m *Manager) GetProtocolForScheme(scheme SignatureScheme) (protocol.Protocol, error)
GetProtocolForScheme returns the appropriate protocol for a signature scheme
func (*Manager) ListProtocols ¶
ListProtocols returns a list of registered protocol names
type SignatureScheme ¶
type SignatureScheme string
SignatureScheme represents the type of signature scheme
const ( // SchemeECDSA represents ECDSA signature scheme (using CMP/CGGMP21) SchemeECDSA SignatureScheme = "ECDSA" // SchemeEdDSA represents EdDSA signature scheme (using FROST) SchemeEdDSA SignatureScheme = "EdDSA" // SchemeTaproot represents Taproot/Schnorr signature scheme (using FROST) SchemeTaproot SignatureScheme = "Taproot" )
type UnifiedThresholdAPI ¶
type UnifiedThresholdAPI struct {
// contains filtered or unexported fields
}
UnifiedThresholdAPI provides a unified interface for threshold signing operations
func NewUnifiedThresholdAPI ¶
func NewUnifiedThresholdAPI() *UnifiedThresholdAPI
NewUnifiedThresholdAPI creates a new unified threshold API
func (*UnifiedThresholdAPI) Close ¶
func (api *UnifiedThresholdAPI) Close()
Close cleans up resources
func (*UnifiedThresholdAPI) GetSupportedSchemes ¶
func (api *UnifiedThresholdAPI) GetSupportedSchemes() []SignatureScheme
GetSupportedSchemes returns all supported signature schemes
func (*UnifiedThresholdAPI) IsSchemeSupported ¶
func (api *UnifiedThresholdAPI) IsSchemeSupported(scheme SignatureScheme) bool
IsSchemeSupported checks if a signature scheme is supported
func (*UnifiedThresholdAPI) KeyGen ¶
func (api *UnifiedThresholdAPI) KeyGen( scheme SignatureScheme, selfID string, partyIDs []string, threshold int, ) (protocol.Party, error)
KeyGen initiates distributed key generation for the specified scheme
func (*UnifiedThresholdAPI) PreSign ¶
func (api *UnifiedThresholdAPI) PreSign( config protocol.KeyGenConfig, signers []string, ) (protocol.Party, error)
PreSign initiates presigning (only for ECDSA)
func (*UnifiedThresholdAPI) PreSignOnline ¶
func (api *UnifiedThresholdAPI) PreSignOnline( config protocol.KeyGenConfig, preSignature protocol.PreSignature, messageHash []byte, ) (protocol.Party, error)
PreSignOnline completes a signature with a presignature (only for ECDSA)
func (*UnifiedThresholdAPI) Refresh ¶
func (api *UnifiedThresholdAPI) Refresh( scheme SignatureScheme, config protocol.KeyGenConfig, ) (protocol.Party, error)
Refresh refreshes key shares
func (*UnifiedThresholdAPI) Sign ¶
func (api *UnifiedThresholdAPI) Sign( scheme SignatureScheme, config protocol.KeyGenConfig, signers []string, messageHash []byte, ) (protocol.Party, error)
Sign creates a threshold signature