From 8960f0bbfdf298aacf0a275706612ad6600c6d2a Mon Sep 17 00:00:00 2001 From: lauener Date: Fri, 14 Jun 2024 11:46:12 +0200 Subject: [PATCH] Change computeCommitments signature --- share/pvss/pvss.go | 10 ++++------ share/pvss/pvss_test.go | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/share/pvss/pvss.go b/share/pvss/pvss.go index d6ca326c6..440ff4039 100644 --- a/share/pvss/pvss.go +++ b/share/pvss/pvss.go @@ -87,7 +87,7 @@ func EncShares(suite Suite, H kyber.Point, X []kyber.Point, secret kyber.Scalar, return encShares, pubPoly, nil } -func computeCommitments(suite Suite, n int, polyComs []kyber.Point) ([]kyber.Point, error) { +func computeCommitments(suite Suite, n int, polyComs []kyber.Point) []kyber.Point { coms := make([]kyber.Point, n) // Compute Xi = C0 + iC1 + (i^2)C2 + ... + (i^(t-1))C_(t-1) for i in [1, ..., n] @@ -106,17 +106,15 @@ func computeCommitments(suite Suite, n int, polyComs []kyber.Point) ([]kyber.Poi coms[i] = acc } - return coms, nil + return coms } func computeGlobalChallenge(suite Suite, n int, commit *share.PubPoly, encShares []*PubVerShare) (kyber.Scalar, error) { _, polyComs := commit.Info() - coms, err := computeCommitments(suite, n, polyComs) - if err != nil { - return nil, err - } + coms := computeCommitments(suite, n, polyComs) h := suite.Hash() + var err error for _, com := range coms { _, err = com.MarshalTo(h) if err != nil { diff --git a/share/pvss/pvss_test.go b/share/pvss/pvss_test.go index 02688acb7..4658e9efa 100644 --- a/share/pvss/pvss_test.go +++ b/share/pvss/pvss_test.go @@ -43,7 +43,7 @@ func TestComputePolyCommitments(test *testing.T) { require.NoError(test, err) _, com := pubPoly.Info() - actualComm, err := computeCommitments(suite, n, com) + actualComm := computeCommitments(suite, n, com) require.Equal(test, n, len(expectedComm)) require.Equal(test, len(expectedComm), len(actualComm))