Skip to content

Commit

Permalink
Change computeCommitments signature
Browse files Browse the repository at this point in the history
  • Loading branch information
K1li4nL committed Jun 14, 2024
1 parent 3c84bbc commit 8960f0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions share/pvss/pvss.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion share/pvss/pvss_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 8960f0b

Please sign in to comment.