From d8b9b395a3efda437135af73bae0cac52aa30272 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 23 Nov 2015 16:07:13 +0100 Subject: [PATCH] Mark everything as static in tests --- test/default/auth.c | 10 +++++----- test/default/auth2.c | 6 +++--- test/default/auth3.c | 6 +++--- test/default/auth5.c | 6 +++--- test/default/auth6.c | 6 +++--- test/default/auth7.c | 6 +++--- test/default/box.c | 15 ++++++++------- test/default/box2.c | 15 ++++++++------- test/default/box7.c | 16 ++++++++-------- test/default/box8.c | 16 ++++++++-------- test/default/box_easy.c | 15 ++++++++------- test/default/box_easy2.c | 6 +++--- test/default/box_seed.c | 2 +- test/default/core1.c | 11 ++++++----- test/default/core2.c | 11 ++++++----- test/default/core3.c | 15 ++++++++------- test/default/core4.c | 19 +++++++++++-------- test/default/core5.c | 12 +++++++----- test/default/core6.c | 14 ++++++++------ test/default/hash.c | 6 +++--- test/default/hash3.c | 4 ++-- test/default/onetimeauth.c | 6 +++--- test/default/onetimeauth2.c | 9 +++++---- test/default/onetimeauth7.c | 6 +++--- test/default/randombytes.c | 4 ++-- test/default/scalarmult.c | 8 ++++---- test/default/scalarmult2.c | 4 ++-- test/default/scalarmult5.c | 6 +++--- test/default/scalarmult6.c | 4 ++-- test/default/scalarmult7.c | 10 +++++----- test/default/secretbox.c | 13 +++++++------ test/default/secretbox2.c | 13 +++++++------ test/default/secretbox7.c | 10 +++++----- test/default/secretbox8.c | 10 +++++----- test/default/secretbox_easy.c | 11 ++++++----- test/default/secretbox_easy2.c | 12 ++++++------ test/default/stream.c | 13 +++++++------ test/default/stream2.c | 8 ++++---- test/default/stream3.c | 11 ++++++----- test/default/stream4.c | 13 +++++++------ test/default/verify1.c | 6 +++--- 41 files changed, 207 insertions(+), 187 deletions(-) diff --git a/test/default/auth.c b/test/default/auth.c index f9ecbeb7..417d8026 100644 --- a/test/default/auth.c +++ b/test/default/auth.c @@ -3,14 +3,14 @@ #include "cmptest.h" /* "Test Case 2" from RFC 4231 */ -unsigned char key[32] = "Jefe"; -unsigned char c[] = "what do ya want for nothing?"; +static unsigned char key[32] = "Jefe"; +static unsigned char c[] = "what do ya want for nothing?"; /* Hacker manifesto */ -unsigned char key2[] = "Another one got caught today, it's all over the papers. \"Teenager Arrested in Computer Crime Scandal\", \"Hacker Arrested after Bank Tampering\"... Damn kids. They're all alike."; +static unsigned char key2[] = "Another one got caught today, it's all over the papers. \"Teenager Arrested in Computer Crime Scandal\", \"Hacker Arrested after Bank Tampering\"... Damn kids. They're all alike."; -unsigned char a[crypto_auth_BYTES]; -unsigned char a2[crypto_auth_hmacsha512_BYTES]; +static unsigned char a[crypto_auth_BYTES]; +static unsigned char a2[crypto_auth_hmacsha512_BYTES]; int main(void) { diff --git a/test/default/auth2.c b/test/default/auth2.c index ffab0226..564a3379 100644 --- a/test/default/auth2.c +++ b/test/default/auth2.c @@ -3,19 +3,19 @@ #define TEST_NAME "auth2" #include "cmptest.h" -unsigned char key[32] +static unsigned char key[32] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20 }; -unsigned char c[50] +static unsigned char c[50] = { 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd }; -unsigned char a[32]; +static unsigned char a[32]; int main(void) { diff --git a/test/default/auth3.c b/test/default/auth3.c index 3a299da4..4974b25e 100644 --- a/test/default/auth3.c +++ b/test/default/auth3.c @@ -3,19 +3,19 @@ #define TEST_NAME "auth3" #include "cmptest.h" -unsigned char key[32] +static unsigned char key[32] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20 }; -unsigned char c[50] +static unsigned char c[50] = { 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd, 0xcd }; -unsigned char a[32] +static unsigned char a[32] = { 0x37, 0x2e, 0xfc, 0xf9, 0xb4, 0x0b, 0x35, 0xc2, 0x11, 0x5b, 0x13, 0x46, 0x90, 0x3d, 0x2e, 0xf4, 0x2f, 0xce, 0xd4, 0x6f, 0x08, 0x46, 0xe7, 0x25, 0x7b, 0xb1, 0x56, 0xd3, 0xd7, 0xb3, 0x0d, 0x3f }; diff --git a/test/default/auth5.c b/test/default/auth5.c index 498e804c..6de53f15 100644 --- a/test/default/auth5.c +++ b/test/default/auth5.c @@ -2,9 +2,9 @@ #define TEST_NAME "auth5" #include "cmptest.h" -unsigned char key[32]; -unsigned char c[10000]; -unsigned char a[32]; +static unsigned char key[32]; +static unsigned char c[10000]; +static unsigned char a[32]; int main(void) { diff --git a/test/default/auth6.c b/test/default/auth6.c index 9e7b6716..4f63fece 100644 --- a/test/default/auth6.c +++ b/test/default/auth6.c @@ -3,10 +3,10 @@ #include "cmptest.h" /* "Test Case 2" from RFC 4231 */ -unsigned char key[32] = "Jefe"; -unsigned char c[] = "what do ya want for nothing?"; +static unsigned char key[32] = "Jefe"; +static unsigned char c[] = "what do ya want for nothing?"; -unsigned char a[64]; +static unsigned char a[64]; int main(void) { diff --git a/test/default/auth7.c b/test/default/auth7.c index f463b9d7..ffe00013 100644 --- a/test/default/auth7.c +++ b/test/default/auth7.c @@ -2,9 +2,9 @@ #define TEST_NAME "auth7" #include "cmptest.h" -unsigned char key[32]; -unsigned char c[10000]; -unsigned char a[64]; +static unsigned char key[32]; +static unsigned char c[10000]; +static unsigned char a[64]; int main(void) { diff --git a/test/default/box.c b/test/default/box.c index 68656db5..f78acb67 100644 --- a/test/default/box.c +++ b/test/default/box.c @@ -2,22 +2,23 @@ #define TEST_NAME "box" #include "cmptest.h" -unsigned char alicesk[32] +static unsigned char alicesk[32] = { 0x77, 0x07, 0x6d, 0x0a, 0x73, 0x18, 0xa5, 0x7d, 0x3c, 0x16, 0xc1, 0x72, 0x51, 0xb2, 0x66, 0x45, 0xdf, 0x4c, 0x2f, 0x87, 0xeb, 0xc0, 0x99, 0x2a, 0xb1, 0x77, 0xfb, 0xa5, 0x1d, 0xb9, 0x2c, 0x2a }; -unsigned char bobpk[32] +static unsigned char bobpk[32] = { 0xde, 0x9e, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4, 0xd3, 0x5b, 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37, 0x3f, 0x83, 0x43, 0xc8, 0x5b, 0x78, 0x67, 0x4d, 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f }; -unsigned char nonce[24] = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, 0x2b, 0x73, - 0xcd, 0x62, 0xbd, 0xa8, 0x75, 0xfc, 0x73, 0xd6, - 0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 }; +static unsigned char nonce[24] + = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, 0x2b, 0x73, + 0xcd, 0x62, 0xbd, 0xa8, 0x75, 0xfc, 0x73, 0xd6, + 0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 }; // API requires first 32 bytes to be 0 -unsigned char m[163] +static unsigned char m[163] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xbe, 0x07, 0x5f, 0xc5, @@ -33,7 +34,7 @@ unsigned char m[163] 0xf0, 0xa0, 0x89, 0xbc, 0x76, 0x89, 0x70, 0x40, 0xe0, 0x82, 0xf9, 0x37, 0x76, 0x38, 0x48, 0x64, 0x5e, 0x07, 0x05 }; -unsigned char c[163]; +static unsigned char c[163]; int main(void) { diff --git a/test/default/box2.c b/test/default/box2.c index d83690c6..2500da25 100644 --- a/test/default/box2.c +++ b/test/default/box2.c @@ -2,22 +2,23 @@ #define TEST_NAME "box2" #include "cmptest.h" -unsigned char bobsk[32] +static unsigned char bobsk[32] = { 0x5d, 0xab, 0x08, 0x7e, 0x62, 0x4a, 0x8a, 0x4b, 0x79, 0xe1, 0x7f, 0x8b, 0x83, 0x80, 0x0e, 0xe6, 0x6f, 0x3b, 0xb1, 0x29, 0x26, 0x18, 0xb6, 0xfd, 0x1c, 0x2f, 0x8b, 0x27, 0xff, 0x88, 0xe0, 0xeb }; -unsigned char alicepk[32] +static unsigned char alicepk[32] = { 0x85, 0x20, 0xf0, 0x09, 0x89, 0x30, 0xa7, 0x54, 0x74, 0x8b, 0x7d, 0xdc, 0xb4, 0x3e, 0xf7, 0x5a, 0x0d, 0xbf, 0x3a, 0x0d, 0x26, 0x38, 0x1a, 0xf4, 0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0x6a }; -unsigned char nonce[24] = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, 0x2b, 0x73, - 0xcd, 0x62, 0xbd, 0xa8, 0x75, 0xfc, 0x73, 0xd6, - 0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 }; +static unsigned char nonce[24] + = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, 0x2b, 0x73, + 0xcd, 0x62, 0xbd, 0xa8, 0x75, 0xfc, 0x73, 0xd6, + 0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 }; // API requires first 16 bytes to be 0 -unsigned char c[163] +static unsigned char c[163] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xf3, 0xff, 0xc7, 0x70, 0x3f, 0x94, 0x00, 0xe5, 0x2a, 0x7d, 0xfb, 0x4b, 0x3d, 0x33, 0x05, 0xd9, 0x8e, 0x99, 0x3b, 0x9f, @@ -33,7 +34,7 @@ unsigned char c[163] 0x79, 0x73, 0xf6, 0x22, 0xa4, 0x3d, 0x14, 0xa6, 0x59, 0x9b, 0x1f, 0x65, 0x4c, 0xb4, 0x5a, 0x74, 0xe3, 0x55, 0xa5 }; -unsigned char m[163]; +static unsigned char m[163]; int main(void) { diff --git a/test/default/box7.c b/test/default/box7.c index 1f4e6afe..8700782d 100644 --- a/test/default/box7.c +++ b/test/default/box7.c @@ -2,14 +2,14 @@ #define TEST_NAME "box7" #include "cmptest.h" -unsigned char alicesk[crypto_box_SECRETKEYBYTES]; -unsigned char alicepk[crypto_box_PUBLICKEYBYTES]; -unsigned char bobsk[crypto_box_SECRETKEYBYTES]; -unsigned char bobpk[crypto_box_PUBLICKEYBYTES]; -unsigned char n[crypto_box_NONCEBYTES]; -unsigned char m[10000]; -unsigned char c[10000]; -unsigned char m2[10000]; +static unsigned char alicesk[crypto_box_SECRETKEYBYTES]; +static unsigned char alicepk[crypto_box_PUBLICKEYBYTES]; +static unsigned char bobsk[crypto_box_SECRETKEYBYTES]; +static unsigned char bobpk[crypto_box_PUBLICKEYBYTES]; +static unsigned char n[crypto_box_NONCEBYTES]; +static unsigned char m[10000]; +static unsigned char c[10000]; +static unsigned char m2[10000]; int main(void) { diff --git a/test/default/box8.c b/test/default/box8.c index ace56d7b..ee1e7e0d 100644 --- a/test/default/box8.c +++ b/test/default/box8.c @@ -2,14 +2,14 @@ #define TEST_NAME "box8" #include "cmptest.h" -unsigned char alicesk[crypto_box_SECRETKEYBYTES]; -unsigned char alicepk[crypto_box_PUBLICKEYBYTES]; -unsigned char bobsk[crypto_box_SECRETKEYBYTES]; -unsigned char bobpk[crypto_box_PUBLICKEYBYTES]; -unsigned char n[crypto_box_NONCEBYTES]; -unsigned char m[10000]; -unsigned char c[10000]; -unsigned char m2[10000]; +static unsigned char alicesk[crypto_box_SECRETKEYBYTES]; +static unsigned char alicepk[crypto_box_PUBLICKEYBYTES]; +static unsigned char bobsk[crypto_box_SECRETKEYBYTES]; +static unsigned char bobpk[crypto_box_PUBLICKEYBYTES]; +static unsigned char n[crypto_box_NONCEBYTES]; +static unsigned char m[10000]; +static unsigned char c[10000]; +static unsigned char m2[10000]; int main(void) { diff --git a/test/default/box_easy.c b/test/default/box_easy.c index fca723d0..01810ced 100644 --- a/test/default/box_easy.c +++ b/test/default/box_easy.c @@ -2,21 +2,22 @@ #define TEST_NAME "box_easy" #include "cmptest.h" -unsigned char alicesk[32] +static unsigned char alicesk[32] = { 0x77, 0x07, 0x6d, 0x0a, 0x73, 0x18, 0xa5, 0x7d, 0x3c, 0x16, 0xc1, 0x72, 0x51, 0xb2, 0x66, 0x45, 0xdf, 0x4c, 0x2f, 0x87, 0xeb, 0xc0, 0x99, 0x2a, 0xb1, 0x77, 0xfb, 0xa5, 0x1d, 0xb9, 0x2c, 0x2a }; -unsigned char bobpk[32] +static unsigned char bobpk[32] = { 0xde, 0x9e, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4, 0xd3, 0x5b, 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37, 0x3f, 0x83, 0x43, 0xc8, 0x5b, 0x78, 0x67, 0x4d, 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f }; -unsigned char nonce[24] = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, 0x2b, 0x73, - 0xcd, 0x62, 0xbd, 0xa8, 0x75, 0xfc, 0x73, 0xd6, - 0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 }; +static unsigned char nonce[24] + = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, 0x2b, 0x73, + 0xcd, 0x62, 0xbd, 0xa8, 0x75, 0xfc, 0x73, 0xd6, + 0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 }; -unsigned char m[131] +static unsigned char m[131] = { 0xbe, 0x07, 0x5f, 0xc5, 0x3c, 0x81, 0xf2, 0xd5, 0xcf, 0x14, 0x13, 0x16, 0xeb, 0xeb, 0x0c, 0x7b, 0x52, 0x28, 0xc5, 0x2a, 0x4c, 0x62, 0xcb, 0xd4, 0x4b, 0x66, 0x84, 0x9b, 0x64, 0x24, 0x4f, 0xfc, 0xe5, 0xec, 0xba, 0xaf, @@ -29,7 +30,7 @@ unsigned char m[131] 0x60, 0x90, 0x2e, 0x52, 0xf0, 0xa0, 0x89, 0xbc, 0x76, 0x89, 0x70, 0x40, 0xe0, 0x82, 0xf9, 0x37, 0x76, 0x38, 0x48, 0x64, 0x5e, 0x07, 0x05 }; -unsigned char c[147 + crypto_box_MACBYTES]; +static unsigned char c[147 + crypto_box_MACBYTES]; int main(void) { diff --git a/test/default/box_easy2.c b/test/default/box_easy2.c index 5b0c2245..8848fea1 100644 --- a/test/default/box_easy2.c +++ b/test/default/box_easy2.c @@ -2,9 +2,9 @@ #define TEST_NAME "box_easy2" #include "cmptest.h" -unsigned char m[10000]; -unsigned char m2[10000]; -unsigned char c[crypto_box_MACBYTES + 10000]; +static unsigned char m[10000]; +static unsigned char m2[10000]; +static unsigned char c[crypto_box_MACBYTES + 10000]; int main(void) { diff --git a/test/default/box_seed.c b/test/default/box_seed.c index 5af2a507..3075659a 100644 --- a/test/default/box_seed.c +++ b/test/default/box_seed.c @@ -2,7 +2,7 @@ #define TEST_NAME "box_seed" #include "cmptest.h" -unsigned char seed[32] +static unsigned char seed[32] = { 0x77, 0x07, 0x6d, 0x0a, 0x73, 0x18, 0xa5, 0x7d, 0x3c, 0x16, 0xc1, 0x72, 0x51, 0xb2, 0x66, 0x45, 0xdf, 0x4c, 0x2f, 0x87, 0xeb, 0xc0, 0x99, 0x2a, 0xb1, 0x77, 0xfb, 0xa5, 0x1d, 0xb9, 0x2c, 0x2a }; diff --git a/test/default/core1.c b/test/default/core1.c index 44f90c4a..ce99627a 100644 --- a/test/default/core1.c +++ b/test/default/core1.c @@ -2,17 +2,18 @@ #define TEST_NAME "core1" #include "cmptest.h" -unsigned char shared[32] +static unsigned char shared[32] = { 0x4a, 0x5d, 0x9d, 0x5b, 0xa4, 0xce, 0x2d, 0xe1, 0x72, 0x8e, 0x3b, 0xf4, 0x80, 0x35, 0x0f, 0x25, 0xe0, 0x7e, 0x21, 0xc9, 0x47, 0xd1, 0x9e, 0x33, 0x76, 0xf0, 0x9b, 0x3c, 0x1e, 0x16, 0x17, 0x42 }; -unsigned char zero[32] = { 0 }; +static unsigned char zero[32]; -unsigned char c[16] = { 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x20, 0x33, - 0x32, 0x2d, 0x62, 0x79, 0x74, 0x65, 0x20, 0x6b }; +static unsigned char c[16] + = { 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x20, 0x33, + 0x32, 0x2d, 0x62, 0x79, 0x74, 0x65, 0x20, 0x6b }; -unsigned char firstkey[32]; +static unsigned char firstkey[32]; int main(void) { diff --git a/test/default/core2.c b/test/default/core2.c index 6870acbb..7577c1c3 100644 --- a/test/default/core2.c +++ b/test/default/core2.c @@ -2,19 +2,20 @@ #define TEST_NAME "core2" #include "cmptest.h" -unsigned char firstkey[32] +static unsigned char firstkey[32] = { 0x1b, 0x27, 0x55, 0x64, 0x73, 0xe9, 0x85, 0xd4, 0x62, 0xcd, 0x51, 0x19, 0x7a, 0x9a, 0x46, 0xc7, 0x60, 0x09, 0x54, 0x9e, 0xac, 0x64, 0x74, 0xf2, 0x06, 0xc4, 0xee, 0x08, 0x44, 0xf6, 0x83, 0x89 }; -unsigned char nonceprefix[16] +static unsigned char nonceprefix[16] = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, 0x2b, 0x73, 0xcd, 0x62, 0xbd, 0xa8, 0x75, 0xfc, 0x73, 0xd6 }; -unsigned char c[16] = { 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x20, 0x33, - 0x32, 0x2d, 0x62, 0x79, 0x74, 0x65, 0x20, 0x6b }; +static unsigned char c[16] + = { 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x20, 0x33, + 0x32, 0x2d, 0x62, 0x79, 0x74, 0x65, 0x20, 0x6b }; -unsigned char secondkey[32]; +static unsigned char secondkey[32]; int main(void) { diff --git a/test/default/core3.c b/test/default/core3.c index 210e25c8..0a6a02bf 100644 --- a/test/default/core3.c +++ b/test/default/core3.c @@ -2,22 +2,23 @@ #define TEST_NAME "core3" #include "cmptest.h" -unsigned char secondkey[32] +static unsigned char secondkey[32] = { 0xdc, 0x90, 0x8d, 0xda, 0x0b, 0x93, 0x44, 0xa9, 0x53, 0x62, 0x9b, 0x73, 0x38, 0x20, 0x77, 0x88, 0x80, 0xf3, 0xce, 0xb4, 0x21, 0xbb, 0x61, 0xb9, 0x1c, 0xbd, 0x4c, 0x3e, 0x66, 0x25, 0x6c, 0xe4 }; -unsigned char noncesuffix[8] +static unsigned char noncesuffix[8] = { 0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 }; -unsigned char c[16] = { 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x20, 0x33, - 0x32, 0x2d, 0x62, 0x79, 0x74, 0x65, 0x20, 0x6b }; +static unsigned char c[16] + = { 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x20, 0x33, + 0x32, 0x2d, 0x62, 0x79, 0x74, 0x65, 0x20, 0x6b }; -unsigned char in[16] = { 0 }; +static unsigned char in[16]; -unsigned char output[64 * 256 * 256]; +static unsigned char output[64 * 256 * 256]; -unsigned char h[32]; +static unsigned char h[32]; int main(void) { diff --git a/test/default/core4.c b/test/default/core4.c index 611d3928..1774ede6 100644 --- a/test/default/core4.c +++ b/test/default/core4.c @@ -2,17 +2,20 @@ #define TEST_NAME "core4" #include "cmptest.h" -unsigned char k[32] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216 }; +static unsigned char k[32] + = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216 }; -unsigned char in[16] = { 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116 }; +static unsigned char in[16] + = { 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116 }; -unsigned char c[16] = { 101, 120, 112, 97, 110, 100, 32, 51, - 50, 45, 98, 121, 116, 101, 32, 107 }; +static unsigned char c[16] + = { 101, 120, 112, 97, 110, 100, 32, 51, + 50, 45, 98, 121, 116, 101, 32, 107 }; -unsigned char out[64]; +static unsigned char out[64]; int main(void) { diff --git a/test/default/core5.c b/test/default/core5.c index cf373971..6df221dc 100644 --- a/test/default/core5.c +++ b/test/default/core5.c @@ -2,16 +2,18 @@ #define TEST_NAME "core5" #include "cmptest.h" -unsigned char k[32] +static unsigned char k[32] = { 0xee, 0x30, 0x4f, 0xca, 0x27, 0x00, 0x8d, 0x8c, 0x12, 0x6f, 0x90, 0x02, 0x79, 0x01, 0xd8, 0x0f, 0x7f, 0x1d, 0x8b, 0x8d, 0xc9, 0x36, 0xcf, 0x3b, 0x9f, 0x81, 0x96, 0x92, 0x82, 0x7e, 0x57, 0x77 }; -unsigned char in[16] = { 0x81, 0x91, 0x8e, 0xf2, 0xa5, 0xe0, 0xda, 0x9b, - 0x3e, 0x90, 0x60, 0x52, 0x1e, 0x4b, 0xb3, 0x52 }; +static unsigned char in[16] + = { 0x81, 0x91, 0x8e, 0xf2, 0xa5, 0xe0, 0xda, 0x9b, + 0x3e, 0x90, 0x60, 0x52, 0x1e, 0x4b, 0xb3, 0x52 }; -unsigned char c[16] = { 101, 120, 112, 97, 110, 100, 32, 51, - 50, 45, 98, 121, 116, 101, 32, 107 }; +static unsigned char c[16] + = { 101, 120, 112, 97, 110, 100, 32, 51, + 50, 45, 98, 121, 116, 101, 32, 107 }; unsigned char out[32]; diff --git a/test/default/core6.c b/test/default/core6.c index 67be3236..3c183df7 100644 --- a/test/default/core6.c +++ b/test/default/core6.c @@ -2,18 +2,20 @@ #define TEST_NAME "core6" #include "cmptest.h" -unsigned char k[32] +static unsigned char k[32] = { 0xee, 0x30, 0x4f, 0xca, 0x27, 0x00, 0x8d, 0x8c, 0x12, 0x6f, 0x90, 0x02, 0x79, 0x01, 0xd8, 0x0f, 0x7f, 0x1d, 0x8b, 0x8d, 0xc9, 0x36, 0xcf, 0x3b, 0x9f, 0x81, 0x96, 0x92, 0x82, 0x7e, 0x57, 0x77 }; -unsigned char in[16] = { 0x81, 0x91, 0x8e, 0xf2, 0xa5, 0xe0, 0xda, 0x9b, - 0x3e, 0x90, 0x60, 0x52, 0x1e, 0x4b, 0xb3, 0x52 }; +static unsigned char in[16] + = { 0x81, 0x91, 0x8e, 0xf2, 0xa5, 0xe0, 0xda, 0x9b, + 0x3e, 0x90, 0x60, 0x52, 0x1e, 0x4b, 0xb3, 0x52 }; -unsigned char c[16] = { 101, 120, 112, 97, 110, 100, 32, 51, - 50, 45, 98, 121, 116, 101, 32, 107 }; +static unsigned char c[16] + = { 101, 120, 112, 97, 110, 100, 32, 51, + 50, 45, 98, 121, 116, 101, 32, 107 }; -unsigned char out[64]; +static unsigned char out[64]; void print(unsigned char *x, unsigned char *y) { diff --git a/test/default/hash.c b/test/default/hash.c index 00c07231..ef27beef 100644 --- a/test/default/hash.c +++ b/test/default/hash.c @@ -2,9 +2,9 @@ #define TEST_NAME "hash" #include "cmptest.h" -unsigned char x[] = "testing\n"; -unsigned char x2[] = "The Conscience of a Hacker is a small essay written January 8, 1986 by a computer security hacker who went by the handle of The Mentor, who belonged to the 2nd generation of Legion of Doom."; -unsigned char h[crypto_hash_BYTES]; +static unsigned char x[] = "testing\n"; +static unsigned char x2[] = "The Conscience of a Hacker is a small essay written January 8, 1986 by a computer security hacker who went by the handle of The Mentor, who belonged to the 2nd generation of Legion of Doom."; +static unsigned char h[crypto_hash_BYTES]; int main(void) { diff --git a/test/default/hash3.c b/test/default/hash3.c index 01df6f0a..a15167b1 100644 --- a/test/default/hash3.c +++ b/test/default/hash3.c @@ -2,8 +2,8 @@ #define TEST_NAME "hash3" #include "cmptest.h" -unsigned char x[] = "testing\n"; -unsigned char h[crypto_hash_BYTES]; +static unsigned char x[] = "testing\n"; +static unsigned char h[crypto_hash_BYTES]; int main(void) { diff --git a/test/default/onetimeauth.c b/test/default/onetimeauth.c index d92a8b65..39361516 100644 --- a/test/default/onetimeauth.c +++ b/test/default/onetimeauth.c @@ -2,12 +2,12 @@ #define TEST_NAME "onetimeauth" #include "cmptest.h" -unsigned char rs[32] +static unsigned char rs[32] = { 0xee, 0xa6, 0xa7, 0x25, 0x1c, 0x1e, 0x72, 0x91, 0x6d, 0x11, 0xc2, 0xcb, 0x21, 0x4d, 0x3c, 0x25, 0x25, 0x39, 0x12, 0x1d, 0x8e, 0x23, 0x4e, 0x65, 0x2d, 0x65, 0x1f, 0xa4, 0xc8, 0xcf, 0xf8, 0x80 }; -unsigned char c[131] +static unsigned char c[131] = { 0x8e, 0x99, 0x3b, 0x9f, 0x48, 0x68, 0x12, 0x73, 0xc2, 0x96, 0x50, 0xba, 0x32, 0xfc, 0x76, 0xce, 0x48, 0x33, 0x2e, 0xa7, 0x16, 0x4d, 0x96, 0xa4, 0x47, 0x6f, 0xb8, 0xc5, 0x31, 0xa1, 0x18, 0x6a, 0xc0, 0xdf, 0xc1, 0x7c, @@ -20,7 +20,7 @@ unsigned char c[131] 0x88, 0xd5, 0xf9, 0xb3, 0x79, 0x73, 0xf6, 0x22, 0xa4, 0x3d, 0x14, 0xa6, 0x59, 0x9b, 0x1f, 0x65, 0x4c, 0xb4, 0x5a, 0x74, 0xe3, 0x55, 0xa5 }; -unsigned char a[16]; +static unsigned char a[16]; int main(void) { diff --git a/test/default/onetimeauth2.c b/test/default/onetimeauth2.c index e33a9fe6..d323f921 100644 --- a/test/default/onetimeauth2.c +++ b/test/default/onetimeauth2.c @@ -2,12 +2,12 @@ #define TEST_NAME "onetimeauth2" #include "cmptest.h" -unsigned char rs[32] +static unsigned char rs[32] = { 0xee, 0xa6, 0xa7, 0x25, 0x1c, 0x1e, 0x72, 0x91, 0x6d, 0x11, 0xc2, 0xcb, 0x21, 0x4d, 0x3c, 0x25, 0x25, 0x39, 0x12, 0x1d, 0x8e, 0x23, 0x4e, 0x65, 0x2d, 0x65, 0x1f, 0xa4, 0xc8, 0xcf, 0xf8, 0x80 }; -unsigned char c[131] +static unsigned char c[131] = { 0x8e, 0x99, 0x3b, 0x9f, 0x48, 0x68, 0x12, 0x73, 0xc2, 0x96, 0x50, 0xba, 0x32, 0xfc, 0x76, 0xce, 0x48, 0x33, 0x2e, 0xa7, 0x16, 0x4d, 0x96, 0xa4, 0x47, 0x6f, 0xb8, 0xc5, 0x31, 0xa1, 0x18, 0x6a, 0xc0, 0xdf, 0xc1, 0x7c, @@ -20,8 +20,9 @@ unsigned char c[131] 0x88, 0xd5, 0xf9, 0xb3, 0x79, 0x73, 0xf6, 0x22, 0xa4, 0x3d, 0x14, 0xa6, 0x59, 0x9b, 0x1f, 0x65, 0x4c, 0xb4, 0x5a, 0x74, 0xe3, 0x55, 0xa5 }; -unsigned char a[16] = { 0xf3, 0xff, 0xc7, 0x70, 0x3f, 0x94, 0x00, 0xe5, - 0x2a, 0x7d, 0xfb, 0x4b, 0x3d, 0x33, 0x05, 0xd9 }; +static unsigned char a[16] + = { 0xf3, 0xff, 0xc7, 0x70, 0x3f, 0x94, 0x00, 0xe5, + 0x2a, 0x7d, 0xfb, 0x4b, 0x3d, 0x33, 0x05, 0xd9 }; int main(void) { diff --git a/test/default/onetimeauth7.c b/test/default/onetimeauth7.c index 54689038..6c193fe1 100644 --- a/test/default/onetimeauth7.c +++ b/test/default/onetimeauth7.c @@ -2,9 +2,9 @@ #define TEST_NAME "onetimeauth7" #include "cmptest.h" -unsigned char key[32]; -unsigned char c[10000]; -unsigned char a[16]; +static unsigned char key[32]; +static unsigned char c[10000]; +static unsigned char a[16]; int main(void) { diff --git a/test/default/randombytes.c b/test/default/randombytes.c index 414a6d19..78c48dc9 100644 --- a/test/default/randombytes.c +++ b/test/default/randombytes.c @@ -2,8 +2,8 @@ #define TEST_NAME "randombytes" #include "cmptest.h" -unsigned char x[65536]; -unsigned long long freq[256]; +static unsigned char x[65536]; +static unsigned long long freq[256]; static int compat_tests(void) { diff --git a/test/default/scalarmult.c b/test/default/scalarmult.c index b09af5de..063dd5d2 100644 --- a/test/default/scalarmult.c +++ b/test/default/scalarmult.c @@ -2,22 +2,22 @@ #define TEST_NAME "scalarmult" #include "cmptest.h" -const unsigned char alicesk[crypto_scalarmult_BYTES] +static const unsigned char alicesk[crypto_scalarmult_BYTES] = { 0x77, 0x07, 0x6d, 0x0a, 0x73, 0x18, 0xa5, 0x7d, 0x3c, 0x16, 0xc1, 0x72, 0x51, 0xb2, 0x66, 0x45, 0xdf, 0x4c, 0x2f, 0x87, 0xeb, 0xc0, 0x99, 0x2a, 0xb1, 0x77, 0xfb, 0xa5, 0x1d, 0xb9, 0x2c, 0x2a }; -const unsigned char bobsk[crypto_scalarmult_BYTES] +static const unsigned char bobsk[crypto_scalarmult_BYTES] = { 0x5d, 0xab, 0x08, 0x7e, 0x62, 0x4a, 0x8a, 0x4b, 0x79, 0xe1, 0x7f, 0x8b, 0x83, 0x80, 0x0e, 0xe6, 0x6f, 0x3b, 0xb1, 0x29, 0x26, 0x18, 0xb6, 0xfd, 0x1c, 0x2f, 0x8b, 0x27, 0xff, 0x88, 0xe0, 0xeb }; -const unsigned char small_order_p[crypto_scalarmult_BYTES] +static const unsigned char small_order_p[crypto_scalarmult_BYTES] = { 0xe0, 0xeb, 0x7a, 0x7c, 0x3b, 0x41, 0xb8, 0xae, 0x16, 0x56, 0xe3, 0xfa, 0xf1, 0x9f, 0xc4, 0x6a, 0xda, 0x09, 0x8d, 0xeb, 0x9c, 0x32, 0xb1, 0xfd, 0x86, 0x62, 0x05, 0x16, 0x5f, 0x49, 0xb8, 0x00 }; -char hex[crypto_scalarmult_BYTES * 2 + 1]; +static char hex[crypto_scalarmult_BYTES * 2 + 1]; int main(void) { diff --git a/test/default/scalarmult2.c b/test/default/scalarmult2.c index b5593dfc..43bd6ab4 100644 --- a/test/default/scalarmult2.c +++ b/test/default/scalarmult2.c @@ -2,12 +2,12 @@ #define TEST_NAME "scalarmult2" #include "cmptest.h" -unsigned char bobsk[32] +static unsigned char bobsk[32] = { 0x5d, 0xab, 0x08, 0x7e, 0x62, 0x4a, 0x8a, 0x4b, 0x79, 0xe1, 0x7f, 0x8b, 0x83, 0x80, 0x0e, 0xe6, 0x6f, 0x3b, 0xb1, 0x29, 0x26, 0x18, 0xb6, 0xfd, 0x1c, 0x2f, 0x8b, 0x27, 0xff, 0x88, 0xe0, 0xeb }; -unsigned char bobpk[32]; +static unsigned char bobpk[32]; int main(void) { diff --git a/test/default/scalarmult5.c b/test/default/scalarmult5.c index a3d6f85e..2bc06d19 100644 --- a/test/default/scalarmult5.c +++ b/test/default/scalarmult5.c @@ -2,17 +2,17 @@ #define TEST_NAME "scalarmult5" #include "cmptest.h" -unsigned char alicesk[32] +static unsigned char alicesk[32] = { 0x77, 0x07, 0x6d, 0x0a, 0x73, 0x18, 0xa5, 0x7d, 0x3c, 0x16, 0xc1, 0x72, 0x51, 0xb2, 0x66, 0x45, 0xdf, 0x4c, 0x2f, 0x87, 0xeb, 0xc0, 0x99, 0x2a, 0xb1, 0x77, 0xfb, 0xa5, 0x1d, 0xb9, 0x2c, 0x2a }; -unsigned char bobpk[32] +static unsigned char bobpk[32] = { 0xde, 0x9e, 0xdb, 0x7d, 0x7b, 0x7d, 0xc1, 0xb4, 0xd3, 0x5b, 0x61, 0xc2, 0xec, 0xe4, 0x35, 0x37, 0x3f, 0x83, 0x43, 0xc8, 0x5b, 0x78, 0x67, 0x4d, 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f }; -unsigned char k[32]; +static unsigned char k[32]; int main(void) { diff --git a/test/default/scalarmult6.c b/test/default/scalarmult6.c index 3af459f2..6b9bd6ac 100644 --- a/test/default/scalarmult6.c +++ b/test/default/scalarmult6.c @@ -2,12 +2,12 @@ #define TEST_NAME "scalarmult6" #include "cmptest.h" -unsigned char bobsk_[crypto_scalarmult_SCALARBYTES] +static unsigned char bobsk_[crypto_scalarmult_SCALARBYTES] = { 0x5d, 0xab, 0x08, 0x7e, 0x62, 0x4a, 0x8a, 0x4b, 0x79, 0xe1, 0x7f, 0x8b, 0x83, 0x80, 0x0e, 0xe6, 0x6f, 0x3b, 0xb1, 0x29, 0x26, 0x18, 0xb6, 0xfd, 0x1c, 0x2f, 0x8b, 0x27, 0xff, 0x88, 0xe0, 0xeb }; -unsigned char alicepk_[crypto_scalarmult_SCALARBYTES] +static unsigned char alicepk_[crypto_scalarmult_SCALARBYTES] = { 0x85, 0x20, 0xf0, 0x09, 0x89, 0x30, 0xa7, 0x54, 0x74, 0x8b, 0x7d, 0xdc, 0xb4, 0x3e, 0xf7, 0x5a, 0x0d, 0xbf, 0x3a, 0x0d, 0x26, 0x38, 0x1a, 0xf4, 0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0x6a }; diff --git a/test/default/scalarmult7.c b/test/default/scalarmult7.c index 517be78e..8e1770cd 100644 --- a/test/default/scalarmult7.c +++ b/test/default/scalarmult7.c @@ -2,23 +2,23 @@ #define TEST_NAME "scalarmult7" #include "cmptest.h" -unsigned char p1[32] = { +static unsigned char p1[32] = { 0x72, 0x20, 0xf0, 0x09, 0x89, 0x30, 0xa7, 0x54, 0x74, 0x8b, 0x7d, 0xdc, 0xb4, 0x3e, 0xf7, 0x5a, 0x0d, 0xbf, 0x3a, 0x0d, 0x26, 0x38, 0x1a, 0xf4, 0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0xea }; -unsigned char p2[32] = { +static unsigned char p2[32] = { 0x85, 0x20, 0xf0, 0x09, 0x89, 0x30, 0xa7, 0x54, 0x74, 0x8b, 0x7d, 0xdc, 0xb4, 0x3e, 0xf7, 0x5a, 0x0d, 0xbf, 0x3a, 0x0d, 0x26, 0x38, 0x1a, 0xf4, 0xeb, 0xa4, 0xa9, 0x8e, 0xaa, 0x9b, 0x4e, 0x6a }; -unsigned char scalar[32]; -unsigned char out1[32]; -unsigned char out2[32]; +static unsigned char scalar[32]; +static unsigned char out1[32]; +static unsigned char out2[32]; int main(void) { diff --git a/test/default/secretbox.c b/test/default/secretbox.c index c1492ebc..64b240e1 100644 --- a/test/default/secretbox.c +++ b/test/default/secretbox.c @@ -2,17 +2,18 @@ #define TEST_NAME "secretbox" #include "cmptest.h" -unsigned char firstkey[32] +static unsigned char firstkey[32] = { 0x1b, 0x27, 0x55, 0x64, 0x73, 0xe9, 0x85, 0xd4, 0x62, 0xcd, 0x51, 0x19, 0x7a, 0x9a, 0x46, 0xc7, 0x60, 0x09, 0x54, 0x9e, 0xac, 0x64, 0x74, 0xf2, 0x06, 0xc4, 0xee, 0x08, 0x44, 0xf6, 0x83, 0x89 }; -unsigned char nonce[24] = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, 0x2b, 0x73, - 0xcd, 0x62, 0xbd, 0xa8, 0x75, 0xfc, 0x73, 0xd6, - 0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 }; +static unsigned char nonce[24] + = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, 0x2b, 0x73, + 0xcd, 0x62, 0xbd, 0xa8, 0x75, 0xfc, 0x73, 0xd6, + 0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 }; // API requires first 32 bytes to be 0 -unsigned char m[163] +static unsigned char m[163] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xbe, 0x07, 0x5f, 0xc5, @@ -28,7 +29,7 @@ unsigned char m[163] 0xf0, 0xa0, 0x89, 0xbc, 0x76, 0x89, 0x70, 0x40, 0xe0, 0x82, 0xf9, 0x37, 0x76, 0x38, 0x48, 0x64, 0x5e, 0x07, 0x05 }; -unsigned char c[163]; +static unsigned char c[163]; int main(void) { diff --git a/test/default/secretbox2.c b/test/default/secretbox2.c index 37fc6343..70fc9a09 100644 --- a/test/default/secretbox2.c +++ b/test/default/secretbox2.c @@ -2,17 +2,18 @@ #define TEST_NAME "secretbox2" #include "cmptest.h" -unsigned char firstkey[32] +static unsigned char firstkey[32] = { 0x1b, 0x27, 0x55, 0x64, 0x73, 0xe9, 0x85, 0xd4, 0x62, 0xcd, 0x51, 0x19, 0x7a, 0x9a, 0x46, 0xc7, 0x60, 0x09, 0x54, 0x9e, 0xac, 0x64, 0x74, 0xf2, 0x06, 0xc4, 0xee, 0x08, 0x44, 0xf6, 0x83, 0x89 }; -unsigned char nonce[24] = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, 0x2b, 0x73, - 0xcd, 0x62, 0xbd, 0xa8, 0x75, 0xfc, 0x73, 0xd6, - 0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 }; +static unsigned char nonce[24] + = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, 0x2b, 0x73, + 0xcd, 0x62, 0xbd, 0xa8, 0x75, 0xfc, 0x73, 0xd6, + 0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 }; // API requires first 16 bytes to be 0 -unsigned char c[163] +static unsigned char c[163] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xf3, 0xff, 0xc7, 0x70, 0x3f, 0x94, 0x00, 0xe5, 0x2a, 0x7d, 0xfb, 0x4b, 0x3d, 0x33, 0x05, 0xd9, 0x8e, 0x99, 0x3b, 0x9f, @@ -28,7 +29,7 @@ unsigned char c[163] 0x79, 0x73, 0xf6, 0x22, 0xa4, 0x3d, 0x14, 0xa6, 0x59, 0x9b, 0x1f, 0x65, 0x4c, 0xb4, 0x5a, 0x74, 0xe3, 0x55, 0xa5 }; -unsigned char m[163]; +static unsigned char m[163]; int main(void) { diff --git a/test/default/secretbox7.c b/test/default/secretbox7.c index 492dd343..555a52bf 100644 --- a/test/default/secretbox7.c +++ b/test/default/secretbox7.c @@ -2,11 +2,11 @@ #define TEST_NAME "secretbox7" #include "cmptest.h" -unsigned char k[crypto_secretbox_KEYBYTES]; -unsigned char n[crypto_secretbox_NONCEBYTES]; -unsigned char m[10000]; -unsigned char c[10000]; -unsigned char m2[10000]; +static unsigned char k[crypto_secretbox_KEYBYTES]; +static unsigned char n[crypto_secretbox_NONCEBYTES]; +static unsigned char m[10000]; +static unsigned char c[10000]; +static unsigned char m2[10000]; int main(void) { diff --git a/test/default/secretbox8.c b/test/default/secretbox8.c index 60d93e36..aceb978b 100644 --- a/test/default/secretbox8.c +++ b/test/default/secretbox8.c @@ -2,11 +2,11 @@ #define TEST_NAME "secretbox8" #include "cmptest.h" -unsigned char k[crypto_secretbox_KEYBYTES]; -unsigned char n[crypto_secretbox_NONCEBYTES]; -unsigned char m[10000]; -unsigned char c[10000]; -unsigned char m2[10000]; +static unsigned char k[crypto_secretbox_KEYBYTES]; +static unsigned char n[crypto_secretbox_NONCEBYTES]; +static unsigned char m[10000]; +static unsigned char c[10000]; +static unsigned char m2[10000]; int main(void) { diff --git a/test/default/secretbox_easy.c b/test/default/secretbox_easy.c index 3a4332a0..803a9224 100644 --- a/test/default/secretbox_easy.c +++ b/test/default/secretbox_easy.c @@ -2,16 +2,17 @@ #define TEST_NAME "secretbox_easy" #include "cmptest.h" -unsigned char firstkey[32] +static unsigned char firstkey[32] = { 0x1b, 0x27, 0x55, 0x64, 0x73, 0xe9, 0x85, 0xd4, 0x62, 0xcd, 0x51, 0x19, 0x7a, 0x9a, 0x46, 0xc7, 0x60, 0x09, 0x54, 0x9e, 0xac, 0x64, 0x74, 0xf2, 0x06, 0xc4, 0xee, 0x08, 0x44, 0xf6, 0x83, 0x89 }; -unsigned char nonce[24] = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, 0x2b, 0x73, - 0xcd, 0x62, 0xbd, 0xa8, 0x75, 0xfc, 0x73, 0xd6, - 0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 }; +static unsigned char nonce[24] + = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, 0x2b, 0x73, + 0xcd, 0x62, 0xbd, 0xa8, 0x75, 0xfc, 0x73, 0xd6, + 0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 }; -unsigned char m[131] +static unsigned char m[131] = { 0xbe, 0x07, 0x5f, 0xc5, 0x3c, 0x81, 0xf2, 0xd5, 0xcf, 0x14, 0x13, 0x16, 0xeb, 0xeb, 0x0c, 0x7b, 0x52, 0x28, 0xc5, 0x2a, 0x4c, 0x62, 0xcb, 0xd4, 0x4b, 0x66, 0x84, 0x9b, 0x64, 0x24, 0x4f, 0xfc, 0xe5, 0xec, 0xba, 0xaf, diff --git a/test/default/secretbox_easy2.c b/test/default/secretbox_easy2.c index 26e0193d..b9d5e1a1 100644 --- a/test/default/secretbox_easy2.c +++ b/test/default/secretbox_easy2.c @@ -2,12 +2,12 @@ #define TEST_NAME "secretbox_easy2" #include "cmptest.h" -unsigned char m[10000]; -unsigned char m2[10000]; -unsigned char c[crypto_secretbox_MACBYTES + 10000]; -unsigned char nonce[crypto_secretbox_NONCEBYTES]; -unsigned char k[crypto_secretbox_KEYBYTES]; -unsigned char mac[crypto_secretbox_MACBYTES]; +static unsigned char m[10000]; +static unsigned char m2[10000]; +static unsigned char c[crypto_secretbox_MACBYTES + 10000]; +static unsigned char nonce[crypto_secretbox_NONCEBYTES]; +static unsigned char k[crypto_secretbox_KEYBYTES]; +static unsigned char mac[crypto_secretbox_MACBYTES]; int main(void) { diff --git a/test/default/stream.c b/test/default/stream.c index 4447f430..a66fd99f 100644 --- a/test/default/stream.c +++ b/test/default/stream.c @@ -2,18 +2,19 @@ #define TEST_NAME "stream" #include "cmptest.h" -unsigned char firstkey[32] +static unsigned char firstkey[32] = { 0x1b, 0x27, 0x55, 0x64, 0x73, 0xe9, 0x85, 0xd4, 0x62, 0xcd, 0x51, 0x19, 0x7a, 0x9a, 0x46, 0xc7, 0x60, 0x09, 0x54, 0x9e, 0xac, 0x64, 0x74, 0xf2, 0x06, 0xc4, 0xee, 0x08, 0x44, 0xf6, 0x83, 0x89 }; -unsigned char nonce[24] = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, 0x2b, 0x73, - 0xcd, 0x62, 0xbd, 0xa8, 0x75, 0xfc, 0x73, 0xd6, - 0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 }; +static unsigned char nonce[24] + = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, 0x2b, 0x73, + 0xcd, 0x62, 0xbd, 0xa8, 0x75, 0xfc, 0x73, 0xd6, + 0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 }; -unsigned char output[4194304]; +static unsigned char output[4194304]; -unsigned char h[32]; +static unsigned char h[32]; int main(void) { diff --git a/test/default/stream2.c b/test/default/stream2.c index c50bbccf..75c1e3df 100644 --- a/test/default/stream2.c +++ b/test/default/stream2.c @@ -2,17 +2,17 @@ #define TEST_NAME "stream2" #include "cmptest.h" -unsigned char secondkey[32] +static unsigned char secondkey[32] = { 0xdc, 0x90, 0x8d, 0xda, 0x0b, 0x93, 0x44, 0xa9, 0x53, 0x62, 0x9b, 0x73, 0x38, 0x20, 0x77, 0x88, 0x80, 0xf3, 0xce, 0xb4, 0x21, 0xbb, 0x61, 0xb9, 0x1c, 0xbd, 0x4c, 0x3e, 0x66, 0x25, 0x6c, 0xe4 }; -unsigned char noncesuffix[8] +static unsigned char noncesuffix[8] = { 0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 }; -unsigned char output[4194304]; +static unsigned char output[4194304]; -unsigned char h[32]; +static unsigned char h[32]; int main(void) { diff --git a/test/default/stream3.c b/test/default/stream3.c index d121228e..165ffe0f 100644 --- a/test/default/stream3.c +++ b/test/default/stream3.c @@ -2,16 +2,17 @@ #define TEST_NAME "stream3" #include "cmptest.h" -unsigned char firstkey[32] +static unsigned char firstkey[32] = { 0x1b, 0x27, 0x55, 0x64, 0x73, 0xe9, 0x85, 0xd4, 0x62, 0xcd, 0x51, 0x19, 0x7a, 0x9a, 0x46, 0xc7, 0x60, 0x09, 0x54, 0x9e, 0xac, 0x64, 0x74, 0xf2, 0x06, 0xc4, 0xee, 0x08, 0x44, 0xf6, 0x83, 0x89 }; -unsigned char nonce[24] = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, 0x2b, 0x73, - 0xcd, 0x62, 0xbd, 0xa8, 0x75, 0xfc, 0x73, 0xd6, - 0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 }; +static unsigned char nonce[24] + = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, 0x2b, 0x73, + 0xcd, 0x62, 0xbd, 0xa8, 0x75, 0xfc, 0x73, 0xd6, + 0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 }; -unsigned char rs[32]; +static unsigned char rs[32]; int main(void) { diff --git a/test/default/stream4.c b/test/default/stream4.c index 37d82038..c7a1e8b1 100644 --- a/test/default/stream4.c +++ b/test/default/stream4.c @@ -2,16 +2,17 @@ #define TEST_NAME "stream4" #include "cmptest.h" -unsigned char firstkey[32] +static unsigned char firstkey[32] = { 0x1b, 0x27, 0x55, 0x64, 0x73, 0xe9, 0x85, 0xd4, 0x62, 0xcd, 0x51, 0x19, 0x7a, 0x9a, 0x46, 0xc7, 0x60, 0x09, 0x54, 0x9e, 0xac, 0x64, 0x74, 0xf2, 0x06, 0xc4, 0xee, 0x08, 0x44, 0xf6, 0x83, 0x89 }; -unsigned char nonce[24] = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, 0x2b, 0x73, - 0xcd, 0x62, 0xbd, 0xa8, 0x75, 0xfc, 0x73, 0xd6, - 0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 }; +static unsigned char nonce[24] + = { 0x69, 0x69, 0x6e, 0xe9, 0x55, 0xb6, 0x2b, 0x73, + 0xcd, 0x62, 0xbd, 0xa8, 0x75, 0xfc, 0x73, 0xd6, + 0x82, 0x19, 0xe0, 0x03, 0x6b, 0x7a, 0x0b, 0x37 }; -unsigned char m[163] +static unsigned char m[163] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xbe, 0x07, 0x5f, 0xc5, @@ -27,7 +28,7 @@ unsigned char m[163] 0xf0, 0xa0, 0x89, 0xbc, 0x76, 0x89, 0x70, 0x40, 0xe0, 0x82, 0xf9, 0x37, 0x76, 0x38, 0x48, 0x64, 0x5e, 0x07, 0x05 }; -unsigned char c[163]; +static unsigned char c[163]; int main(void) { diff --git a/test/default/verify1.c b/test/default/verify1.c index d3f7e170..5baec865 100644 --- a/test/default/verify1.c +++ b/test/default/verify1.c @@ -2,9 +2,9 @@ #define TEST_NAME "verify1" #include "cmptest.h" -unsigned char v16[16], v16x[16]; -unsigned char v32[32], v32x[32]; -unsigned char v64[64], v64x[64]; +static unsigned char v16[16], v16x[16]; +static unsigned char v32[32], v32x[32]; +static unsigned char v64[64], v64x[64]; int main(void) {