summaryrefslogtreecommitdiffhomepage
path: root/libtommath/mtest/mtest.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2018-02-17 19:29:51 +0800
committerMatt Johnston <matt@ucc.asn.au>2018-02-17 19:29:51 +0800
commit7e8094d53a1c01ac671156ff2e67157b64d01a3a (patch)
treec88345f5bdd118eb9414dff5ab5c307bb1806c57 /libtommath/mtest/mtest.c
parentf7a664f127d3dfde0e7c7a9ca74b1d14f9a2f983 (diff)
parentf042eb41ab0d31f8ba0c5ccc9c848ad01f08f986 (diff)
merge from main
--HG-- branch : fuzz
Diffstat (limited to 'libtommath/mtest/mtest.c')
-rw-r--r--libtommath/mtest/mtest.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libtommath/mtest/mtest.c b/libtommath/mtest/mtest.c
index 56b5a90..af86920 100644
--- a/libtommath/mtest/mtest.c
+++ b/libtommath/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);