File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 6
6
"testing"
7
7
8
8
"github.com/cloudflare/circl/internal/test"
9
+ "github.com/cloudflare/circl/math/fp25519"
9
10
)
10
11
11
12
func randomPoint (P * pointR1 ) {
@@ -17,6 +18,17 @@ func randomPoint(P *pointR1) {
17
18
func TestPoint (t * testing.T ) {
18
19
const testTimes = 1 << 10
19
20
21
+ t .Run ("isEqual" , func (t * testing.T ) {
22
+ var valid , invalid pointR1
23
+ randomPoint (& valid )
24
+ randomPoint (& invalid )
25
+ invalid .z = fp25519.Elt {}
26
+ test .CheckOk (! valid .isEqual (& invalid ), "valid point shouldn't match invalid point" , t )
27
+ test .CheckOk (! invalid .isEqual (& valid ), "invalid point shouldn't match valid point" , t )
28
+ test .CheckOk (valid .isEqual (& valid ), "valid point should match valid point" , t )
29
+ test .CheckOk (! invalid .isEqual (& invalid ), "invalid point shouldn't match anything" , t )
30
+ })
31
+
20
32
t .Run ("add" , func (t * testing.T ) {
21
33
var P pointR1
22
34
var Q pointR1
You can’t perform that action at this time.
0 commit comments