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

Function TestSecretRecoveryDeleteFail

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

Source from the content-addressed store, hash-verified

50}
51
52func TestSecretRecoveryDeleteFail(test *testing.T) {
53 n := 10
54 t := n/2 + 1
55
56 poly := NewPriPoly(suite, t, nil, suite.RandomStream())
57 shares := poly.Shares(n)
58
59 // Corrupt one more share than acceptable
60 shares[1] = nil
61 shares[2] = nil
62 shares[5] = nil
63 shares[7] = nil
64 shares[8] = nil
65
66 _, err := RecoverSecret(suite, shares, t, n)
67 if err == nil {
68 test.Fatal("recovered secret unexpectably")
69 }
70}
71
72func TestSecretPolyEqual(test *testing.T) {
73 n := 10

Callers

nothing calls this directly

Calls 5

SharesMethod · 0.95
NewPriPolyFunction · 0.85
RecoverSecretFunction · 0.70
FatalMethod · 0.65
RandomStreamMethod · 0.45

Tested by

no test coverage detected