diff --git a/test/default/auth.c b/test/default/auth.c index 5da0d0e3..88c8207f 100644 --- a/test/default/auth.c +++ b/test/default/auth.c @@ -5,14 +5,14 @@ /* "Test Case 2" from RFC 4231 */ unsigned char key[32] = "Jefe"; -unsigned char c[28] = "what do ya want for nothing?"; +unsigned char c[] = "what do ya want for nothing?"; unsigned char a[32]; int main(void) { int i; - crypto_auth_hmacsha512256(a,c,sizeof c,key); + crypto_auth_hmacsha512256(a,c,sizeof c - 1U,key); for (i = 0;i < 32;++i) { printf(",0x%02x",(unsigned int) a[i]); if (i % 8 == 7) printf("\n"); diff --git a/test/default/hash.c b/test/default/hash.c index fa0c29a8..47950fc7 100644 --- a/test/default/hash.c +++ b/test/default/hash.c @@ -3,13 +3,13 @@ #define TEST_NAME "hash" #include "cmptest.h" -unsigned char x[8] = "testing\n"; +unsigned char x[] = "testing\n"; unsigned char h[crypto_hash_BYTES]; int main(void) { int i; - crypto_hash(h,x,sizeof x); + crypto_hash(h,x,sizeof x - 1U); for (i = 0;i < crypto_hash_BYTES;++i) printf("%02x",(unsigned int) h[i]); printf("\n"); return 0; diff --git a/test/default/hash3.c b/test/default/hash3.c index e56660b7..2fae6200 100644 --- a/test/default/hash3.c +++ b/test/default/hash3.c @@ -3,13 +3,13 @@ #define TEST_NAME "hash3" #include "cmptest.h" -unsigned char x[8] = "testing\n"; +unsigned char x[] = "testing\n"; unsigned char h[crypto_hash_sha512_BYTES]; int main(void) { int i; - crypto_hash_sha512(h,x,sizeof x); + crypto_hash_sha512(h,x,sizeof x - 1U); for (i = 0;i < crypto_hash_sha512_BYTES;++i) printf("%02x",(unsigned int) h[i]); printf("\n"); return 0;