threshold

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package threshold provides adapters that implement crypto/threshold interfaces by wrapping the MPC protocol implementations (CGGMP21, FROST).

Index

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 (*CGGMP21Scheme) KeyShareSize

func (s *CGGMP21Scheme) KeyShareSize() int

func (*CGGMP21Scheme) Name

func (s *CGGMP21Scheme) Name() string

func (*CGGMP21Scheme) NewAggregator

func (*CGGMP21Scheme) NewDKG

func (*CGGMP21Scheme) NewSigner

func (*CGGMP21Scheme) NewTrustedDealer

func (*CGGMP21Scheme) NewVerifier

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 (*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 (*FROSTScheme) NewSigner

func (*FROSTScheme) NewTrustedDealer

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) Close

func (m *Manager) Close()

Close cleans up all protocols

func (*Manager) GetProtocol

func (m *Manager) GetProtocol(name string) (protocol.Protocol, error)

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

func (m *Manager) ListProtocols() []string

ListProtocols returns a list of registered protocol names

func (*Manager) RegisterProtocol

func (m *Manager) RegisterProtocol(name string, proto protocol.Protocol)

RegisterProtocol registers a new protocol implementation

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

Jump to

Keyboard shortcuts

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