From d3cca2245f00f806b84bdefee87ae08da4cb7f63 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 13 Sep 2017 17:47:23 +0200 Subject: [PATCH] let's have the same amount of invmod tests than the other tests --- mtest/mtest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mtest/mtest.c b/mtest/mtest.c index 0dbb5db..c34b5b8 100644 --- a/mtest/mtest.c +++ b/mtest/mtest.c @@ -284,14 +284,14 @@ int main(int argc, char *argv[]) printf("%s\n", buf); } else if (n == 10) { /* invmod test */ + do { rand_num2(&a); rand_num2(&b); b.dp[0] |= 1; 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);