MCPcopy Create free account
hub / github.com/DOSNetwork/core / TestPublicCheck

Function TestPublicCheck

share/poly_test.go:91–104  ·  view source on GitHub ↗
(test *testing.T)

Source from the content-addressed store, hash-verified

89}
90
91func TestPublicCheck(test *testing.T) {
92 n := 10
93 t := n/2 + 1
94
95 priPoly := NewPriPoly(suite, t, nil, suite.RandomStream())
96 priShares := priPoly.Shares(n)
97 pubPoly := priPoly.Commit(nil)
98
99 for i, share := range priShares {
100 if !pubPoly.Check(share) {
101 test.Fatalf("private share %v not valid with respect to the public commitment polynomial", i)
102 }
103 }
104}
105
106func TestPublicRecovery(test *testing.T) {
107 n := 10

Callers

nothing calls this directly

Calls 5

SharesMethod · 0.95
CommitMethod · 0.95
NewPriPolyFunction · 0.85
CheckMethod · 0.80
RandomStreamMethod · 0.45

Tested by

no test coverage detected