ecdsatss

package
v2.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Safe big len using random for ssid
	SafeBitLen = 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	LocalPreParams
	LocalSecrets

	Ks                []*big.Int // original indexes (ki in signing preparation phase)
	NTildej, H1j, H2j []*big.Int // // n-tilde, h1, h2 for range proofs
	// public keys (Xj = uj*G for each Pj)
	BigXj       []*crypto.ECPoint     // Xj
	PaillierPKs []*paillier.PublicKey // pkj
	// used for test assertions (may be discarded)
	ECDSAPub *crypto.ECPoint // y
}

Key represents the data for a local share of key

type Keygen

type Keygen struct {
	KGCs []cmts.HashCommitment

	Receiver tss.MessageReceiver
	// contains filtered or unexported fields
}

Keygen is an object used to track a key currently being generated

func NewKeygen

func NewKeygen(params *tss.Parameters) (*Keygen, error)

NewKeygen creates a new Keygen instance and executes round 1 of the key generation protocol.

type LocalPreGenerator

type LocalPreGenerator struct {
	context.Context           // Context used to stop generation if needed
	Rand            io.Reader // reader used for random, defaults to rand.Reader if nil
	Concurrency     int       // concurrency, defaults to runtime.NumCPU() if nil
}

LocalPreGenerator configures and generates pre-parameters for the ECDSA TSS protocol.

func (*LocalPreGenerator) Generate

func (g *LocalPreGenerator) Generate() (*LocalPreParams, error)

Generate computes the Paillier key pair and safe primes required for the protocol.

type LocalPreParams

type LocalPreParams struct {
	PaillierSK                           *paillier.PrivateKey // ski
	NTildei, H1i, H2i, Alpha, Beta, P, Q *big.Int
}

LocalPreParams contains the pre-computed Paillier key and safe prime parameters for a party.

func GeneratePreParams

func GeneratePreParams(timeout time.Duration, optionalConcurrency ...int) (*LocalPreParams, error)

GeneratePreParams finds two safe primes and computes the Paillier secret required for the protocol. This can be a time consuming process so it is recommended to do it out-of-band. If not specified, a concurrency value equal to the number of available CPU cores will be used. If pre-parameters could not be generated before the timeout, an error is returned.

func (LocalPreParams) Validate

func (preParams LocalPreParams) Validate() bool

Validate returns true if the essential pre-parameters (Paillier key, NTilde, H1, H2) are non-nil.

func (LocalPreParams) ValidateWithProof

func (preParams LocalPreParams) ValidateWithProof() bool

ValidateWithProof returns true if the pre-parameters and all proof-related fields (Alpha, Beta, P, Q) are non-nil.

type LocalSecrets

type LocalSecrets struct {
	// secret fields (not shared, but stored locally)
	Xi, ShareID *big.Int // xi, kj
}

LocalSecrets holds the secret share data that is not shared with other parties.

Jump to

Keyboard shortcuts

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