Commit 4617de4f7ffcd04437a0849cf139bea788654580

Steffen Jaeckel 2017-04-20T13:03:21

let's have the same amount of invmod tests than the other tests

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/mtest/mtest.c b/mtest/mtest.c
index 56b5a90..af86920 100644
--- a/mtest/mtest.c
+++ b/mtest/mtest.c
@@ -307,13 +307,13 @@ int main(int argc, char *argv[])
       printf("%s\n", buf);
    } else if (n == 10) {
       /* invmod test */
+      do {
       rand_num2(&a);
       rand_num2(&b);
       b.sign = MP_ZPOS;
       a.sign = MP_ZPOS;
       mp_gcd(&a, &b, &c);
-      if (mp_cmp_d(&c, 1) != 0) continue;
-      if (mp_cmp_d(&b, 1) == 0) continue;
+      } while (mp_cmp_d(&c, 1) != 0 || mp_cmp_d(&b, 1) == 0);
       mp_invmod(&a, &b, &c);
       printf("invmod\n");
       mp_to64(&a, buf);