Commit 73d3c6d5 authored by Niels Möller's avatar Niels Möller

tests: Fix assert call with side effects.

parent c8f4de1f
2019-01-06 Niels Möller <>
* testsuite/rsa-compute-root-test.c (generate_keypair): Fix assert
call with side-effects.
2018-02-18 Dmitry Eremin-Solenikov <> 2018-02-18 Dmitry Eremin-Solenikov <>
Backported from master branch. Backported from master branch.
...@@ -86,6 +86,7 @@ generate_keypair (gmp_randstate_t rands, ...@@ -86,6 +86,7 @@ generate_keypair (gmp_randstate_t rands,
mpz_t q1; mpz_t q1;
mpz_t phi; mpz_t phi;
mpz_t tmp; mpz_t tmp;
int res;
mpz_init (p1); mpz_init (p1);
mpz_init (q1); mpz_init (q1);
...@@ -124,7 +125,8 @@ generate_keypair (gmp_randstate_t rands, ...@@ -124,7 +125,8 @@ generate_keypair (gmp_randstate_t rands,
} }
mpz_mul(phi, p1, q1); mpz_mul(phi, p1, q1);
assert (mpz_invert(key->d, pub->e, phi)); res = mpz_invert(key->d, pub->e, phi);
assert (res);
mpz_fdiv_r (key->a, key->d, p1); mpz_fdiv_r (key->a, key->d, p1);
mpz_fdiv_r (key->b, key->d, q1); mpz_fdiv_r (key->b, key->d, q1);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment