diff options
author | Niels Möller <nisse@lysator.liu.se> | 2019-01-10 21:59:03 +0100 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2019-01-10 21:59:03 +0100 |
commit | 19fa22a4183d922ad665aa1fc142cdab750b7963 (patch) | |
tree | 57a3ef464473efc262161362b9478eb5ab7c74f2 /testsuite | |
parent | c10336bfdeb1c2ef83b6dd6a973a717257943320 (diff) | |
download | nettle-19fa22a4183d922ad665aa1fc142cdab750b7963.tar.gz |
test: Use %u and corresponding cast, when printing bit sizes.
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/rsa-compute-root-test.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/testsuite/rsa-compute-root-test.c b/testsuite/rsa-compute-root-test.c index 9e3cb7f8..e7bdb1f8 100644 --- a/testsuite/rsa-compute-root-test.c +++ b/testsuite/rsa-compute-root-test.c @@ -37,11 +37,11 @@ test_one (gmp_randstate_t *rands, struct rsa_public_key *pub, if (mpz_cmp (plaintext, decrypted)) { 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); fprintf(stderr, "\n 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); fprintf(stderr, "\n q:"); mpz_out_str (stderr, 10, key->q); @@ -55,13 +55,13 @@ test_one (gmp_randstate_t *rands, struct rsa_public_key *pub, mpz_out_str (stderr, 10, key->d); 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); 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); 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); fprintf (stderr, "\n"); abort(); |