Commit 19fa22a4 authored by Niels Möller's avatar Niels Möller

test: Use %u and corresponding cast, when printing bit sizes.

parent c10336bf
2019-01-10 Niels Möller <nisse@lysator.liu.se>
* testsuite/rsa-compute-root-test.c (test_one): Use %u and
corresponding cast, when printing bit sizes.
2019-01-09 Niels Möller <nisse@lysator.liu.se> 2019-01-09 Niels Möller <nisse@lysator.liu.se>
* examples/nettle-benchmark.c (GET_CYCLE_COUNTER): Add volatile to * examples/nettle-benchmark.c (GET_CYCLE_COUNTER): Add volatile to
......
...@@ -37,11 +37,11 @@ test_one (gmp_randstate_t *rands, struct rsa_public_key *pub, ...@@ -37,11 +37,11 @@ test_one (gmp_randstate_t *rands, struct rsa_public_key *pub,
if (mpz_cmp (plaintext, decrypted)) { if (mpz_cmp (plaintext, decrypted)) {
fprintf (stderr, "rsa_compute_root_tr failed\n"); fprintf (stderr, "rsa_compute_root_tr failed\n");
fprintf(stderr, "Public key: size=%lu\n n:", pub->size); fprintf(stderr, "Public key: size=%u\n n:", (unsigned) pub->size);
mpz_out_str (stderr, 10, pub->n); mpz_out_str (stderr, 10, pub->n);
fprintf(stderr, "\n e:"); fprintf(stderr, "\n e:");
mpz_out_str (stderr, 10, pub->e); mpz_out_str (stderr, 10, pub->e);
fprintf(stderr, "\nPrivate key: size=%lu\n p:", key->size); fprintf(stderr, "\nPrivate key: size=%u\n p:", (unsigned) key->size);
mpz_out_str (stderr, 10, key->p); mpz_out_str (stderr, 10, key->p);
fprintf(stderr, "\n q:"); fprintf(stderr, "\n q:");
mpz_out_str (stderr, 10, key->q); mpz_out_str (stderr, 10, key->q);
...@@ -55,13 +55,13 @@ test_one (gmp_randstate_t *rands, struct rsa_public_key *pub, ...@@ -55,13 +55,13 @@ test_one (gmp_randstate_t *rands, struct rsa_public_key *pub,
mpz_out_str (stderr, 10, key->d); mpz_out_str (stderr, 10, key->d);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
fprintf (stderr, "plaintext(%lu) = ", mpz_sizeinbase (plaintext, 2)); fprintf (stderr, "plaintext(%u) = ", (unsigned) mpz_sizeinbase (plaintext, 2));
mpz_out_str (stderr, 10, plaintext); mpz_out_str (stderr, 10, plaintext);
fprintf (stderr, "\n"); fprintf (stderr, "\n");
fprintf (stderr, "ciphertext(%lu) = ", mpz_sizeinbase (ciphertext, 2)); fprintf (stderr, "ciphertext(%u) = ", (unsigned) mpz_sizeinbase (ciphertext, 2));
mpz_out_str (stderr, 10, ciphertext); mpz_out_str (stderr, 10, ciphertext);
fprintf (stderr, "\n"); fprintf (stderr, "\n");
fprintf (stderr, "decrypted(%lu) = ", mpz_sizeinbase (decrypted, 2)); fprintf (stderr, "decrypted(%u) = ", (unsigned) mpz_sizeinbase (decrypted, 2));
mpz_out_str (stderr, 10, decrypted); mpz_out_str (stderr, 10, decrypted);
fprintf (stderr, "\n"); fprintf (stderr, "\n");
abort(); abort();
......
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