Commit 1f5b9812 authored by Niels Möller's avatar Niels Möller

tests: Fix assert call with side effects.

(cherry picked from commit 73d3c6d5)
parent 19fa22a4
...@@ -12,6 +12,11 @@ ...@@ -12,6 +12,11 @@
* sha512-compress.c: Add missing include of sha2-internal.h. * sha512-compress.c: Add missing include of sha2-internal.h.
2019-01-06 Niels Möller <nisse@lysator.liu.se>
* testsuite/rsa-compute-root-test.c (generate_keypair): Fix assert
call with side-effects.
2018-12-26 Niels Möller <nisse@lysator.liu.se> 2018-12-26 Niels Möller <nisse@lysator.liu.se>
* examples/hogweed-benchmark.c (make_openssl_rsa_ctx): New helper * examples/hogweed-benchmark.c (make_openssl_rsa_ctx): New helper
......
...@@ -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