vss

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalLagrangian

func CalLagrangian(curve elliptic.Curve, x, y *big.Int, xList []*big.Int) *big.Int

CalLagrangian lagrangian interpolation wi, x = sum(wi)

func RecoverSecret

func RecoverSecret(curve elliptic.Curve, pointList []*Share) *big.Int

RecoverSecret recover secret key

Types

type Feldman

type Feldman struct {
	// contains filtered or unexported fields
}

verifiable secret sharing scheme

func NewFeldman

func NewFeldman(threshold, limit int, curve elliptic.Curve) (*Feldman, error)

NewFeldman

func (*Feldman) Evaluate

func (fm *Feldman) Evaluate(secret *big.Int) ([]*curves.ECPoint, []*Share, error)

Evaluate return verifiers and shares

func (*Feldman) Verify

func (fm *Feldman) Verify(share *Share, verifiers []*curves.ECPoint) (bool, error)

Verify check feldman verifiable secret sharing

type Polynomial

type Polynomial struct {
	Coefficients []*big.Int // polynomial coefficient, eg: [a0, a1, a2 ...]
	QMod         *big.Int
}

func InitPolynomial

func InitPolynomial(curve elliptic.Curve, secret *big.Int, degree int) (*Polynomial, error)

InitPolynomial init Coefficients [a0, a1....at] t=degree

func (*Polynomial) EvaluatePolynomial

func (p *Polynomial) EvaluatePolynomial(x *big.Int) *Share

EvaluatePolynomial a polynomial with coefficients such that: EvaluatePolynomial(x):

returns a + bx + cx^2 + dx^3

type Share

type Share struct {
	Id *big.Int // x-coordinate
	Y  *big.Int // y-coordinate
}

secret share

Jump to

Keyboard shortcuts

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