diff options
author | 2017-11-03 12:33:44 -0400 | |
---|---|---|
committer | 2017-11-03 12:34:51 -0400 | |
commit | 737f2767f1748db67587d69846db71241f53a8de (patch) | |
tree | 5accc743c05c7cd2f1a638db964324869432d1cd | |
parent | d1dfd8db01df3b12dc5f9cff9abc8fbdf483f8af (diff) |
Fix a printf format specifier mismatch
The error message is
```
src/Specific/Framework/bench/gmpxx.cpp:23:121: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
printf(0x); for (size_t i = modulus_bytes-1; i<modulus_bytes; --i) { printf(%02x, mpz_class(x>>(8*i)).get_ui()&0xff); }
^
```
-rw-r--r-- | src/Specific/Framework/bench/gmpxx.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Specific/Framework/bench/gmpxx.cpp b/src/Specific/Framework/bench/gmpxx.cpp index 322d54b52..964cefaba 100644 --- a/src/Specific/Framework/bench/gmpxx.cpp +++ b/src/Specific/Framework/bench/gmpxx.cpp @@ -20,7 +20,7 @@ static const size_t modulus_bytes = modulus_bytes_val; static const unsigned int a24 = a24_hex; static void fe_print(const mpz_class &x) { - printf("0x"); for (size_t i = modulus_bytes-1; i<modulus_bytes; --i) { printf("%02x", mpz_class(x>>(8*i)).get_ui()&0xff); } + printf("0x"); for (size_t i = modulus_bytes-1; i<modulus_bytes; --i) { printf("%02lx", mpz_class(x>>(8*i)).get_ui()&0xff); } } static void fe_print_frac(mpz_class x, mpz_class z) { @@ -142,7 +142,7 @@ int main() { uint8_t point[modulus_bytes]; for (int i = 0; i < modulus_bytes; i++) { point[modulus_bytes-i] = i; } - + for (int i = 0; i < 1000; i++) { for (int j = 0; j<modulus_bytes; j++) { secret[j%32] ^= point[j]; |