vss

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	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) (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
}

func (*Share) Verify

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

type Shares

type Shares []*Share

func (Shares) ReConstruct

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

type Vs

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

Jump to

Keyboard shortcuts

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