diff libtommath/mtest/mtest.c @ 1470:8bba51a55704

Update to libtommath v1.0.1
author Matt Johnston <matt@ucc.asn.au>
date Thu, 08 Feb 2018 23:11:40 +0800
parents 60fc6476e044
children
line wrap: on
line diff
--- a/libtommath/mtest/mtest.c	Thu Feb 08 22:21:47 2018 +0800
+++ b/libtommath/mtest/mtest.c	Thu Feb 08 23:11:40 2018 +0800
@@ -307,13 +307,13 @@
       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);