Fix -Wsign-compare warnings in NaCl code

Make loop counters unsigned
This commit is contained in:
Andrew Bettison 2013-12-11 13:58:51 +10:30
parent 075f9c7c27
commit 7582f24e9c
10 changed files with 10 additions and 10 deletions

View File

@ -26,7 +26,7 @@ int crypto_auth(unsigned char *out,const unsigned char *in,unsigned long long in
{ {
unsigned char h[32]; unsigned char h[32];
unsigned char padded[128]; unsigned char padded[128];
int i; unsigned i;
unsigned long long bits = 512 + (inlen << 3); unsigned long long bits = 512 + (inlen << 3);
for (i = 0;i < 32;++i) h[i] = iv[i]; for (i = 0;i < 32;++i) h[i] = iv[i];

View File

@ -26,7 +26,7 @@ int crypto_auth(unsigned char *out,const unsigned char *in,unsigned long long in
{ {
unsigned char h[64]; unsigned char h[64];
unsigned char padded[256]; unsigned char padded[256];
int i; unsigned i;
unsigned long long bytes = 128 + inlen; unsigned long long bytes = 128 + inlen;
for (i = 0;i < 64;++i) h[i] = iv[i]; for (i = 0;i < 64;++i) h[i] = iv[i];

View File

@ -26,7 +26,7 @@ int crypto_hash(unsigned char *out,const unsigned char *in,unsigned long long in
{ {
unsigned char h[32]; unsigned char h[32];
unsigned char padded[128]; unsigned char padded[128];
int i; unsigned i;
unsigned long long bits = inlen << 3; unsigned long long bits = inlen << 3;
for (i = 0;i < 32;++i) h[i] = iv[i]; for (i = 0;i < 32;++i) h[i] = iv[i];

View File

@ -26,7 +26,7 @@ int crypto_hash(unsigned char *out,const unsigned char *in,unsigned long long in
{ {
unsigned char h[64]; unsigned char h[64];
unsigned char padded[256]; unsigned char padded[256];
int i; unsigned i;
unsigned long long bytes = inlen; unsigned long long bytes = inlen;
for (i = 0;i < 64;++i) h[i] = iv[i]; for (i = 0;i < 64;++i) h[i] = iv[i];

View File

@ -19,7 +19,7 @@ int crypto_stream(
{ {
unsigned char in[16]; unsigned char in[16];
unsigned char block[64]; unsigned char block[64];
int i; unsigned i;
unsigned int u; unsigned int u;
if (!clen) return 0; if (!clen) return 0;

View File

@ -20,7 +20,7 @@ int crypto_stream_xor(
{ {
unsigned char in[16]; unsigned char in[16];
unsigned char block[64]; unsigned char block[64];
int i; unsigned i;
unsigned int u; unsigned int u;
if (!mlen) return 0; if (!mlen) return 0;

View File

@ -19,7 +19,7 @@ int crypto_stream(
{ {
unsigned char in[16]; unsigned char in[16];
unsigned char block[64]; unsigned char block[64];
int i; unsigned i;
unsigned int u; unsigned int u;
if (!clen) return 0; if (!clen) return 0;

View File

@ -20,7 +20,7 @@ int crypto_stream_xor(
{ {
unsigned char in[16]; unsigned char in[16];
unsigned char block[64]; unsigned char block[64];
int i; unsigned i;
unsigned int u; unsigned int u;
if (!mlen) return 0; if (!mlen) return 0;

View File

@ -19,7 +19,7 @@ int crypto_stream(
{ {
unsigned char in[16]; unsigned char in[16];
unsigned char block[64]; unsigned char block[64];
int i; unsigned i;
unsigned int u; unsigned int u;
if (!clen) return 0; if (!clen) return 0;

View File

@ -20,7 +20,7 @@ int crypto_stream_xor(
{ {
unsigned char in[16]; unsigned char in[16];
unsigned char block[64]; unsigned char block[64];
int i; unsigned i;
unsigned int u; unsigned int u;
if (!mlen) return 0; if (!mlen) return 0;