Skip to content

Commit

Permalink
Add test for nonzero scalar condition of DH
Browse files Browse the repository at this point in the history
  • Loading branch information
cag committed Jul 19, 2018
1 parent 5bcce0e commit 050b40c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions util/test/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ func testGroup(t *testing.T, g kyber.Group, rand cipher.Stream) []kyber.Point {
// Do a simple Diffie-Hellman test
s1 := g.Scalar().Pick(rand)
s2 := g.Scalar().Pick(rand)
if s1.Equal(szero) {
t.Errorf("first secret is scalar zero %v", s1)
}
if s2.Equal(szero) {
t.Errorf("second secret is scalar zero %v", s2)
}
if s1.Equal(s2) {
t.Errorf("not getting unique secrets: picked %s twice", s1)
}
Expand Down

0 comments on commit 050b40c

Please sign in to comment.