File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -425,6 +425,18 @@ func runGtTest(t *testing.T, c *Curve) {
425425 assert .True (t , gengt .Equals (c .GenGt ))
426426}
427427
428+ func runInvModOrderTest (t * testing.T , c * Curve ) {
429+ rng , err := c .Rand ()
430+ assert .NoError (t , err )
431+ r := c .NewRandomZr (rng )
432+ r1 := c .NewZrFromUint64 (0 )
433+ r1 .Clone (r )
434+
435+ r .InvModP (c .GroupOrder )
436+ r1 .InvModOrder ()
437+ assert .True (t , r .Equals (r1 ))
438+ }
439+
428440func runRndTest (t * testing.T , c * Curve ) {
429441 rng , err := c .Rand ()
430442 assert .NoError (t , err )
@@ -774,6 +786,7 @@ func TestCurves(t *testing.T) {
774786 runPairingTest (t , curve )
775787 runGtTest (t , curve )
776788 runRndTest (t , curve )
789+ runInvModOrderTest (t , curve )
777790 runHashTest (t , curve )
778791 runToFroBytesTest (t , curve )
779792 runToFroCompressedTest (t , curve )
You can’t perform that action at this time.
0 commit comments