config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ECDSAExtensions

type ECDSAExtensions struct {
	// PaillierKey for multiplicative-to-additive share conversion
	PaillierKey *paillier.SecretKey

	// PedersenParams for zero-knowledge proofs
	PedersenParams *pedersen.Parameters

	// ElGamalKey for additional encryption (optional)
	ElGamalKey curve.Scalar

	// PublicPaillierKeys from all parties for verification
	PublicPaillierKeys map[party.ID]*paillier.PublicKey
}

ECDSAExtensions contains additional configuration needed for ECDSA

type ReshareState

type ReshareState struct {
	// OldParties participating in the reshare (providing shares)
	OldParties []party.ID

	// NewParties receiving shares in the reshare
	NewParties []party.ID

	// NewThreshold after resharing completes
	NewThreshold int

	// BlindingFactors w and q for secure resharing
	WShare curve.Scalar
	QShare curve.Scalar

	// AuxiliaryData for the resharing protocol
	AuxiliaryData map[string][]byte
}

ReshareState tracks the state during a resharing operation

type SignatureType

type SignatureType int

SignatureType represents the type of signature scheme

const (
	// SignatureECDSA for ECDSA signatures (secp256k1)
	SignatureECDSA SignatureType = iota
	// SignatureEdDSA for EdDSA signatures (ed25519)
	SignatureEdDSA
	// SignatureSchnorr for Schnorr signatures (secp256k1)
	SignatureSchnorr
)

func (SignatureType) String

func (s SignatureType) String() string

String returns the string representation of the signature type

type UnifiedConfig

type UnifiedConfig struct {
	// ID is this party's identifier
	ID party.ID

	// Threshold is the minimum number of parties needed to sign
	Threshold int

	// Generation tracks the current resharing generation
	// Incremented each time the configuration is reshared
	Generation uint64

	// PartyIDs contains all parties in the current configuration
	PartyIDs []party.ID

	// SignatureScheme defines which signature algorithm to use
	SignatureScheme SignatureType

	// Group defines the elliptic curve (secp256k1 for ECDSA/Schnorr, ed25519 for EdDSA)
	Group curve.Curve

	// SecretShare is this party's share of the secret key
	// Works for both ECDSA and EdDSA
	SecretShare curve.Scalar

	// PublicKey is the shared public key
	// Remains constant across resharing operations
	PublicKey curve.Point

	// VerificationShares maps party IDs to their public verification shares
	// Used to verify partial signatures
	VerificationShares map[party.ID]curve.Point

	// ChainKey for deterministic key derivation (optional)
	ChainKey types.RID

	// ECDSAExtensions contains ECDSA-specific configuration
	// Only populated when SignatureScheme == SignatureECDSA
	ECDSAExtensions *ECDSAExtensions

	// ReshareData contains temporary data during resharing
	// Cleared after resharing completes
	ReshareData *ReshareState
}

UnifiedConfig represents a party's configuration supporting multiple signature schemes with dynamic resharing capabilities

func (*UnifiedConfig) CanSign

func (c *UnifiedConfig) CanSign() bool

CanSign checks if this party can participate in signing

func (*UnifiedConfig) Clone

func (c *UnifiedConfig) Clone() *UnifiedConfig

Clone creates a deep copy of the configuration

func (*UnifiedConfig) Compatible

func (c *UnifiedConfig) Compatible(other *UnifiedConfig) bool

Compatible checks if two configs can be used together (e.g., for signing)

func (*UnifiedConfig) IsResharing

func (c *UnifiedConfig) IsResharing() bool

IsResharing checks if a resharing operation is in progress

func (*UnifiedConfig) Validate

func (c *UnifiedConfig) Validate() error

Validate checks if the configuration is valid

Jump to

Keyboard shortcuts

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