adapters

package
v1.1.2 Latest Latest
Warning

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

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

Documentation

Overview

Package adapters provides protocol adapters for unified threshold signature interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CMPConfigAdapter

type CMPConfigAdapter struct {
	*cmpconfig.Config
}

CMPConfigAdapter wraps a CMP config to implement ThresholdConfig

func NewCMPAdapter

func NewCMPAdapter(config *cmpconfig.Config) *CMPConfigAdapter

NewCMPAdapter creates a new CMP config adapter

func (*CMPConfigAdapter) GetChainKey

func (c *CMPConfigAdapter) GetChainKey() []byte

GetChainKey returns the chain key

func (*CMPConfigAdapter) GetGroup

func (c *CMPConfigAdapter) GetGroup() curve.Curve

GetGroup returns the elliptic curve group

func (*CMPConfigAdapter) GetID

func (c *CMPConfigAdapter) GetID() party.ID

GetID returns the party ID

func (*CMPConfigAdapter) GetPrivateShare

func (c *CMPConfigAdapter) GetPrivateShare() curve.Scalar

GetPrivateShare returns the private key share

func (*CMPConfigAdapter) GetPublicKey

func (c *CMPConfigAdapter) GetPublicKey() (curve.Point, error)

GetPublicKey returns the combined public key

func (*CMPConfigAdapter) GetPublicShare

func (c *CMPConfigAdapter) GetPublicShare(id party.ID) (curve.Point, error)

GetPublicShare returns a party's public share

func (*CMPConfigAdapter) GetRID

func (c *CMPConfigAdapter) GetRID() []byte

GetRID returns the RID

func (*CMPConfigAdapter) GetThreshold

func (c *CMPConfigAdapter) GetThreshold() int

GetThreshold returns the threshold value

func (*CMPConfigAdapter) IsCompatible

func (c *CMPConfigAdapter) IsCompatible(other protocol.ThresholdConfig) bool

IsCompatible checks if two configs can work together

func (*CMPConfigAdapter) Validate

func (c *CMPConfigAdapter) Validate() error

Validate validates the configuration

type CMPProtocolAdapter

type CMPProtocolAdapter struct {
	// contains filtered or unexported fields
}

CMPProtocolAdapter implements ThresholdProtocol for CMP

func NewCMPProtocol

func NewCMPProtocol(pl *pool.Pool) *CMPProtocolAdapter

NewCMPProtocol creates a new CMP protocol adapter

func (*CMPProtocolAdapter) GetScheme

GetScheme returns ECDSA for CMP

func (*CMPProtocolAdapter) Keygen

func (p *CMPProtocolAdapter) Keygen(group curve.Curve, selfID party.ID, participants []party.ID, threshold int) (protocol.StartFunc, error)

Keygen initiates CMP key generation

func (*CMPProtocolAdapter) Refresh

Refresh initiates CMP refresh

func (*CMPProtocolAdapter) Sign

func (p *CMPProtocolAdapter) Sign(config protocol.ThresholdConfig, signers []party.ID, message []byte) (protocol.StartFunc, error)

Sign initiates CMP signing

func (*CMPProtocolAdapter) SupportsResharing

func (p *CMPProtocolAdapter) SupportsResharing() bool

SupportsResharing returns false for CMP (native resharing not supported)

type FROSTConfigAdapter

type FROSTConfigAdapter struct {
	*frostconfig.Config
}

FROSTConfigAdapter wraps a FROST config to implement ThresholdConfig

func NewFROSTAdapter

func NewFROSTAdapter(config *frostconfig.Config) *FROSTConfigAdapter

NewFROSTAdapter creates a new FROST config adapter

func (*FROSTConfigAdapter) GetChainKey

func (f *FROSTConfigAdapter) GetChainKey() []byte

GetChainKey returns the chain key

func (*FROSTConfigAdapter) GetGroup

func (f *FROSTConfigAdapter) GetGroup() curve.Curve

GetGroup returns the elliptic curve group

func (*FROSTConfigAdapter) GetID

func (f *FROSTConfigAdapter) GetID() party.ID

GetID returns the party ID

func (*FROSTConfigAdapter) GetPrivateShare

func (f *FROSTConfigAdapter) GetPrivateShare() curve.Scalar

GetPrivateShare returns the private key share

func (*FROSTConfigAdapter) GetPublicKey

func (f *FROSTConfigAdapter) GetPublicKey() (curve.Point, error)

GetPublicKey returns the combined public key

func (*FROSTConfigAdapter) GetPublicShare

func (f *FROSTConfigAdapter) GetPublicShare(id party.ID) (curve.Point, error)

GetPublicShare returns a party's public share (verification share in FROST)

func (*FROSTConfigAdapter) GetRID

func (f *FROSTConfigAdapter) GetRID() []byte

GetRID returns empty for FROST (no RID concept)

func (*FROSTConfigAdapter) GetThreshold

func (f *FROSTConfigAdapter) GetThreshold() int

GetThreshold returns the threshold value

func (*FROSTConfigAdapter) IsCompatible

func (f *FROSTConfigAdapter) IsCompatible(other protocol.ThresholdConfig) bool

IsCompatible checks if two configs can work together

func (*FROSTConfigAdapter) Validate

func (f *FROSTConfigAdapter) Validate() error

Validate validates the configuration

type FROSTProtocolAdapter

type FROSTProtocolAdapter struct{}

FROSTProtocolAdapter implements ThresholdProtocol for FROST

func NewFROSTProtocol

func NewFROSTProtocol() *FROSTProtocolAdapter

NewFROSTProtocol creates a new FROST protocol adapter

func (*FROSTProtocolAdapter) GetScheme

GetScheme returns Schnorr for FROST

func (*FROSTProtocolAdapter) Keygen

func (p *FROSTProtocolAdapter) Keygen(group curve.Curve, selfID party.ID, participants []party.ID, threshold int) (protocol.StartFunc, error)

Keygen initiates FROST key generation

func (*FROSTProtocolAdapter) Refresh

Refresh initiates FROST refresh

func (*FROSTProtocolAdapter) Sign

func (p *FROSTProtocolAdapter) Sign(config protocol.ThresholdConfig, signers []party.ID, message []byte) (protocol.StartFunc, error)

Sign initiates FROST signing

func (*FROSTProtocolAdapter) SupportsResharing

func (p *FROSTProtocolAdapter) SupportsResharing() bool

SupportsResharing returns false for FROST (native resharing not directly supported)

Jump to

Keyboard shortcuts

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