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

Function TestSecretPolyEqual

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

Source from the content-addressed store, hash-verified

70}
71
72func TestSecretPolyEqual(test *testing.T) {
73 n := 10
74 t := n/2 + 1
75
76 p1 := NewPriPoly(suite, t, nil, suite.RandomStream())
77 p2 := NewPriPoly(suite, t, nil, suite.RandomStream())
78 p3 := NewPriPoly(suite, t, nil, suite.RandomStream())
79
80 p12, _ := p1.Add(p2)
81 p13, _ := p1.Add(p3)
82
83 p123, _ := p12.Add(p3)
84 p132, _ := p13.Add(p2)
85
86 if !p123.Equal(p132) {
87 test.Fatal("private polynomials not equal")
88 }
89}
90
91func TestPublicCheck(test *testing.T) {
92 n := 10

Callers

nothing calls this directly

Calls 5

AddMethod · 0.95
NewPriPolyFunction · 0.85
FatalMethod · 0.65
RandomStreamMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected