diff libtommath/mtest/mtest.c @ 1511:5916af64acd4 fuzz

merge from main
author Matt Johnston <matt@ucc.asn.au>
date Sat, 17 Feb 2018 19:29:51 +0800
parents 8bba51a55704
children
line wrap: on
line diff
--- a/libtommath/mtest/mtest.c	Tue Jan 23 23:27:40 2018 +0800
+++ b/libtommath/mtest/mtest.c	Sat Feb 17 19:29:51 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);