Exemple #1
0
// Commits reconstructs a list of commits from the given polynomials and indices.
func (pv *PVSS) Commits(polyBin [][]byte, index []int) ([]abstract.Point, error) {

	if len(polyBin) != len(index) {
		return nil, errors.New("Inputs have different lengths")
	}

	n := len(polyBin)
	sH := make([]abstract.Point, n)
	for i := range sH {
		P := new(poly.PubPoly)
		P.Init(pv.suite, pv.t, pv.h)
		if err := P.UnmarshalBinary(polyBin[i]); err != nil {
			return nil, err
		}
		sH[i] = P.Eval(index[i])
	}
	return sH, nil
}