From c9fe802b9ba51d6d30b36416603f01932d122a1f Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Fri, 26 Apr 2013 23:16:30 -0700 Subject: [PATCH] Remove/ignore unused vars, use unsigned long long to iterate over sizes --- .../crypto_scalarmult/curve25519/ref/smult_curve25519_ref.c | 1 - src/libsodium/crypto_stream/aes256estream/hongjun/aes256-ctr.c | 3 +++ src/libsodium/crypto_stream/aes256estream/hongjun/aes256.h | 2 +- src/libsodium/crypto_stream/salsa20/ref/stream_salsa20.c | 2 +- src/libsodium/crypto_stream/salsa20/ref/xor_salsa20.c | 2 +- src/libsodium/crypto_stream/salsa2012/ref/stream_salsa2012.c | 2 +- src/libsodium/crypto_stream/salsa2012/ref/xor_salsa2012.c | 2 +- src/libsodium/crypto_stream/salsa208/ref/stream_salsa208.c | 2 +- src/libsodium/crypto_stream/salsa208/ref/xor_salsa208.c | 2 +- 9 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/libsodium/crypto_scalarmult/curve25519/ref/smult_curve25519_ref.c b/src/libsodium/crypto_scalarmult/curve25519/ref/smult_curve25519_ref.c index 1c82d682..ba201955 100644 --- a/src/libsodium/crypto_scalarmult/curve25519/ref/smult_curve25519_ref.c +++ b/src/libsodium/crypto_scalarmult/curve25519/ref/smult_curve25519_ref.c @@ -139,7 +139,6 @@ static void mainloop(unsigned int work[64],const unsigned char e[32]) unsigned int s[32]; unsigned int t[32]; unsigned int u[32]; - unsigned int i; unsigned int j; unsigned int b; int pos; diff --git a/src/libsodium/crypto_stream/aes256estream/hongjun/aes256-ctr.c b/src/libsodium/crypto_stream/aes256estream/hongjun/aes256-ctr.c index d446934f..3aa970ec 100644 --- a/src/libsodium/crypto_stream/aes256estream/hongjun/aes256-ctr.c +++ b/src/libsodium/crypto_stream/aes256estream/hongjun/aes256-ctr.c @@ -19,6 +19,8 @@ ECRYPT_keysetup(ECRYPT_ctx* ctx, const u8* key, u32 keysize, u32 ivsize) unsigned int w[Nk*(Nr+1)], temp; int i, j; + (void) keysize; + (void) ivsize; (void) sizeof(char[sizeof *ctx == crypto_stream_BEFORENMBYTES ? 1 : -1]); for( i = 0; i < Nk; i++ ) { @@ -99,6 +101,7 @@ ECRYPT_process_bytes(int action, ECRYPT_ctx* ctx, const u8* input, u8* output, u8 keystream[16]; u32 i; + (void) action; memset(keystream, 0, sizeof keystream); partial_precompute_tworounds(ctx); diff --git a/src/libsodium/crypto_stream/aes256estream/hongjun/aes256.h b/src/libsodium/crypto_stream/aes256estream/hongjun/aes256.h index b9847d76..4e8eb40f 100644 --- a/src/libsodium/crypto_stream/aes256estream/hongjun/aes256.h +++ b/src/libsodium/crypto_stream/aes256estream/hongjun/aes256.h @@ -136,7 +136,7 @@ */ #define aes256_enc_block(x,output,ctx) {\ - u32 y0,y1,y2,y3;\ + u32 y0;\ u32 z0,z1,z2,z3;\ u32 a0,a1,a2,a3;\ u32 b0,b1,b2,b3;\ diff --git a/src/libsodium/crypto_stream/salsa20/ref/stream_salsa20.c b/src/libsodium/crypto_stream/salsa20/ref/stream_salsa20.c index e8dc4300..9f5087ce 100644 --- a/src/libsodium/crypto_stream/salsa20/ref/stream_salsa20.c +++ b/src/libsodium/crypto_stream/salsa20/ref/stream_salsa20.c @@ -21,7 +21,7 @@ int crypto_stream( { unsigned char in[16]; unsigned char block[64]; - int i; + unsigned long long i; unsigned int u; if (!clen) return 0; diff --git a/src/libsodium/crypto_stream/salsa20/ref/xor_salsa20.c b/src/libsodium/crypto_stream/salsa20/ref/xor_salsa20.c index 814f0fb0..925f0572 100644 --- a/src/libsodium/crypto_stream/salsa20/ref/xor_salsa20.c +++ b/src/libsodium/crypto_stream/salsa20/ref/xor_salsa20.c @@ -22,7 +22,7 @@ int crypto_stream_xor( { unsigned char in[16]; unsigned char block[64]; - int i; + unsigned long long i; unsigned int u; if (!mlen) return 0; diff --git a/src/libsodium/crypto_stream/salsa2012/ref/stream_salsa2012.c b/src/libsodium/crypto_stream/salsa2012/ref/stream_salsa2012.c index 70c498ce..793adaa5 100644 --- a/src/libsodium/crypto_stream/salsa2012/ref/stream_salsa2012.c +++ b/src/libsodium/crypto_stream/salsa2012/ref/stream_salsa2012.c @@ -21,7 +21,7 @@ int crypto_stream( { unsigned char in[16]; unsigned char block[64]; - int i; + unsigned long long i; unsigned int u; if (!clen) return 0; diff --git a/src/libsodium/crypto_stream/salsa2012/ref/xor_salsa2012.c b/src/libsodium/crypto_stream/salsa2012/ref/xor_salsa2012.c index c8193742..5970ca46 100644 --- a/src/libsodium/crypto_stream/salsa2012/ref/xor_salsa2012.c +++ b/src/libsodium/crypto_stream/salsa2012/ref/xor_salsa2012.c @@ -22,7 +22,7 @@ int crypto_stream_xor( { unsigned char in[16]; unsigned char block[64]; - int i; + unsigned long long i; unsigned int u; if (!mlen) return 0; diff --git a/src/libsodium/crypto_stream/salsa208/ref/stream_salsa208.c b/src/libsodium/crypto_stream/salsa208/ref/stream_salsa208.c index 28e3de71..08890021 100644 --- a/src/libsodium/crypto_stream/salsa208/ref/stream_salsa208.c +++ b/src/libsodium/crypto_stream/salsa208/ref/stream_salsa208.c @@ -21,7 +21,7 @@ int crypto_stream( { unsigned char in[16]; unsigned char block[64]; - int i; + unsigned long long i; unsigned int u; if (!clen) return 0; diff --git a/src/libsodium/crypto_stream/salsa208/ref/xor_salsa208.c b/src/libsodium/crypto_stream/salsa208/ref/xor_salsa208.c index 706a3604..9f6dac55 100644 --- a/src/libsodium/crypto_stream/salsa208/ref/xor_salsa208.c +++ b/src/libsodium/crypto_stream/salsa208/ref/xor_salsa208.c @@ -22,7 +22,7 @@ int crypto_stream_xor( { unsigned char in[16]; unsigned char block[64]; - int i; + unsigned long long i; unsigned int u; if (!mlen) return 0;