config

package
v1.1.1 Latest Latest
Warning

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

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

Documentation

Overview

Package config implements the LSS configuration and storage

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

	// Group defines the elliptic curve we're using
	Group curve.Curve

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

	// Generation tracks the current resharing generation
	Generation uint64

	// RollbackFrom tracks if this config was created via rollback
	RollbackFrom uint64

	// ECDSA is this party's share of the master private key
	ECDSA curve.Scalar

	// Public maps party IDs to their public key shares
	Public map[party.ID]*Public

	// ChainKey is used for deriving per-signature randomness
	ChainKey []byte

	// RID is the unique identifier for this party's keygen session
	RID []byte
}

Config represents the long-term storage for an LSS party.

func EmptyConfig

func EmptyConfig(group curve.Curve) *Config

EmptyConfig creates an empty Config with a specific group, ready for unmarshalling.

func (*Config) Copy

func (c *Config) Copy() *Config

Copy creates a deep copy of the config

func (*Config) MarshalJSON

func (c *Config) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*Config) PartyIDs

func (c *Config) PartyIDs() party.IDSlice

PartyIDs returns a sorted slice of party IDs.

func (*Config) PublicKey

func (c *Config) PublicKey() (curve.Point, error)

PublicKey returns the combined public key (backward compatibility)

func (*Config) PublicPoint

func (c *Config) PublicPoint() (curve.Point, error)

PublicPoint returns the combined public key using Lagrange interpolation

func (*Config) UnmarshalJSON

func (c *Config) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

func (*Config) Validate

func (c *Config) Validate() error

Validate checks if the config is well-formed

type Public

type Public struct {
	// ECDSA is the public key share (g^share_i)
	ECDSA curve.Point
}

Public represents the public information for a party

Jump to

Keyboard shortcuts

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