vss

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNumSharesBelowThreshold is returned when there are fewer shares than required by the threshold.
	ErrNumSharesBelowThreshold = fmt.Errorf("not enough shares to satisfy the threshold")
)

Functions

func CheckIndexes

func CheckIndexes(ec elliptic.Curve, indexes []*big.Int) ([]*big.Int, error)

Check share ids of Shamir's Secret Sharing, return error if duplicate or 0 value found

func Create

func Create(ec elliptic.Curve, threshold int, secret *big.Int, indexes []*big.Int, rand io.Reader) (Vs, Shares, error)

Returns a new array of secret shares created by Shamir's Secret Sharing Algorithm, requiring a minimum number of shares to recreate, of length shares, from the input secret

Types

type Share

type Share struct {
	Threshold int
	ID,
	Share *big.Int // Sigma i
}

Share represents a single Shamir secret share with its threshold, party ID, and share value.

func (*Share) Verify

func (share *Share) Verify(ec elliptic.Curve, threshold int, vs Vs) bool

Verify checks the share against the Feldman VSS commitments to ensure it is consistent.

type Shares

type Shares []*Share

Shares is a slice of secret shares.

func (Shares) ReConstruct

func (shares Shares) ReConstruct(ec elliptic.Curve) (secret *big.Int, err error)

ReConstruct recovers the secret from the shares using Lagrange interpolation.

type Vs

type Vs []*crypto.ECPoint // v0..vt

Vs is a slice of EC points representing the Feldman VSS commitments (v0..vt).

Jump to

Keyboard shortcuts

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