vss

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNumSharesBelowThreshold = fmt.Errorf("not enough shares to satisfy the threshold")
)

Functions

func CheckIndexes added in v1.3.3

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