vss

package
v0.0.0-...-872243e Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2019 License: GPL-3.0, LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Author: xingchang@fusion.org

Index

Constants

This section is empty.

Variables

View Source
var ErrIdNoEqualN = errors.New("[ERROR]: the length of input ids is not equal to the share number n.")

var ErrShareNotPass = errors.New("[ERROR]: the set of shares contain invalid share.")

View Source
var ErrShareNotEnough = errors.New("[ERROR]: the shares is not enough to satisfy the threshold.")

Functions

func Combine

func Combine(shares []*ShareStruct) (*big.Int, error)

func GetSharesId

func GetSharesId(ss *ShareStruct) *big.Int

func Vss

func Vss(secret *big.Int, ids []*big.Int, t int, n int) (*PolyGStruct, *PolyStruct, []*ShareStruct, error)

Types

type PolyGStruct

type PolyGStruct struct {
	T     int          // threshold
	N     int          // total num
	PolyG [][]*big.Int //x and y
}

type PolyStruct

type PolyStruct struct {
	PolyGStruct
	Poly []*big.Int // coefficient set
}

type ShareStruct

type ShareStruct struct {
	T     int
	Id    *big.Int // ID, x coordinate
	Share *big.Int
}

func (*ShareStruct) Verify

func (share *ShareStruct) Verify(polyG *PolyGStruct) bool

Jump to

Keyboard shortcuts

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