mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-30 01:48:54 +00:00
Fix -Wsign-compare warnings in NaCl code
Make loop counters unsigned
This commit is contained in:
parent
075f9c7c27
commit
7582f24e9c
@ -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];
|
||||||
|
@ -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];
|
||||||
|
@ -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];
|
||||||
|
@ -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];
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user