Tests: use size_t for sizes, not int.

Remove unused variables by the way.
This commit is contained in:
Frank Denis 2013-04-26 23:25:14 -07:00
parent e1a0faee7f
commit 0afc36c827
7 changed files with 9 additions and 11 deletions

View File

@ -12,7 +12,6 @@ unsigned char a[32];
int main(void)
{
int clen;
int i;
for (clen = 0;clen < 10000;++clen) {
randombytes(key,sizeof key);
randombytes(c,clen);

View File

@ -14,8 +14,8 @@ unsigned char m2[10000];
int main(void)
{
int mlen;
int i;
size_t mlen;
size_t i;
for (mlen = 0;mlen < 1000 && mlen + crypto_box_ZEROBYTES < sizeof m;++mlen) {
crypto_box_keypair(alicepk,alicesk);

View File

@ -16,8 +16,8 @@ unsigned char m2[10000];
int main(void)
{
int mlen;
int i;
size_t mlen;
size_t i;
int caught;
for (mlen = 0;mlen < 1000 && mlen + crypto_box_ZEROBYTES < sizeof m;++mlen) {

View File

@ -9,7 +9,7 @@ int main(void)
{
#define MAXLEN 64
crypto_uint8 in[MAXLEN], out[crypto_generichash_BYTES_MAX], k[crypto_generichash_KEYBYTES_MAX];
int h,i,j;
size_t h,i,j;
for(h = 0; h < crypto_generichash_KEYBYTES_MAX; ++h) k[h] = h;

View File

@ -12,7 +12,6 @@ unsigned char a[16];
int main(void)
{
int clen;
int i;
for (clen = 0;clen < 10000;++clen) {
randombytes(key,sizeof key);
randombytes(c,clen);

View File

@ -11,8 +11,8 @@ unsigned char m2[10000];
int main(void)
{
int mlen;
int i;
size_t mlen;
size_t i;
for (mlen = 0;mlen < 1000 && mlen + crypto_secretbox_ZEROBYTES < sizeof m;++mlen) {
randombytes(k,crypto_secretbox_KEYBYTES);

View File

@ -13,8 +13,8 @@ unsigned char m2[10000];
int main(void)
{
int mlen;
int i;
size_t mlen;
size_t i;
int caught;
for (mlen = 0;mlen < 1000 && mlen + crypto_secretbox_ZEROBYTES < sizeof m;++mlen) {