Avoid using %zu in selftest functions
This is a C99 feature and unfortunately we can't rely on it yet considering
the set of toolchain (versions) we want to support.
diff --git a/library/aead_chacha20_poly1305.c b/library/aead_chacha20_poly1305.c
index 2e07f1e..f00380c 100644
--- a/library/aead_chacha20_poly1305.c
+++ b/library/aead_chacha20_poly1305.c
@@ -421,7 +421,7 @@
int mbedtls_aead_chacha20_poly1305_self_test( int verbose )
{
- size_t i;
+ unsigned i;
int result;
unsigned char output[200];
unsigned char mac[16];
@@ -430,7 +430,7 @@
{
if ( verbose != 0 )
{
- mbedtls_printf( " ChaCha20-Poly1305 test %zu ", i );
+ mbedtls_printf( " ChaCha20-Poly1305 test %u ", i );
}
result = mbedtls_aead_chacha20_poly1305_crypt_and_mac( test_key[i],
diff --git a/library/chacha20.c b/library/chacha20.c
index 5d2c3e5..28133a6 100644
--- a/library/chacha20.c
+++ b/library/chacha20.c
@@ -554,14 +554,14 @@
int mbedtls_chacha20_self_test( int verbose )
{
unsigned char output[381];
- size_t i;
+ unsigned i;
int result;
for ( i = 0U; i < 2U; i++ )
{
if ( verbose != 0 )
{
- mbedtls_printf( " ChaCha20 test %zu ", i );
+ mbedtls_printf( " ChaCha20 test %u ", i );
}
result = mbedtls_chacha20_crypt( test_keys[i],
diff --git a/library/poly1305.c b/library/poly1305.c
index 6acbc7f..5a09658 100644
--- a/library/poly1305.c
+++ b/library/poly1305.c
@@ -485,14 +485,14 @@
int mbedtls_poly1305_self_test( int verbose )
{
unsigned char mac[16];
- size_t i;
+ unsigned i;
int result;
for ( i = 0U; i < 2U; i++ )
{
if ( verbose != 0 )
{
- mbedtls_printf( " Poly1305 test %zu ", i );
+ mbedtls_printf( " Poly1305 test %u ", i );
}
result = mbedtls_poly1305_mac( test_keys[i],