diff --git a/configure.ac b/configure.ac index 1a5ae0255..8ab179faf 100644 --- a/configure.ac +++ b/configure.ac @@ -196,7 +196,7 @@ AC_ARG_ENABLE([linuxkm-defaults], if test "$ENABLED_LINUXKM_DEFAULTS" = "yes" then - AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DH_CONST -DWOLFSSL_SP_MOD_WORD_RP -DWOLFSSL_OLD_PRIME_CHECK -DWOLFSSL_SP_DIV_64 -DWOLFSSL_SP_DIV_WORD_HALF" + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DH_CONST -DWOLFSSL_SP_MOD_WORD_RP -DWOLFSSL_OLD_PRIME_CHECK -DWOLFSSL_SP_DIV_64 -DWOLFSSL_SP_DIV_WORD_HALF -DWOLFSSL_SMALL_STACK_STATIC" fi AC_ARG_WITH([linux-source], diff --git a/wolfcrypt/src/ecc.c b/wolfcrypt/src/ecc.c index f71fd3d15..d0dbfebf3 100644 --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c @@ -4911,16 +4911,15 @@ static int wc_ecc_sign_hash_hw(const byte* in, word32 inlen, return WC_HW_E; } #elif defined(WOLFSSL_CRYPTOCELL) - + /* truncate if hash is longer than key size */ + if (msgLenInBytes > keysize) { + msgLenInBytes = keysize; + } hash_mode = cc310_hashModeECC(msgLenInBytes); if (hash_mode == CRYS_ECPKI_HASH_OpModeLast) { hash_mode = cc310_hashModeECC(keysize); hash_mode = CRYS_ECPKI_HASH_SHA256_mode; - } - /* truncate if hash is longer than key size */ - if (msgLenInBytes > keysize) { - msgLenInBytes = keysize; } /* create signature from an input buffer using a private key*/ @@ -6390,15 +6389,15 @@ int wc_ecc_verify_hash_ex(mp_int *r, mp_int *s, const byte* hash, return err; } + /* truncate if hash is longer than key size */ + if (msgLenInBytes > keySz) { + msgLenInBytes = keySz; + } hash_mode = cc310_hashModeECC(msgLenInBytes); if (hash_mode == CRYS_ECPKI_HASH_OpModeLast) { /* hash_mode = */ cc310_hashModeECC(keySz); hash_mode = CRYS_ECPKI_HASH_SHA256_mode; } - /* truncate if hash is longer than key size */ - if (msgLenInBytes > keySz) { - msgLenInBytes = keySz; - } /* verify the signature using the public key */ err = CRYS_ECDSA_Verify(&sigCtxTemp, diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 0f76202b4..11377cccf 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -1519,21 +1519,21 @@ static int error_test(void) static int base64_test(void) { int ret; - static const byte good[] = "A+Gd\0\0\0"; - static const byte goodEnd[] = "A+Gd \r\n"; + WOLFSSL_SMALL_STACK_STATIC const byte good[] = "A+Gd\0\0\0"; + WOLFSSL_SMALL_STACK_STATIC const byte goodEnd[] = "A+Gd \r\n"; byte out[128]; word32 outLen; #ifdef WOLFSSL_BASE64_ENCODE byte data[3]; word32 dataLen; byte longData[79] = { 0 }; - static const byte symbols[] = "+/A="; + WOLFSSL_SMALL_STACK_STATIC const byte symbols[] = "+/A="; #endif - static const byte badSmall[] = "AAA Gdj="; - static const byte badLarge[] = "AAA~Gdj="; - static const byte badEOL[] = "A+Gd AA"; - static const byte badPadding[] = "AA=A"; - static const byte badChar[] = ",-.:;<=>?@[\\]^_`"; + WOLFSSL_SMALL_STACK_STATIC const byte badSmall[] = "AAA Gdj="; + WOLFSSL_SMALL_STACK_STATIC const byte badLarge[] = "AAA~Gdj="; + WOLFSSL_SMALL_STACK_STATIC const byte badEOL[] = "A+Gd AA"; + WOLFSSL_SMALL_STACK_STATIC const byte badPadding[] = "AA=A"; + WOLFSSL_SMALL_STACK_STATIC const byte badChar[] = ",-.:;<=>?@[\\]^_`"; byte goodChar[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" @@ -1661,8 +1661,8 @@ static int base64_test(void) static int base16_test(void) { int ret; - static const byte testData[] = "SomeDataToEncode\n"; - static const byte encodedTestData[] = "536F6D6544617461546F456E636F64650A00"; + WOLFSSL_SMALL_STACK_STATIC const byte testData[] = "SomeDataToEncode\n"; + WOLFSSL_SMALL_STACK_STATIC const byte encodedTestData[] = "536F6D6544617461546F456E636F64650A00"; byte encoded[40]; word32 encodedLen; byte plain[40]; @@ -1701,7 +1701,7 @@ static int asn_test(void) { int ret; /* ASN1 encoded date buffer */ - static const byte dateBuf[] = {0x17, 0x0d, 0x31, 0x36, 0x30, 0x38, 0x31, 0x31, + WOLFSSL_SMALL_STACK_STATIC const byte dateBuf[] = {0x17, 0x0d, 0x31, 0x36, 0x30, 0x38, 0x31, 0x31, 0x32, 0x30, 0x30, 0x37, 0x33, 0x37, 0x5a}; byte format; int length; @@ -4983,7 +4983,7 @@ static int chacha_test(void) int i; int times = 4; - static const byte key1[] = + WOLFSSL_SMALL_STACK_STATIC const byte key1[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -4991,7 +4991,7 @@ static int chacha_test(void) 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; - static const byte key2[] = + WOLFSSL_SMALL_STACK_STATIC const byte key2[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -4999,7 +4999,7 @@ static int chacha_test(void) 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01 }; - static const byte key3[] = + WOLFSSL_SMALL_STACK_STATIC const byte key3[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -5008,7 +5008,7 @@ static int chacha_test(void) }; /* 128 bit key */ - static const byte key4[] = + WOLFSSL_SMALL_STACK_STATIC const byte key4[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 @@ -5017,16 +5017,16 @@ static int chacha_test(void) const byte* keys[] = {key1, key2, key3, key4}; - static const byte ivs1[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; - static const byte ivs2[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; - static const byte ivs3[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00}; - static const byte ivs4[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; + WOLFSSL_SMALL_STACK_STATIC const byte ivs1[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; + WOLFSSL_SMALL_STACK_STATIC const byte ivs2[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; + WOLFSSL_SMALL_STACK_STATIC const byte ivs3[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00}; + WOLFSSL_SMALL_STACK_STATIC const byte ivs4[] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; const byte* ivs[] = {ivs1, ivs2, ivs3, ivs4}; #ifndef BENCH_EMBEDDED - static const byte cipher_big_result[] = { + WOLFSSL_SMALL_STACK_STATIC const byte cipher_big_result[] = { 0x06, 0xa6, 0x5d, 0x31, 0x21, 0x6c, 0xdb, 0x37, 0x48, 0x7c, 0x01, 0x9d, 0x72, 0xdf, 0x0a, 0x5b, 0x64, 0x74, 0x20, 0xba, 0x9e, 0xe0, 0x26, 0x7a, 0xbf, 0xdf, 0x83, 0x34, 0x3b, 0x4f, 0x94, 0x3f, 0x37, 0x89, 0xaf, 0x00, @@ -5361,7 +5361,7 @@ static int poly1305_test(void) byte tag[16]; Poly1305 enc; - static const byte msg1[] = + WOLFSSL_SMALL_STACK_STATIC const byte msg1[] = { 0x43,0x72,0x79,0x70,0x74,0x6f,0x67,0x72, 0x61,0x70,0x68,0x69,0x63,0x20,0x46,0x6f, @@ -5370,13 +5370,13 @@ static int poly1305_test(void) 0x75,0x70 }; - static const byte msg2[] = + WOLFSSL_SMALL_STACK_STATIC const byte msg2[] = { 0x48,0x65,0x6c,0x6c,0x6f,0x20,0x77,0x6f,0x72, 0x6c,0x64,0x21 }; - static const byte msg3[] = + WOLFSSL_SMALL_STACK_STATIC const byte msg3[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -5384,7 +5384,7 @@ static int poly1305_test(void) 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; - static const byte msg4[] = + WOLFSSL_SMALL_STACK_STATIC const byte msg4[] = { 0xd3,0x1a,0x8d,0x34,0x64,0x8e,0x60,0xdb, 0x7b,0x86,0xaf,0xbc,0x53,0xef,0x7e,0xc2, @@ -5403,13 +5403,13 @@ static int poly1305_test(void) 0x61,0x16 }; - static const byte msg5[] = + WOLFSSL_SMALL_STACK_STATIC const byte msg5[] = { 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, }; - static const byte msg6[] = + WOLFSSL_SMALL_STACK_STATIC const byte msg6[] = { 0xd3,0x1a,0x8d,0x34,0x64,0x8e,0x60,0xdb, 0x7b,0x86,0xaf,0xbc,0x53,0xef,0x7e,0xc2, @@ -5439,70 +5439,70 @@ static int poly1305_test(void) 0xc4,0xc5,0xc6,0xc7 }; - static const byte correct0[] = + WOLFSSL_SMALL_STACK_STATIC const byte correct0[] = { 0x01,0x03,0x80,0x8a,0xfb,0x0d,0xb2,0xfd, 0x4a,0xbf,0xf6,0xaf,0x41,0x49,0xf5,0x1b }; - static const byte correct1[] = + WOLFSSL_SMALL_STACK_STATIC const byte correct1[] = { 0xa8,0x06,0x1d,0xc1,0x30,0x51,0x36,0xc6, 0xc2,0x2b,0x8b,0xaf,0x0c,0x01,0x27,0xa9 }; - static const byte correct2[] = + WOLFSSL_SMALL_STACK_STATIC const byte correct2[] = { 0xa6,0xf7,0x45,0x00,0x8f,0x81,0xc9,0x16, 0xa2,0x0d,0xcc,0x74,0xee,0xf2,0xb2,0xf0 }; - static const byte correct3[] = + WOLFSSL_SMALL_STACK_STATIC const byte correct3[] = { 0x49,0xec,0x78,0x09,0x0e,0x48,0x1e,0xc6, 0xc2,0x6b,0x33,0xb9,0x1c,0xcc,0x03,0x07 }; - static const byte correct4[] = + WOLFSSL_SMALL_STACK_STATIC const byte correct4[] = { 0x1a,0xe1,0x0b,0x59,0x4f,0x09,0xe2,0x6a, 0x7e,0x90,0x2e,0xcb,0xd0,0x60,0x06,0x91 }; - static const byte correct5[] = + WOLFSSL_SMALL_STACK_STATIC const byte correct5[] = { 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, }; - static const byte correct6[] = + WOLFSSL_SMALL_STACK_STATIC const byte correct6[] = { 0xea,0x11,0x5c,0x4f,0xd0,0xc0,0x10,0xae, 0xf7,0xdf,0xda,0x77,0xa2,0xe9,0xaf,0xca }; - static const byte key[] = { + WOLFSSL_SMALL_STACK_STATIC const byte key[] = { 0x85,0xd6,0xbe,0x78,0x57,0x55,0x6d,0x33, 0x7f,0x44,0x52,0xfe,0x42,0xd5,0x06,0xa8, 0x01,0x03,0x80,0x8a,0xfb,0x0d,0xb2,0xfd, 0x4a,0xbf,0xf6,0xaf,0x41,0x49,0xf5,0x1b }; - static const byte key2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte key2[] = { 0x74,0x68,0x69,0x73,0x20,0x69,0x73,0x20, 0x33,0x32,0x2d,0x62,0x79,0x74,0x65,0x20, 0x6b,0x65,0x79,0x20,0x66,0x6f,0x72,0x20, 0x50,0x6f,0x6c,0x79,0x31,0x33,0x30,0x35 }; - static const byte key4[] = { + WOLFSSL_SMALL_STACK_STATIC const byte key4[] = { 0x7b,0xac,0x2b,0x25,0x2d,0xb4,0x47,0xaf, 0x09,0xb6,0x7a,0x55,0xa4,0xe9,0x55,0x84, 0x0a,0xe1,0xd6,0x73,0x10,0x75,0xd9,0xeb, 0x2a,0x93,0x75,0x78,0x3e,0xd5,0x53,0xff }; - static const byte key5[] = { + WOLFSSL_SMALL_STACK_STATIC const byte key5[] = { 0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -5570,14 +5570,14 @@ static int chacha20_poly1305_aead_test(void) /* Test #1 from Section 2.8.2 of draft-irtf-cfrg-chacha20-poly1305-10 */ /* https://tools.ietf.org/html/draft-irtf-cfrg-chacha20-poly1305-10 */ - static const byte key1[] = { + WOLFSSL_SMALL_STACK_STATIC const byte key1[] = { 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f }; - static const byte plaintext1[] = { + WOLFSSL_SMALL_STACK_STATIC const byte plaintext1[] = { 0x4c, 0x61, 0x64, 0x69, 0x65, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x47, 0x65, 0x6e, 0x74, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x20, 0x6f, 0x66, 0x20, @@ -5595,17 +5595,17 @@ static int chacha20_poly1305_aead_test(void) 0x74, 0x2e }; - static const byte iv1[] = { + WOLFSSL_SMALL_STACK_STATIC const byte iv1[] = { 0x07, 0x00, 0x00, 0x00, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47 }; - static const byte aad1[] = { /* additional data */ + WOLFSSL_SMALL_STACK_STATIC const byte aad1[] = { /* additional data */ 0x50, 0x51, 0x52, 0x53, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7 }; - static const byte cipher1[] = { /* expected output from operation */ + WOLFSSL_SMALL_STACK_STATIC const byte cipher1[] = { /* expected output from operation */ 0xd3, 0x1a, 0x8d, 0x34, 0x64, 0x8e, 0x60, 0xdb, 0x7b, 0x86, 0xaf, 0xbc, 0x53, 0xef, 0x7e, 0xc2, 0xa4, 0xad, 0xed, 0x51, 0x29, 0x6e, 0x08, 0xfe, @@ -5623,7 +5623,7 @@ static int chacha20_poly1305_aead_test(void) 0x61, 0x16 }; - static const byte authTag1[] = { /* expected output from operation */ + WOLFSSL_SMALL_STACK_STATIC const byte authTag1[] = { /* expected output from operation */ 0x1a, 0xe1, 0x0b, 0x59, 0x4f, 0x09, 0xe2, 0x6a, 0x7e, 0x90, 0x2e, 0xcb, 0xd0, 0x60, 0x06, 0x91 }; @@ -5631,14 +5631,14 @@ static int chacha20_poly1305_aead_test(void) /* Test #2 from Appendix A.2 in draft-irtf-cfrg-chacha20-poly1305-10 */ /* https://tools.ietf.org/html/draft-irtf-cfrg-chacha20-poly1305-10 */ - static const byte key2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte key2[] = { 0x1c, 0x92, 0x40, 0xa5, 0xeb, 0x55, 0xd3, 0x8a, 0xf3, 0x33, 0x88, 0x86, 0x04, 0xf6, 0xb5, 0xf0, 0x47, 0x39, 0x17, 0xc1, 0x40, 0x2b, 0x80, 0x09, 0x9d, 0xca, 0x5c, 0xbc, 0x20, 0x70, 0x75, 0xc0 }; - static const byte plaintext2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte plaintext2[] = { 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x65, 0x74, 0x2d, 0x44, 0x72, 0x61, 0x66, 0x74, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x72, 0x61, 0x66, @@ -5675,17 +5675,17 @@ static int chacha20_poly1305_aead_test(void) 0x9d }; - static const byte iv2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte iv2[] = { 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }; - static const byte aad2[] = { /* additional data */ + WOLFSSL_SMALL_STACK_STATIC const byte aad2[] = { /* additional data */ 0xf3, 0x33, 0x88, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x91 }; - static const byte cipher2[] = { /* expected output from operation */ + WOLFSSL_SMALL_STACK_STATIC const byte cipher2[] = { /* expected output from operation */ 0x64, 0xa0, 0x86, 0x15, 0x75, 0x86, 0x1a, 0xf4, 0x60, 0xf0, 0x62, 0xc7, 0x9b, 0xe6, 0x43, 0xbd, 0x5e, 0x80, 0x5c, 0xfd, 0x34, 0x5c, 0xf3, 0x89, @@ -5722,7 +5722,7 @@ static int chacha20_poly1305_aead_test(void) 0x9b }; - static const byte authTag2[] = { /* expected output from operation */ + WOLFSSL_SMALL_STACK_STATIC const byte authTag2[] = { /* expected output from operation */ 0xee, 0xad, 0x9d, 0x67, 0x89, 0x0c, 0xbb, 0x22, 0x39, 0x23, 0x36, 0xfe, 0xa1, 0x85, 0x1f, 0x38 }; @@ -6086,7 +6086,7 @@ static int chacha20_poly1305_aead_test(void) #ifndef NO_DES3 static int des_test(void) { - static const byte vector[] = { /* "now is the time for all " w/o trailing 0 */ + WOLFSSL_SMALL_STACK_STATIC const byte vector[] = { /* "now is the time for all " w/o trailing 0 */ 0x6e,0x6f,0x77,0x20,0x69,0x73,0x20,0x74, 0x68,0x65,0x20,0x74,0x69,0x6d,0x65,0x20, 0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20 @@ -6098,17 +6098,17 @@ static int des_test(void) Des enc; Des dec; - static const byte key[] = + WOLFSSL_SMALL_STACK_STATIC const byte key[] = { 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef }; - static const byte iv[] = + WOLFSSL_SMALL_STACK_STATIC const byte iv[] = { 0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef }; - static const byte verify[] = + WOLFSSL_SMALL_STACK_STATIC const byte verify[] = { 0x8b,0x7c,0x52,0xb0,0x01,0x2b,0x6c,0xb8, 0x4f,0x0f,0xeb,0xf3,0xfb,0x5f,0x86,0x73, @@ -6179,7 +6179,7 @@ static int des_test(void) #ifndef NO_DES3 static int des3_test(void) { - static const byte vector[] = { /* "Now is the time for all " w/o trailing 0 */ + WOLFSSL_SMALL_STACK_STATIC const byte vector[] = { /* "Now is the time for all " w/o trailing 0 */ 0x4e,0x6f,0x77,0x20,0x69,0x73,0x20,0x74, 0x68,0x65,0x20,0x74,0x69,0x6d,0x65,0x20, 0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20 @@ -6191,13 +6191,13 @@ static int des3_test(void) Des3 enc; Des3 dec; - static const byte key3[] = + WOLFSSL_SMALL_STACK_STATIC const byte key3[] = { 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef, 0xfe,0xde,0xba,0x98,0x76,0x54,0x32,0x10, 0x89,0xab,0xcd,0xef,0x01,0x23,0x45,0x67 }; - static const byte iv3[] = + WOLFSSL_SMALL_STACK_STATIC const byte iv3[] = { 0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, @@ -6205,7 +6205,7 @@ static int des3_test(void) }; - static const byte verify3[] = + WOLFSSL_SMALL_STACK_STATIC const byte verify3[] = { 0x43,0xa0,0x29,0x7e,0xd1,0x84,0xf8,0x0e, 0x89,0x64,0x84,0x32,0x12,0xd5,0x08,0x98, @@ -6379,19 +6379,19 @@ EVP_TEST_END: int aesofb_test(void) { #ifdef WOLFSSL_AES_256 - static const byte key1[] = + WOLFSSL_SMALL_STACK_STATIC const byte key1[] = { 0xc4,0xc7,0xfa,0xd6,0x53,0x5c,0xb8,0x71, 0x4a,0x5c,0x40,0x77,0x9a,0x8b,0xa1,0xd2, 0x53,0x3e,0x23,0xb4,0xb2,0x58,0x73,0x2a, 0x5b,0x78,0x01,0xf4,0xe3,0x71,0xa7,0x94 }; - static const byte iv1[] = + WOLFSSL_SMALL_STACK_STATIC const byte iv1[] = { 0x5e,0xb9,0x33,0x13,0xb8,0x71,0xff,0x16, 0xb9,0x8a,0x9b,0xcb,0x43,0x33,0x0d,0x6f }; - static const byte plain1[] = + WOLFSSL_SMALL_STACK_STATIC const byte plain1[] = { 0x6d,0x0b,0xb0,0x79,0x63,0x84,0x71,0xe9, 0x39,0xd4,0x53,0x14,0x86,0xc1,0x4c,0x25, @@ -6400,7 +6400,7 @@ EVP_TEST_END: 0xcc,0x12,0x2c,0x4e,0x0c,0x17,0x15,0xef, 0x55,0xf3,0x99,0x5a,0x6b,0xf0,0x2a,0x4c }; - static const byte cipher1[] = + WOLFSSL_SMALL_STACK_STATIC const byte cipher1[] = { 0x0f,0x54,0x61,0x71,0x59,0xd0,0x3f,0xfc, 0x1b,0xfa,0xfb,0x60,0x29,0x30,0xd7,0x00, @@ -6413,22 +6413,22 @@ EVP_TEST_END: #ifdef WOLFSSL_AES_128 - static const byte key2[] = + WOLFSSL_SMALL_STACK_STATIC const byte key2[] = { 0x10,0xa5,0x88,0x69,0xd7,0x4b,0xe5,0xa3, 0x74,0xcf,0x86,0x7c,0xfb,0x47,0x38,0x59 }; - static const byte iv2[] = + WOLFSSL_SMALL_STACK_STATIC const byte iv2[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; - static const byte plain2[] = + WOLFSSL_SMALL_STACK_STATIC const byte plain2[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; - static const byte cipher2[] = + WOLFSSL_SMALL_STACK_STATIC const byte cipher2[] = { 0x6d,0x25,0x1e,0x69,0x44,0xb0,0x51,0xe0, 0x4e,0xaa,0x6f,0xb4,0xdb,0xf7,0x84,0x65 @@ -6437,22 +6437,22 @@ EVP_TEST_END: #ifdef WOLFSSL_AES_192 - static const byte key3[] = { + WOLFSSL_SMALL_STACK_STATIC const byte key3[] = { 0xd0,0x77,0xa0,0x3b,0xd8,0xa3,0x89,0x73, 0x92,0x8c,0xca,0xfe,0x4a,0x9d,0x2f,0x45, 0x51,0x30,0xbd,0x0a,0xf5,0xae,0x46,0xa9 }; - static const byte iv3[] = + WOLFSSL_SMALL_STACK_STATIC const byte iv3[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; - static const byte cipher3[] = + WOLFSSL_SMALL_STACK_STATIC const byte cipher3[] = { 0xab,0xc7,0x86,0xfb,0x1e,0xdb,0x50,0x45, 0x80,0xc4,0xd8,0x82,0xef,0x29,0xa0,0xc7 }; - static const byte plain3[] = + WOLFSSL_SMALL_STACK_STATIC const byte plain3[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 @@ -6718,19 +6718,19 @@ EVP_TEST_END: #endif int ret = 0; - static const byte iv[] = { + WOLFSSL_SMALL_STACK_STATIC const byte iv[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, 0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f }; #ifdef WOLFSSL_AES_128 - static const byte key1[] = + WOLFSSL_SMALL_STACK_STATIC const byte key1[] = { 0x2b,0x7e,0x15,0x16,0x28,0xae,0xd2,0xa6, 0xab,0xf7,0x15,0x88,0x09,0xcf,0x4f,0x3c }; - static const byte cipher1[] = + WOLFSSL_SMALL_STACK_STATIC const byte cipher1[] = { 0x3b,0x3f,0xd9,0x2e,0xb7,0x2d,0xad,0x20, 0x33,0x34,0x49,0xf8,0xe8,0x3c,0xfb,0x4a, @@ -6740,7 +6740,7 @@ EVP_TEST_END: 0xb1,0x80,0x8c,0xf1,0x87,0xa4,0xf4,0xdf }; - static const byte msg1[] = + WOLFSSL_SMALL_STACK_STATIC const byte msg1[] = { 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a, @@ -6753,14 +6753,14 @@ EVP_TEST_END: #ifdef WOLFSSL_AES_192 /* 192 size key test */ - static const byte key2[] = + WOLFSSL_SMALL_STACK_STATIC const byte key2[] = { 0x8e,0x73,0xb0,0xf7,0xda,0x0e,0x64,0x52, 0xc8,0x10,0xf3,0x2b,0x80,0x90,0x79,0xe5, 0x62,0xf8,0xea,0xd2,0x52,0x2c,0x6b,0x7b }; - static const byte cipher2[] = + WOLFSSL_SMALL_STACK_STATIC const byte cipher2[] = { 0xcd,0xc8,0x0d,0x6f,0xdd,0xf1,0x8c,0xab, 0x34,0xc2,0x59,0x09,0xc9,0x9a,0x41,0x74, @@ -6772,7 +6772,7 @@ EVP_TEST_END: 0x42,0xae,0x8f,0xba,0x58,0x4b,0x09,0xff }; - static const byte msg2[] = + WOLFSSL_SMALL_STACK_STATIC const byte msg2[] = { 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a, @@ -6787,7 +6787,7 @@ EVP_TEST_END: #ifdef WOLFSSL_AES_256 /* 256 size key simple test */ - static const byte key3[] = + WOLFSSL_SMALL_STACK_STATIC const byte key3[] = { 0x60,0x3d,0xeb,0x10,0x15,0xca,0x71,0xbe, 0x2b,0x73,0xae,0xf0,0x85,0x7d,0x77,0x81, @@ -6795,7 +6795,7 @@ EVP_TEST_END: 0x2d,0x98,0x10,0xa3,0x09,0x14,0xdf,0xf4 }; - static const byte cipher3[] = + WOLFSSL_SMALL_STACK_STATIC const byte cipher3[] = { 0xdc,0x7e,0x84,0xbf,0xda,0x79,0x16,0x4b, 0x7e,0xcd,0x84,0x86,0x98,0x5d,0x38,0x60, @@ -6807,7 +6807,7 @@ EVP_TEST_END: 0x20,0x31,0x62,0x3d,0x55,0xb1,0xe4,0x71 }; - static const byte msg3[] = + WOLFSSL_SMALL_STACK_STATIC const byte msg3[] = { 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a, @@ -7001,57 +7001,57 @@ EVP_TEST_END: int ret = 0; #ifdef WOLFSSL_AES_128 - static const byte iv[] = { + WOLFSSL_SMALL_STACK_STATIC const byte iv[] = { 0x4d,0xbb,0xdc,0xaa,0x59,0xf3,0x63,0xc9, 0x2a,0x3b,0x98,0x43,0xad,0x20,0xe2,0xb7 }; - static const byte key1[] = + WOLFSSL_SMALL_STACK_STATIC const byte key1[] = { 0xcd,0xef,0x9d,0x06,0x61,0xba,0xe4,0x73, 0x8d,0x1a,0x58,0xa2,0xa6,0x22,0x8b,0x66 }; - static const byte cipher1[] = + WOLFSSL_SMALL_STACK_STATIC const byte cipher1[] = { 0x00 }; - static const byte msg1[] = + WOLFSSL_SMALL_STACK_STATIC const byte msg1[] = { 0xC0 }; #endif /* WOLFSSL_AES_128 */ #ifdef WOLFSSL_AES_192 - static const byte iv2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte iv2[] = { 0x57,0xc6,0x89,0x7c,0x99,0x52,0x28,0x13, 0xbf,0x67,0x9c,0xe1,0x13,0x70,0xaf,0x5e }; - static const byte key2[] = + WOLFSSL_SMALL_STACK_STATIC const byte key2[] = { 0xba,0xa1,0x58,0xa1,0x6b,0x50,0x4a,0x10, 0x8e,0xd4,0x33,0x2e,0xe7,0xf2,0x9b,0xf6, 0xd1,0xac,0x46,0xa8,0xde,0x5a,0xfe,0x7a }; - static const byte cipher2[] = + WOLFSSL_SMALL_STACK_STATIC const byte cipher2[] = { 0x30 }; - static const byte msg2[] = + WOLFSSL_SMALL_STACK_STATIC const byte msg2[] = { 0x80 }; #endif /* WOLFSSL_AES_192 */ #ifdef WOLFSSL_AES_256 - static const byte iv3[] = { + WOLFSSL_SMALL_STACK_STATIC const byte iv3[] = { 0x63,0x2e,0x9f,0x83,0x1f,0xa3,0x80,0x5e, 0x52,0x02,0xbc,0xe0,0x6d,0x04,0xf9,0xa0 }; - static const byte key3[] = + WOLFSSL_SMALL_STACK_STATIC const byte key3[] = { 0xf6,0xfa,0xe4,0xf1,0x5d,0x91,0xfc,0x50, 0x88,0x78,0x4f,0x84,0xa5,0x37,0x12,0x7e, @@ -7059,12 +7059,12 @@ EVP_TEST_END: 0xc2,0xcf,0x3d,0xe1,0x1c,0x2a,0x30,0x40 }; - static const byte cipher3[] = + WOLFSSL_SMALL_STACK_STATIC const byte cipher3[] = { 0xF7, 0x00 }; - static const byte msg3[] = + WOLFSSL_SMALL_STACK_STATIC const byte msg3[] = { 0x41, 0xC0 }; @@ -7201,59 +7201,59 @@ EVP_TEST_END: int ret = 0; #ifdef WOLFSSL_AES_128 - static const byte iv[] = { + WOLFSSL_SMALL_STACK_STATIC const byte iv[] = { 0xf4,0x75,0xc6,0x49,0x91,0xb2,0x0e,0xae, 0xe1,0x83,0xa2,0x26,0x29,0xe2,0x1e,0x22 }; - static const byte key1[] = + WOLFSSL_SMALL_STACK_STATIC const byte key1[] = { 0xc8,0xfe,0x9b,0xf7,0x7b,0x93,0x0f,0x46, 0xd2,0x07,0x8b,0x8c,0x0e,0x65,0x7c,0xd4 }; - static const byte cipher1[] = + WOLFSSL_SMALL_STACK_STATIC const byte cipher1[] = { 0xd2,0x76,0x91 }; - static const byte msg1[] = + WOLFSSL_SMALL_STACK_STATIC const byte msg1[] = { 0xc9,0x06,0x35 }; #endif /* WOLFSSL_AES_128 */ #ifdef WOLFSSL_AES_192 - static const byte iv2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte iv2[] = { 0x0a,0x02,0x84,0x6b,0x62,0xab,0xb6,0x93, 0xef,0x31,0xd7,0x54,0x84,0x2e,0xed,0x29 }; - static const byte key2[] = + WOLFSSL_SMALL_STACK_STATIC const byte key2[] = { 0xba,0xf0,0x8b,0x76,0x31,0x7a,0x65,0xc5, 0xf0,0x7a,0xe6,0xf5,0x7e,0xb0,0xe6,0x54, 0x88,0x65,0x93,0x24,0xd2,0x97,0x09,0xe3 }; - static const byte cipher2[] = + WOLFSSL_SMALL_STACK_STATIC const byte cipher2[] = { 0x72,0x9c,0x0b,0x6d,0xeb,0x75,0xfa,0x6e, 0xb5,0xe8 }; - static const byte msg2[] = + WOLFSSL_SMALL_STACK_STATIC const byte msg2[] = { 0x98,0x95,0x93,0x24,0x02,0x39,0x3d,0xc3, 0x3a,0x60 }; #endif #ifdef WOLFSSL_AES_256 - static const byte iv3[] = { + WOLFSSL_SMALL_STACK_STATIC const byte iv3[] = { 0x33,0x8c,0x55,0x2f,0xf1,0xec,0xa1,0x44, 0x08,0xe0,0x5d,0x8c,0xf9,0xf3,0xb3,0x1b }; - static const byte key3[] = + WOLFSSL_SMALL_STACK_STATIC const byte key3[] = { 0x06,0x48,0x74,0x09,0x2f,0x7a,0x13,0xcc, 0x44,0x62,0x24,0x7a,0xd4,0x23,0xd0,0xe9, @@ -7261,12 +7261,12 @@ EVP_TEST_END: 0xb7,0xa0,0xa6,0x47,0x7b,0x09,0x8e,0x66 }; - static const byte cipher3[] = + WOLFSSL_SMALL_STACK_STATIC const byte cipher3[] = { 0x1c,0xff,0x95 }; - static const byte msg3[] = + WOLFSSL_SMALL_STACK_STATIC const byte msg3[] = { 0xb9,0x74,0xfa }; @@ -8009,7 +8009,7 @@ static int aes_cbc_test(void) byte cipher[AES_BLOCK_SIZE]; byte plain[AES_BLOCK_SIZE]; int ret; - static const byte msg[] = { /* "Now is the time for all " w/o trailing 0 */ + WOLFSSL_SMALL_STACK_STATIC const byte msg[] = { /* "Now is the time for all " w/o trailing 0 */ 0x6e,0x6f,0x77,0x20,0x69,0x73,0x20,0x74, 0x68,0x65,0x20,0x74,0x69,0x6d,0x65,0x20, 0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20 @@ -8070,20 +8070,20 @@ static int aes_test(void) #ifdef HAVE_AES_CBC #ifdef WOLFSSL_AES_128 - static const byte msg[] = { /* "Now is the time for all " w/o trailing 0 */ + WOLFSSL_SMALL_STACK_STATIC const byte msg[] = { /* "Now is the time for all " w/o trailing 0 */ 0x6e,0x6f,0x77,0x20,0x69,0x73,0x20,0x74, 0x68,0x65,0x20,0x74,0x69,0x6d,0x65,0x20, 0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20 }; - static const byte verify[] = + WOLFSSL_SMALL_STACK_STATIC const byte verify[] = { 0x95,0x94,0x92,0x57,0x5f,0x42,0x81,0x53, 0x2c,0xcc,0x9d,0x46,0x77,0xa2,0x33,0xcb }; - static const byte key[] = "0123456789abcdef "; /* align */ - static const byte iv[] = "1234567890abcdef "; /* align */ + WOLFSSL_SMALL_STACK_STATIC const byte key[] = "0123456789abcdef "; /* align */ + WOLFSSL_SMALL_STACK_STATIC const byte iv[] = "1234567890abcdef "; /* align */ #ifdef WOLFSSL_SMALL_STACK #if defined(HAVE_AES_CBC) || defined(WOLFSSL_AES_COUNTER) || defined(WOLFSSL_AES_DIRECT) @@ -8137,7 +8137,7 @@ static int aes_test(void) #if defined(WOLFSSL_AESNI) && defined(HAVE_AES_DECRYPT) { - static const byte bigMsg[] = { + WOLFSSL_SMALL_STACK_STATIC const byte bigMsg[] = { /* "All work and no play makes Jack a dull boy. " */ 0x41,0x6c,0x6c,0x20,0x77,0x6f,0x72,0x6b, 0x20,0x61,0x6e,0x64,0x20,0x6e,0x6f,0x20, @@ -8188,7 +8188,7 @@ static int aes_test(void) 0x70,0x6c,0x61,0x79,0x20,0x6d,0x61,0x6b, 0x65,0x73,0x20,0x4a,0x61,0x63,0x6b,0x20 }; - static const byte bigKey[] = "0123456789abcdeffedcba9876543210"; + WOLFSSL_SMALL_STACK_STATIC const byte bigKey[] = "0123456789abcdeffedcba9876543210"; word32 keySz, msgSz; #ifdef WOLFSSL_SMALL_STACK byte *bigCipher = (byte *)XMALLOC(sizeof(bigMsg), NULL, DYNAMIC_TYPE_TMP_BUFFER); @@ -8268,7 +8268,7 @@ static int aes_test(void) /* Test Vector from "NIST Special Publication 800-38A, 2001 Edition" * https://nvlpubs.nist.gov/nistpubs/legacy/sp/nistspecialpublication800-38a.pdf */ - static const byte msg2[] = + WOLFSSL_SMALL_STACK_STATIC const byte msg2[] = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, @@ -8276,18 +8276,18 @@ static int aes_test(void) 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51 }; - static const byte verify2[] = + WOLFSSL_SMALL_STACK_STATIC const byte verify2[] = { 0x76, 0x49, 0xab, 0xac, 0x81, 0x19, 0xb2, 0x46, 0xce, 0xe9, 0x8e, 0x9b, 0x12, 0xe9, 0x19, 0x7d, 0x50, 0x86, 0xcb, 0x9b, 0x50, 0x72, 0x19, 0xee, 0x95, 0xdb, 0x11, 0x3a, 0x91, 0x76, 0x78, 0xb2 }; - static const byte key2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte key2[] = { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c }; - static const byte iv2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte iv2[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; @@ -8352,13 +8352,13 @@ static int aes_test(void) /* test vectors from "Recommendation for Block Cipher Modes of * Operation" NIST Special Publication 800-38A */ - static const byte ctrIv[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctrIv[] = { 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7, 0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff }; - static const byte ctrPlain[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctrPlain[] = { 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a, @@ -8371,19 +8371,19 @@ static int aes_test(void) }; #ifdef WOLFSSL_AES_128 - static const byte oddCipher[] = + WOLFSSL_SMALL_STACK_STATIC const byte oddCipher[] = { 0xb9,0xd7,0xcb,0x08,0xb0,0xe1,0x7b,0xa0, 0xc2 }; - static const byte ctr128Key[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctr128Key[] = { 0x2b,0x7e,0x15,0x16,0x28,0xae,0xd2,0xa6, 0xab,0xf7,0x15,0x88,0x09,0xcf,0x4f,0x3c }; - static const byte ctr128Cipher[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctr128Cipher[] = { 0x87,0x4d,0x61,0x91,0xb6,0x20,0xe3,0x26, 0x1b,0xef,0x68,0x64,0x99,0x0d,0xb6,0xce, @@ -8397,14 +8397,14 @@ static int aes_test(void) #endif /* WOLFSSL_AES_128 */ #ifdef WOLFSSL_AES_192 - static const byte ctr192Key[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctr192Key[] = { 0x8e,0x73,0xb0,0xf7,0xda,0x0e,0x64,0x52, 0xc8,0x10,0xf3,0x2b,0x80,0x90,0x79,0xe5, 0x62,0xf8,0xea,0xd2,0x52,0x2c,0x6b,0x7b }; - static const byte ctr192Cipher[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctr192Cipher[] = { 0x1a,0xbc,0x93,0x24,0x17,0x52,0x1c,0xa2, 0x4f,0x2b,0x04,0x59,0xfe,0x7e,0x6e,0x0b, @@ -8417,7 +8417,7 @@ static int aes_test(void) }; #endif #ifdef WOLFSSL_AES_256 - static const byte ctr256Key[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctr256Key[] = { 0x60,0x3d,0xeb,0x10,0x15,0xca,0x71,0xbe, 0x2b,0x73,0xae,0xf0,0x85,0x7d,0x77,0x81, @@ -8425,7 +8425,7 @@ static int aes_test(void) 0x2d,0x98,0x10,0xa3,0x09,0x14,0xdf,0xf4 }; - static const byte ctr256Cipher[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctr256Cipher[] = { 0x60,0x1e,0xc3,0x13,0x77,0x57,0x89,0xa5, 0xb7,0xa7,0xf5,0x04,0xbb,0xf3,0xd2,0x28, @@ -8552,19 +8552,19 @@ static int aes_test(void) #if defined(WOLFSSL_AES_DIRECT) && defined(WOLFSSL_AES_256) { - static const byte niPlain[] = + WOLFSSL_SMALL_STACK_STATIC const byte niPlain[] = { 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a }; - static const byte niCipher[] = + WOLFSSL_SMALL_STACK_STATIC const byte niCipher[] = { 0xf3,0xee,0xd1,0xbd,0xb5,0xd2,0xa0,0x3c, 0x06,0x4b,0x5a,0x7e,0x3d,0xb1,0x81,0xf8 }; - static const byte niKey[] = + WOLFSSL_SMALL_STACK_STATIC const byte niKey[] = { 0x60,0x3d,0xeb,0x10,0x15,0xca,0x71,0xbe, 0x2b,0x73,0xae,0xf0,0x85,0x7d,0x77,0x81, @@ -8692,12 +8692,12 @@ static int aes192_test(void) /* Test vectors from NIST Special Publication 800-38A, 2001 Edition * Appendix F.2.3 */ - static const byte msg[] = { + WOLFSSL_SMALL_STACK_STATIC const byte msg[] = { 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a }; - static const byte verify[] = + WOLFSSL_SMALL_STACK_STATIC const byte verify[] = { 0x4f,0x02,0x1d,0xb2,0x43,0xbc,0x63,0x3d, 0x71,0x78,0x18,0x3a,0x9f,0xa0,0x71,0xe8 @@ -8780,12 +8780,12 @@ static int aes256_test(void) #ifdef HAVE_AES_CBC /* Test vectors from NIST Special Publication 800-38A, 2001 Edition, * Appendix F.2.5 */ - static const byte msg[] = { + WOLFSSL_SMALL_STACK_STATIC const byte msg[] = { 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a }; - static const byte verify[] = + WOLFSSL_SMALL_STACK_STATIC const byte verify[] = { 0xf5,0x8c,0x4c,0x04,0xd6,0xe5,0xf1,0xba, 0x77,0x9e,0xab,0xfb,0x5f,0x7b,0xfb,0xd6 @@ -9037,7 +9037,7 @@ static int aesgcm_test(void) * Counter Mode of Operation (GCM) by McGrew and * Viega. */ - static const byte p[] = + WOLFSSL_SMALL_STACK_STATIC const byte p[] = { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a, @@ -9050,7 +9050,7 @@ static int aesgcm_test(void) }; #if defined(WOLFSSL_AES_256) - static const byte a[] = + WOLFSSL_SMALL_STACK_STATIC const byte a[] = { 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, @@ -9059,7 +9059,7 @@ static int aesgcm_test(void) #endif #ifdef WOLFSSL_AES_256 - static const byte k1[] = + WOLFSSL_SMALL_STACK_STATIC const byte k1[] = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, @@ -9067,13 +9067,13 @@ static int aesgcm_test(void) 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 }; - static const byte iv1[] = + WOLFSSL_SMALL_STACK_STATIC const byte iv1[] = { 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad, 0xde, 0xca, 0xf8, 0x88 }; - static const byte c1[] = + WOLFSSL_SMALL_STACK_STATIC const byte c1[] = { 0x52, 0x2d, 0xc1, 0xf0, 0x99, 0x56, 0x7d, 0x07, 0xf4, 0x7f, 0x37, 0xa3, 0x2a, 0x84, 0x42, 0x7d, @@ -9086,7 +9086,7 @@ static int aesgcm_test(void) }; #endif /* WOLFSSL_AES_256 */ - static const byte t1[] = + WOLFSSL_SMALL_STACK_STATIC const byte t1[] = { 0x76, 0xfc, 0x6e, 0xce, 0x0f, 0x4e, 0x17, 0x68, 0xcd, 0xdf, 0x88, 0x53, 0xbb, 0x2d, 0x55, 0x1b @@ -9104,14 +9104,14 @@ static int aesgcm_test(void) #define ENABLE_NON_12BYTE_IV_TEST #ifdef WOLFSSL_AES_192 /* Test Case 12, uses same plaintext and AAD data. */ - static const byte k2[] = + WOLFSSL_SMALL_STACK_STATIC const byte k2[] = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c }; - static const byte iv2[] = + WOLFSSL_SMALL_STACK_STATIC const byte iv2[] = { 0x93, 0x13, 0x22, 0x5d, 0xf8, 0x84, 0x06, 0xe5, 0x55, 0x90, 0x9c, 0x5a, 0xff, 0x52, 0x69, 0xaa, @@ -9123,7 +9123,7 @@ static int aesgcm_test(void) 0xa6, 0x37, 0xb3, 0x9b }; - static const byte c2[] = + WOLFSSL_SMALL_STACK_STATIC const byte c2[] = { 0xd2, 0x7e, 0x88, 0x68, 0x1c, 0xe3, 0x24, 0x3c, 0x48, 0x30, 0x16, 0x5a, 0x8f, 0xdc, 0xf9, 0xff, @@ -9135,7 +9135,7 @@ static int aesgcm_test(void) 0xe9, 0xb7, 0x37, 0x3b }; - static const byte t2[] = + WOLFSSL_SMALL_STACK_STATIC const byte t2[] = { 0xdc, 0xf5, 0x66, 0xff, 0x29, 0x1c, 0x25, 0xbb, 0xb8, 0x56, 0x8f, 0xc3, 0xd3, 0x76, 0xa6, 0xd9 @@ -9144,36 +9144,36 @@ static int aesgcm_test(void) #ifdef WOLFSSL_AES_128 /* The following is an interesting test case from the example * FIPS test vectors for AES-GCM. IVlen = 1 byte */ - static const byte p3[] = + WOLFSSL_SMALL_STACK_STATIC const byte p3[] = { 0x57, 0xce, 0x45, 0x1f, 0xa5, 0xe2, 0x35, 0xa5, 0x8e, 0x1a, 0xa2, 0x3b, 0x77, 0xcb, 0xaf, 0xe2 }; - static const byte k3[] = + WOLFSSL_SMALL_STACK_STATIC const byte k3[] = { 0xbb, 0x01, 0xd7, 0x03, 0x81, 0x1c, 0x10, 0x1a, 0x35, 0xe0, 0xff, 0xd2, 0x91, 0xba, 0xf2, 0x4b }; - static const byte iv3[] = + WOLFSSL_SMALL_STACK_STATIC const byte iv3[] = { 0xca }; - static const byte c3[] = + WOLFSSL_SMALL_STACK_STATIC const byte c3[] = { 0x6b, 0x5f, 0xb3, 0x9d, 0xc1, 0xc5, 0x7a, 0x4f, 0xf3, 0x51, 0x4d, 0xc2, 0xd5, 0xf0, 0xd0, 0x07 }; - static const byte a3[] = + WOLFSSL_SMALL_STACK_STATIC const byte a3[] = { 0x40, 0xfc, 0xdc, 0xd7, 0x4a, 0xd7, 0x8b, 0xf1, 0x3e, 0x7c, 0x60, 0x55, 0x50, 0x51, 0xdd, 0x54 }; - static const byte t3[] = + WOLFSSL_SMALL_STACK_STATIC const byte t3[] = { 0x06, 0x90, 0xed, 0x01, 0x34, 0xdd, 0xc6, 0x95, 0x31, 0x2e, 0x2a, 0xf9, 0x57, 0x7a, 0x1e, 0xa6 @@ -9578,22 +9578,22 @@ static int gmac_test(void) { Gmac gmac; - static const byte k1[] = + WOLFSSL_SMALL_STACK_STATIC const byte k1[] = { 0x89, 0xc9, 0x49, 0xe9, 0xc8, 0x04, 0xaf, 0x01, 0x4d, 0x56, 0x04, 0xb3, 0x94, 0x59, 0xf2, 0xc8 }; - static const byte iv1[] = + WOLFSSL_SMALL_STACK_STATIC const byte iv1[] = { 0xd1, 0xb1, 0x04, 0xc8, 0x15, 0xbf, 0x1e, 0x94, 0xe2, 0x8c, 0x8f, 0x16 }; - static const byte a1[] = + WOLFSSL_SMALL_STACK_STATIC const byte a1[] = { 0x82, 0xad, 0xcd, 0x63, 0x8d, 0x3f, 0xa9, 0xd9, 0xf3, 0xe8, 0x41, 0x00, 0xd6, 0x1e, 0x07, 0x77 }; - static const byte t1[] = + WOLFSSL_SMALL_STACK_STATIC const byte t1[] = { 0x88, 0xdb, 0x9d, 0x62, 0x17, 0x2e, 0xd0, 0x43, 0xaa, 0x10, 0xf1, 0x6d, 0x22, 0x7d, 0xc4, 0x1b @@ -9604,22 +9604,22 @@ static int gmac_test(void) /* FIPS builds only allow 16-byte auth tags. */ /* This sample uses a 15-byte auth tag. */ - static const byte k2[] = + WOLFSSL_SMALL_STACK_STATIC const byte k2[] = { 0x40, 0xf7, 0xec, 0xb2, 0x52, 0x6d, 0xaa, 0xd4, 0x74, 0x25, 0x1d, 0xf4, 0x88, 0x9e, 0xf6, 0x5b }; - static const byte iv2[] = + WOLFSSL_SMALL_STACK_STATIC const byte iv2[] = { 0xee, 0x9c, 0x6e, 0x06, 0x15, 0x45, 0x45, 0x03, 0x1a, 0x60, 0x24, 0xa7 }; - static const byte a2[] = + WOLFSSL_SMALL_STACK_STATIC const byte a2[] = { 0x94, 0x81, 0x2c, 0x87, 0x07, 0x4e, 0x15, 0x18, 0x34, 0xb8, 0x35, 0xaf, 0x1c, 0xa5, 0x7e, 0x56 }; - static const byte t2[] = + WOLFSSL_SMALL_STACK_STATIC const byte t2[] = { 0xc6, 0x81, 0x79, 0x8e, 0x3d, 0xda, 0xb0, 0x9f, 0x8d, 0x83, 0xb0, 0xbb, 0x14, 0xb6, 0x91 @@ -9647,7 +9647,7 @@ static int gmac_test(void) #if !defined(WC_NO_RNG) && !defined(HAVE_SELFTEST) && !defined(NO_AES_DECRYPT) { - static const byte badT[] = + WOLFSSL_SMALL_STACK_STATIC const byte badT[] = { 0xde, 0xad, 0xbe, 0xef, 0x17, 0x2e, 0xd0, 0x43, 0xaa, 0x10, 0xf1, 0x6d, 0x22, 0x7d, 0xc4, 0x1b @@ -9698,28 +9698,28 @@ static int aesccm_test(void) Aes enc; /* key */ - static const byte k[] = + WOLFSSL_SMALL_STACK_STATIC const byte k[] = { 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf }; /* nonce */ - static const byte iv[] = + WOLFSSL_SMALL_STACK_STATIC const byte iv[] = { 0x00, 0x00, 0x00, 0x03, 0x02, 0x01, 0x00, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5 }; /* plaintext */ - static const byte p[] = + WOLFSSL_SMALL_STACK_STATIC const byte p[] = { 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e }; /* plaintext - long */ - static const byte pl[] = + WOLFSSL_SMALL_STACK_STATIC const byte pl[] = { 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, @@ -9734,25 +9734,25 @@ static int aesccm_test(void) }; - static const byte a[] = + WOLFSSL_SMALL_STACK_STATIC const byte a[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }; /* ciphertext */ - static const byte c[] = + WOLFSSL_SMALL_STACK_STATIC const byte c[] = { 0x58, 0x8c, 0x97, 0x9a, 0x61, 0xc6, 0x63, 0xd2, 0xf0, 0x66, 0xd0, 0xc2, 0xc0, 0xf9, 0x89, 0x80, 0x6d, 0x5f, 0x6b, 0x61, 0xda, 0xc3, 0x84 }; /* tag - authentication */ - static const byte t[] = + WOLFSSL_SMALL_STACK_STATIC const byte t[] = { 0x17, 0xe8, 0xd1, 0x2c, 0xfd, 0xf9, 0x26, 0xe0 }; /* ciphertext - long */ - static const byte cl[] = + WOLFSSL_SMALL_STACK_STATIC const byte cl[] = { 0x58, 0x8c, 0x97, 0x9a, 0x61, 0xc6, 0x63, 0xd2, 0xf0, 0x66, 0xd0, 0xc2, 0xc0, 0xf9, 0x89, 0x80, @@ -9766,7 +9766,7 @@ static int aesccm_test(void) 0x0b }; /* tag - authentication - long */ - static const byte tl[] = + WOLFSSL_SMALL_STACK_STATIC const byte tl[] = { 0x89, 0xd8, 0xd2, 0x02, 0xc5, 0xcf, 0xae, 0xf4 }; @@ -9903,17 +9903,17 @@ static int aeskeywrap_test(void) #ifdef WOLFSSL_AES_128 /* Wrap 128 bits of Key Data with a 128-bit KEK */ - static const byte k1[] = { + WOLFSSL_SMALL_STACK_STATIC const byte k1[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; - static const byte d1[] = { + WOLFSSL_SMALL_STACK_STATIC const byte d1[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF }; - static const byte v1[] = { + WOLFSSL_SMALL_STACK_STATIC const byte v1[] = { 0x1F, 0xA6, 0x8B, 0x0A, 0x81, 0x12, 0xB4, 0x47, 0xAE, 0xF3, 0x4B, 0xD8, 0xFB, 0x5A, 0x7B, 0x82, 0x9D, 0x3E, 0x86, 0x23, 0x71, 0xD2, 0xCF, 0xE5 @@ -9922,18 +9922,18 @@ static int aeskeywrap_test(void) #ifdef WOLFSSL_AES_192 /* Wrap 128 bits of Key Data with a 192-bit KEK */ - static const byte k2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte k2[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 }; - static const byte d2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte d2[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF }; - static const byte v2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte v2[] = { 0x96, 0x77, 0x8B, 0x25, 0xAE, 0x6C, 0xA4, 0x35, 0xF9, 0x2B, 0x5B, 0x97, 0xC0, 0x50, 0xAE, 0xD2, 0x46, 0x8A, 0xB8, 0xA1, 0x7A, 0xD8, 0x4E, 0x5D @@ -9942,19 +9942,19 @@ static int aeskeywrap_test(void) #ifdef WOLFSSL_AES_256 /* Wrap 128 bits of Key Data with a 256-bit KEK */ - static const byte k3[] = { + WOLFSSL_SMALL_STACK_STATIC const byte k3[] = { 0x00, 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 }; - static const byte d3[] = { + WOLFSSL_SMALL_STACK_STATIC const byte d3[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF }; - static const byte v3[] = { + WOLFSSL_SMALL_STACK_STATIC const byte v3[] = { 0x64, 0xE8, 0xC3, 0xF9, 0xCE, 0x0F, 0x5B, 0xA2, 0x63, 0xE9, 0x77, 0x79, 0x05, 0x81, 0x8A, 0x2A, 0x93, 0xC8, 0x19, 0x1E, 0x7D, 0x6E, 0x8A, 0xE7 @@ -9963,19 +9963,19 @@ static int aeskeywrap_test(void) #ifdef WOLFSSL_AES_192 /* Wrap 192 bits of Key Data with a 192-bit KEK */ - static const byte k4[] = { + WOLFSSL_SMALL_STACK_STATIC const byte k4[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 }; - static const byte d4[] = { + WOLFSSL_SMALL_STACK_STATIC const byte d4[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }; - static const byte v4[] = { + WOLFSSL_SMALL_STACK_STATIC const byte v4[] = { 0x03, 0x1D, 0x33, 0x26, 0x4E, 0x15, 0xD3, 0x32, 0x68, 0xF2, 0x4E, 0xC2, 0x60, 0x74, 0x3E, 0xDC, 0xE1, 0xC6, 0xC7, 0xDD, 0xEE, 0x72, 0x5A, 0x93, @@ -9985,20 +9985,20 @@ static int aeskeywrap_test(void) #ifdef WOLFSSL_AES_256 /* Wrap 192 bits of Key Data with a 256-bit KEK */ - static const byte k5[] = { + WOLFSSL_SMALL_STACK_STATIC const byte k5[] = { 0x00, 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 }; - static const byte d5[] = { + WOLFSSL_SMALL_STACK_STATIC const byte d5[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }; - static const byte v5[] = { + WOLFSSL_SMALL_STACK_STATIC const byte v5[] = { 0xA8, 0xF9, 0xBC, 0x16, 0x12, 0xC6, 0x8B, 0x3F, 0xF6, 0xE6, 0xF4, 0xFB, 0xE3, 0x0E, 0x71, 0xE4, 0x76, 0x9C, 0x8B, 0x80, 0xA3, 0x2C, 0xB8, 0x95, @@ -10006,21 +10006,21 @@ static int aeskeywrap_test(void) }; /* Wrap 256 bits of Key Data with a 256-bit KEK */ - static const byte k6[] = { + WOLFSSL_SMALL_STACK_STATIC const byte k6[] = { 0x00, 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 }; - static const byte d6[] = { + WOLFSSL_SMALL_STACK_STATIC const byte d6[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; - static const byte v6[] = { + WOLFSSL_SMALL_STACK_STATIC const byte v6[] = { 0x28, 0xC9, 0xF4, 0x04, 0xC4, 0xB8, 0x10, 0xF4, 0xCB, 0xCC, 0xB3, 0x5C, 0xFB, 0x87, 0xF8, 0x26, 0x3F, 0x57, 0x86, 0xE2, 0xD8, 0x0E, 0xD3, 0x26, @@ -10106,102 +10106,102 @@ typedef struct { static int camellia_test(void) { /* Camellia ECB Test Plaintext */ - static const byte pte[] = + WOLFSSL_SMALL_STACK_STATIC const byte pte[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }; /* Camellia ECB Test Initialization Vector */ - static const byte ive[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; + WOLFSSL_SMALL_STACK_STATIC const byte ive[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; /* Test 1: Camellia ECB 128-bit key */ - static const byte k1[] = + WOLFSSL_SMALL_STACK_STATIC const byte k1[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }; - static const byte c1[] = + WOLFSSL_SMALL_STACK_STATIC const byte c1[] = { 0x67, 0x67, 0x31, 0x38, 0x54, 0x96, 0x69, 0x73, 0x08, 0x57, 0x06, 0x56, 0x48, 0xea, 0xbe, 0x43 }; /* Test 2: Camellia ECB 192-bit key */ - static const byte k2[] = + WOLFSSL_SMALL_STACK_STATIC const byte k2[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 }; - static const byte c2[] = + WOLFSSL_SMALL_STACK_STATIC const byte c2[] = { 0xb4, 0x99, 0x34, 0x01, 0xb3, 0xe9, 0x96, 0xf8, 0x4e, 0xe5, 0xce, 0xe7, 0xd7, 0x9b, 0x09, 0xb9 }; /* Test 3: Camellia ECB 256-bit key */ - static const byte k3[] = + WOLFSSL_SMALL_STACK_STATIC const byte k3[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff }; - static const byte c3[] = + WOLFSSL_SMALL_STACK_STATIC const byte c3[] = { 0x9a, 0xcc, 0x23, 0x7d, 0xff, 0x16, 0xd7, 0x6c, 0x20, 0xef, 0x7c, 0x91, 0x9e, 0x3a, 0x75, 0x09 }; /* Camellia CBC Test Plaintext */ - static const byte ptc[] = + WOLFSSL_SMALL_STACK_STATIC const byte ptc[] = { 0x6B, 0xC1, 0xBE, 0xE2, 0x2E, 0x40, 0x9F, 0x96, 0xE9, 0x3D, 0x7E, 0x11, 0x73, 0x93, 0x17, 0x2A }; /* Camellia CBC Test Initialization Vector */ - static const byte ivc[] = + WOLFSSL_SMALL_STACK_STATIC const byte ivc[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; /* Test 4: Camellia-CBC 128-bit key */ - static const byte k4[] = + WOLFSSL_SMALL_STACK_STATIC const byte k4[] = { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C }; - static const byte c4[] = + WOLFSSL_SMALL_STACK_STATIC const byte c4[] = { 0x16, 0x07, 0xCF, 0x49, 0x4B, 0x36, 0xBB, 0xF0, 0x0D, 0xAE, 0xB0, 0xB5, 0x03, 0xC8, 0x31, 0xAB }; /* Test 5: Camellia-CBC 192-bit key */ - static const byte k5[] = + WOLFSSL_SMALL_STACK_STATIC const byte k5[] = { 0x8E, 0x73, 0xB0, 0xF7, 0xDA, 0x0E, 0x64, 0x52, 0xC8, 0x10, 0xF3, 0x2B, 0x80, 0x90, 0x79, 0xE5, 0x62, 0xF8, 0xEA, 0xD2, 0x52, 0x2C, 0x6B, 0x7B }; - static const byte c5[] = + WOLFSSL_SMALL_STACK_STATIC const byte c5[] = { 0x2A, 0x48, 0x30, 0xAB, 0x5A, 0xC4, 0xA1, 0xA2, 0x40, 0x59, 0x55, 0xFD, 0x21, 0x95, 0xCF, 0x93 }; /* Test 6: CBC 256-bit key */ - static const byte k6[] = + WOLFSSL_SMALL_STACK_STATIC const byte k6[] = { 0x60, 0x3D, 0xEB, 0x10, 0x15, 0xCA, 0x71, 0xBE, 0x2B, 0x73, 0xAE, 0xF0, 0x85, 0x7D, 0x77, 0x81, 0x1F, 0x35, 0x2C, 0x07, 0x3B, 0x61, 0x08, 0xD7, 0x2D, 0x98, 0x10, 0xA3, 0x09, 0x14, 0xDF, 0xF4 }; - static const byte c6[] = + WOLFSSL_SMALL_STACK_STATIC const byte c6[] = { 0xE6, 0xCF, 0xA3, 0x5F, 0xC0, 0x2B, 0x13, 0x4A, 0x4D, 0x2C, 0x0B, 0x67, 0x37, 0xAC, 0x3E, 0xDA @@ -10550,7 +10550,7 @@ static int idea_test(void) static int XChaCha_test(void) { int ret = -6830; - static const byte Plaintext[] = { + WOLFSSL_SMALL_STACK_STATIC const byte Plaintext[] = { 0x54, 0x68, 0x65, 0x20, 0x64, 0x68, 0x6f, 0x6c, 0x65, 0x20, 0x28, 0x70, 0x72, 0x6f, 0x6e, 0x6f, /* The dhole (prono */ 0x75, 0x6e, 0x63, 0x65, 0x64, 0x20, 0x22, 0x64, 0x6f, 0x6c, 0x65, 0x22, 0x29, 0x20, 0x69, 0x73, /* unced "dole") is */ 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x20, 0x61, 0x73, 0x20, 0x74, /* also known as t */ @@ -10572,16 +10572,16 @@ static int XChaCha_test(void) { 0x20, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x20, 0x43, 0x61, 0x6e, 0x69, 0x64, 0x61, 0x65, 0x2e /* family Canidae. */ }; - static const byte Key[] = { + WOLFSSL_SMALL_STACK_STATIC const byte Key[] = { 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f }; - static const byte IV[] = { + WOLFSSL_SMALL_STACK_STATIC const byte IV[] = { 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* @ABCDEFGHIJKLMNO */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x58 }; /* PQRSTUVW */ - static const byte Ciphertext[] = { + WOLFSSL_SMALL_STACK_STATIC const byte Ciphertext[] = { 0x45, 0x59, 0xab, 0xba, 0x4e, 0x48, 0xc1, 0x61, 0x02, 0xe8, 0xbb, 0x2c, 0x05, 0xe6, 0x94, 0x7f, 0x50, 0xa7, 0x86, 0xde, 0x16, 0x2f, 0x9b, 0x0b, 0x7e, 0x59, 0x2a, 0x9b, 0x53, 0xd0, 0xd4, 0xe9, 0x8d, 0x8d, 0x64, 0x10, 0xd5, 0x40, 0xa1, 0xa6, 0x37, 0x5b, 0x26, 0xd8, 0x0d, 0xac, 0xe4, 0xfa, @@ -10657,7 +10657,7 @@ static int XChaCha_test(void) { static int XChaCha20Poly1305_test(void) { int ret; - static const byte Plaintext[] = { + WOLFSSL_SMALL_STACK_STATIC const byte Plaintext[] = { 0x4c, 0x61, 0x64, 0x69, 0x65, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x47, 0x65, 0x6e, 0x74, 0x6c, /* Ladies and Gentl */ 0x65, 0x6d, 0x65, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x61, 0x73, /* emen of the clas */ 0x73, 0x20, 0x6f, 0x66, 0x20, 0x27, 0x39, 0x39, 0x3a, 0x20, 0x49, 0x66, 0x20, 0x49, 0x20, 0x63, /* s of '99: If I c */ @@ -10667,18 +10667,18 @@ static int XChaCha20Poly1305_test(void) { 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x69, /* creen would be i */ 0x74, 0x2e }; /* t. */ - static const byte AAD[] = { 0x50, 0x51, 0x52, 0x53, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7 }; /* PQRS........ */ + WOLFSSL_SMALL_STACK_STATIC const byte AAD[] = { 0x50, 0x51, 0x52, 0x53, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7 }; /* PQRS........ */ - static const byte Key[] = { + WOLFSSL_SMALL_STACK_STATIC const byte Key[] = { 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f }; - static const byte IV[] = { + WOLFSSL_SMALL_STACK_STATIC const byte IV[] = { 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, /* @ABCDEFGHIJKLMNO */ 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57 }; /* PQRSTUVW */ - static const byte Ciphertext[] = { + WOLFSSL_SMALL_STACK_STATIC const byte Ciphertext[] = { 0xbd, 0x6d, 0x17, 0x9d, 0x3e, 0x83, 0xd4, 0x3b, 0x95, 0x76, 0x57, 0x94, 0x93, 0xc0, 0xe9, 0x39, 0x57, 0x2a, 0x17, 0x00, 0x25, 0x2b, 0xfa, 0xcc, 0xbe, 0xd2, 0x90, 0x2c, 0x21, 0x39, 0x6c, 0xbb, 0x73, 0x1c, 0x7f, 0x1b, 0x0b, 0x4a, 0xa6, 0x44, 0x0b, 0xf3, 0xa8, 0x2f, 0x4e, 0xda, 0x7e, 0x39, @@ -10688,7 +10688,7 @@ static int XChaCha20Poly1305_test(void) { 0x21, 0xf9, 0x66, 0x4c, 0x97, 0x63, 0x7d, 0xa9, 0x76, 0x88, 0x12, 0xf6, 0x15, 0xc6, 0x8b, 0x13, 0xb5, 0x2e }; - static const byte Tag[] = { + WOLFSSL_SMALL_STACK_STATIC const byte Tag[] = { 0xc0, 0x87, 0x59, 0x24, 0xc1, 0xc7, 0x98, 0x79, 0x47, 0xde, 0xaf, 0xd8, 0x78, 0x0a, 0xcf, 0x49 }; @@ -10845,14 +10845,14 @@ static int random_rng_test(void) static int random_test(void) { - static const byte test1Entropy[] = + WOLFSSL_SMALL_STACK_STATIC const byte test1Entropy[] = { 0xa6, 0x5a, 0xd0, 0xf3, 0x45, 0xdb, 0x4e, 0x0e, 0xff, 0xe8, 0x75, 0xc3, 0xa2, 0xe7, 0x1f, 0x42, 0xc7, 0x12, 0x9d, 0x62, 0x0f, 0xf5, 0xc1, 0x19, 0xa9, 0xef, 0x55, 0xf0, 0x51, 0x85, 0xe0, 0xfb, 0x85, 0x81, 0xf9, 0x31, 0x75, 0x17, 0x27, 0x6e, 0x06, 0xe9, 0x60, 0x7d, 0xdb, 0xcb, 0xcc, 0x2e }; - static const byte test1Output[] = + WOLFSSL_SMALL_STACK_STATIC const byte test1Output[] = { 0xd3, 0xe1, 0x60, 0xc3, 0x5b, 0x99, 0xf3, 0x40, 0xb2, 0x62, 0x82, 0x64, 0xd1, 0x75, 0x10, 0x60, 0xe0, 0x04, 0x5d, 0xa3, 0x83, 0xff, 0x57, 0xa5, @@ -10866,20 +10866,20 @@ static int random_test(void) 0x12, 0x04, 0x15, 0x52, 0x8b, 0x22, 0x95, 0x91, 0x02, 0x81, 0xb0, 0x2d, 0xd4, 0x31, 0xf4, 0xc9, 0xf7, 0x04, 0x27, 0xdf }; - static const byte test2EntropyA[] = + WOLFSSL_SMALL_STACK_STATIC const byte test2EntropyA[] = { 0x63, 0x36, 0x33, 0x77, 0xe4, 0x1e, 0x86, 0x46, 0x8d, 0xeb, 0x0a, 0xb4, 0xa8, 0xed, 0x68, 0x3f, 0x6a, 0x13, 0x4e, 0x47, 0xe0, 0x14, 0xc7, 0x00, 0x45, 0x4e, 0x81, 0xe9, 0x53, 0x58, 0xa5, 0x69, 0x80, 0x8a, 0xa3, 0x8f, 0x2a, 0x72, 0xa6, 0x23, 0x59, 0x91, 0x5a, 0x9f, 0x8a, 0x04, 0xca, 0x68 }; - static const byte test2EntropyB[] = + WOLFSSL_SMALL_STACK_STATIC const byte test2EntropyB[] = { 0xe6, 0x2b, 0x8a, 0x8e, 0xe8, 0xf1, 0x41, 0xb6, 0x98, 0x05, 0x66, 0xe3, 0xbf, 0xe3, 0xc0, 0x49, 0x03, 0xda, 0xd4, 0xac, 0x2c, 0xdf, 0x9f, 0x22, 0x80, 0x01, 0x0a, 0x67, 0x39, 0xbc, 0x83, 0xd3 }; - static const byte test2Output[] = + WOLFSSL_SMALL_STACK_STATIC const byte test2Output[] = { 0x04, 0xee, 0xc6, 0x3b, 0xb2, 0x31, 0xdf, 0x2c, 0x63, 0x0a, 0x1a, 0xfb, 0xe7, 0x24, 0x94, 0x9d, 0x00, 0x5a, 0x58, 0x78, 0x51, 0xe1, 0xaa, 0x79, @@ -11386,11 +11386,11 @@ static const CertName certDefaultName = { #ifdef WOLFSSL_CERT_EXT #if ((defined(HAVE_ED25519) || defined(HAVE_ED448)) && \ defined(WOLFSSL_TEST_CERT)) || defined(HAVE_ECC) - static const char certKeyUsage[] = + WOLFSSL_SMALL_STACK_STATIC const char certKeyUsage[] = "digitalSignature,nonRepudiation"; #endif #if (defined(WOLFSSL_CERT_REQ) || defined(HAVE_NTRU)) && !defined(NO_RSA) - static const char certKeyUsage2[] = + WOLFSSL_SMALL_STACK_STATIC const char certKeyUsage2[] = "digitalSignature,nonRepudiation,keyEncipherment,keyAgreement"; #endif #endif /* WOLFSSL_CERT_EXT */ @@ -12076,14 +12076,14 @@ static int rsa_sig_test(RsaKey* key, word32 keyLen, int modLen, WC_RNG* rng) { int ret; word32 sigSz; - static const byte in[] = "Everyone gets Friday off."; - static const byte hash[] = { + WOLFSSL_SMALL_STACK_STATIC const byte in[] = "Everyone gets Friday off."; + WOLFSSL_SMALL_STACK_STATIC const byte hash[] = { 0xf2, 0x02, 0x95, 0x65, 0xcb, 0xf6, 0x2a, 0x59, 0x39, 0x2c, 0x05, 0xff, 0x0e, 0x29, 0xaf, 0xfe, 0x47, 0x33, 0x8c, 0x99, 0x8d, 0x58, 0x64, 0x83, 0xa6, 0x58, 0x0a, 0x33, 0x0b, 0x84, 0x5f, 0x5f }; - static const byte hashEnc[] = { + WOLFSSL_SMALL_STACK_STATIC const byte hashEnc[] = { 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20, @@ -12353,34 +12353,34 @@ static int rsa_decode_test(RsaKey* keyPub) int ret; word32 inSz; word32 inOutIdx; - static const byte n[2] = { 0x00, 0x23 }; - static const byte e[2] = { 0x00, 0x03 }; - static const byte good[] = { 0x30, 0x06, 0x02, 0x01, 0x23, 0x02, 0x1, + WOLFSSL_SMALL_STACK_STATIC const byte n[2] = { 0x00, 0x23 }; + WOLFSSL_SMALL_STACK_STATIC const byte e[2] = { 0x00, 0x03 }; + WOLFSSL_SMALL_STACK_STATIC const byte good[] = { 0x30, 0x06, 0x02, 0x01, 0x23, 0x02, 0x1, 0x03 }; - static const byte goodAlgId[] = { 0x30, 0x0f, 0x30, 0x0d, 0x06, 0x00, + WOLFSSL_SMALL_STACK_STATIC const byte goodAlgId[] = { 0x30, 0x0f, 0x30, 0x0d, 0x06, 0x00, 0x03, 0x09, 0x00, 0x30, 0x06, 0x02, 0x01, 0x23, 0x02, 0x1, 0x03 }; - static const byte goodAlgIdNull[] = { 0x30, 0x11, 0x30, 0x0f, 0x06, 0x00, + WOLFSSL_SMALL_STACK_STATIC const byte goodAlgIdNull[] = { 0x30, 0x11, 0x30, 0x0f, 0x06, 0x00, 0x05, 0x00, 0x03, 0x09, 0x00, 0x30, 0x06, 0x02, 0x01, 0x23, 0x02, 0x1, 0x03 }; - static const byte badAlgIdNull[] = { 0x30, 0x12, 0x30, 0x10, 0x06, 0x00, + WOLFSSL_SMALL_STACK_STATIC const byte badAlgIdNull[] = { 0x30, 0x12, 0x30, 0x10, 0x06, 0x00, 0x05, 0x01, 0x00, 0x03, 0x09, 0x00, 0x30, 0x06, 0x02, 0x01, 0x23, 0x02, 0x1, 0x03 }; - static const byte badNotBitString[] = { 0x30, 0x0f, 0x30, 0x0d, 0x06, 0x00, + WOLFSSL_SMALL_STACK_STATIC const byte badNotBitString[] = { 0x30, 0x0f, 0x30, 0x0d, 0x06, 0x00, 0x04, 0x09, 0x00, 0x30, 0x06, 0x02, 0x01, 0x23, 0x02, 0x1, 0x03 }; - static const byte badBitStringLen[] = { 0x30, 0x0f, 0x30, 0x0d, 0x06, 0x00, + WOLFSSL_SMALL_STACK_STATIC const byte badBitStringLen[] = { 0x30, 0x0f, 0x30, 0x0d, 0x06, 0x00, 0x03, 0x0a, 0x00, 0x30, 0x06, 0x02, 0x01, 0x23, 0x02, 0x1, 0x03 }; - static const byte badNoSeq[] = { 0x30, 0x0d, 0x30, 0x0b, 0x06, 0x00, 0x03, + WOLFSSL_SMALL_STACK_STATIC const byte badNoSeq[] = { 0x30, 0x0d, 0x30, 0x0b, 0x06, 0x00, 0x03, 0x07, 0x00, 0x02, 0x01, 0x23, 0x02, 0x1, 0x03 }; - static const byte badNoObj[] = { + WOLFSSL_SMALL_STACK_STATIC const byte badNoObj[] = { 0x30, 0x0f, 0x30, 0x0d, 0x05, 0x00, 0x03, 0x09, 0x00, 0x30, 0x06, 0x02, 0x01, 0x23, 0x02, 0x1, 0x03 }; - static const byte badIntN[] = { 0x30, 0x06, 0x02, 0x05, 0x23, 0x02, 0x1, + WOLFSSL_SMALL_STACK_STATIC const byte badIntN[] = { 0x30, 0x06, 0x02, 0x05, 0x23, 0x02, 0x1, 0x03 }; - static const byte badNotIntE[] = { 0x30, 0x06, 0x02, 0x01, 0x23, 0x04, 0x1, + WOLFSSL_SMALL_STACK_STATIC const byte badNotIntE[] = { 0x30, 0x06, 0x02, 0x01, 0x23, 0x04, 0x1, 0x03 }; - static const byte badLength[] = { 0x30, 0x04, 0x02, 0x01, 0x23, 0x02, 0x1, + WOLFSSL_SMALL_STACK_STATIC const byte badLength[] = { 0x30, 0x04, 0x02, 0x01, 0x23, 0x02, 0x1, 0x03 }; - static const byte badBitStrNoZero[] = { 0x30, 0x0e, 0x30, 0x0c, 0x06, 0x00, + WOLFSSL_SMALL_STACK_STATIC const byte badBitStrNoZero[] = { 0x30, 0x0e, 0x30, 0x0c, 0x06, 0x00, 0x03, 0x08, 0x30, 0x06, 0x02, 0x01, 0x23, 0x02, 0x1, 0x03 }; ret = wc_InitRsaKey(keyPub, NULL); @@ -14946,7 +14946,7 @@ static int rsa_test(void) } #ifdef WOLFSSL_EKU_OID { - static const char unique[] = "2.16.840.1.111111.100.1.10.1"; + WOLFSSL_SMALL_STACK_STATIC const char unique[] = "2.16.840.1.111111.100.1.10.1"; if (wc_SetExtKeyUsageOID(req, unique, sizeof(unique), 0, HEAP_HINT) != 0) { ERROR_OUT(-7969, exit_rsa); @@ -15385,17 +15385,17 @@ static int dh_test_check_pubvalue(void) { int ret; word32 i; - static const byte prime[] = {0x01, 0x00, 0x01}; - static const byte pubValZero[] = { 0x00 }; - static const byte pubValZeroLong[] = { 0x00, 0x00, 0x00 }; - static const byte pubValOne[] = { 0x01 }; - static const byte pubValOneLong[] = { 0x00, 0x00, 0x01 }; - static const byte pubValPrimeMinusOne[] = { 0x01, 0x00, 0x00 }; - static const byte pubValPrimeLong[] = {0x00, 0x01, 0x00, 0x01}; - static const byte pubValPrimePlusOne[] = { 0x01, 0x00, 0x02 }; - static const byte pubValTooBig0[] = { 0x02, 0x00, 0x01 }; - static const byte pubValTooBig1[] = { 0x01, 0x01, 0x01 }; - static const byte pubValTooLong[] = { 0x01, 0x00, 0x00, 0x01 }; + WOLFSSL_SMALL_STACK_STATIC const byte prime[] = {0x01, 0x00, 0x01}; + WOLFSSL_SMALL_STACK_STATIC const byte pubValZero[] = { 0x00 }; + WOLFSSL_SMALL_STACK_STATIC const byte pubValZeroLong[] = { 0x00, 0x00, 0x00 }; + WOLFSSL_SMALL_STACK_STATIC const byte pubValOne[] = { 0x01 }; + WOLFSSL_SMALL_STACK_STATIC const byte pubValOneLong[] = { 0x00, 0x00, 0x01 }; + WOLFSSL_SMALL_STACK_STATIC const byte pubValPrimeMinusOne[] = { 0x01, 0x00, 0x00 }; + WOLFSSL_SMALL_STACK_STATIC const byte pubValPrimeLong[] = {0x00, 0x01, 0x00, 0x01}; + WOLFSSL_SMALL_STACK_STATIC const byte pubValPrimePlusOne[] = { 0x01, 0x00, 0x02 }; + WOLFSSL_SMALL_STACK_STATIC const byte pubValTooBig0[] = { 0x02, 0x00, 0x01 }; + WOLFSSL_SMALL_STACK_STATIC const byte pubValTooBig1[] = { 0x01, 0x01, 0x01 }; + WOLFSSL_SMALL_STACK_STATIC const byte pubValTooLong[] = { 0x01, 0x00, 0x00, 0x01 }; const dh_pubvalue_test dh_pubval_fail[] = { { prime, sizeof(prime) }, { pubValZero, sizeof(pubValZero) }, @@ -15409,11 +15409,11 @@ static int dh_test_check_pubvalue(void) { pubValTooBig1, sizeof(pubValTooBig1) }, { pubValTooLong, sizeof(pubValTooLong) }, }; - static const byte pubValTwo[] = { 0x02 }; - static const byte pubValTwoLong[] = { 0x00, 0x00, 0x02 }; - static const byte pubValGood[] = { 0x12, 0x34 }; - static const byte pubValGoodLen[] = { 0x00, 0x12, 0x34 }; - static const byte pubValGoodLong[] = { 0x00, 0x00, 0x12, 0x34 }; + WOLFSSL_SMALL_STACK_STATIC const byte pubValTwo[] = { 0x02 }; + WOLFSSL_SMALL_STACK_STATIC const byte pubValTwoLong[] = { 0x00, 0x00, 0x02 }; + WOLFSSL_SMALL_STACK_STATIC const byte pubValGood[] = { 0x12, 0x34 }; + WOLFSSL_SMALL_STACK_STATIC const byte pubValGoodLen[] = { 0x00, 0x12, 0x34 }; + WOLFSSL_SMALL_STACK_STATIC const byte pubValGoodLong[] = { 0x00, 0x00, 0x12, 0x34 }; const dh_pubvalue_test dh_pubval_pass[] = { { pubValTwo, sizeof(pubValTwo) }, { pubValTwoLong, sizeof(pubValTwoLong) }, @@ -16150,7 +16150,7 @@ static int srp_test(void) byte password[] = "password"; word32 passwordSz = 8; - static const byte N[] = { + WOLFSSL_SMALL_STACK_STATIC const byte N[] = { 0xC9, 0x4D, 0x67, 0xEB, 0x5B, 0x1A, 0x23, 0x46, 0xE8, 0xAB, 0x42, 0x2F, 0xC6, 0xA0, 0xED, 0xAE, 0xDA, 0x8C, 0x7F, 0x89, 0x4C, 0x9E, 0xEE, 0xC4, 0x2F, 0x9E, 0xD2, 0x50, 0xFD, 0x7F, 0x00, 0x46, 0xE5, 0xAF, 0x2C, 0xF7, @@ -16160,7 +16160,7 @@ static int srp_test(void) 0x03, 0x44, 0x60, 0xFA, 0xA7, 0xAD, 0xF4, 0x83 }; - static const byte g[] = { + WOLFSSL_SMALL_STACK_STATIC const byte g[] = { 0x02 }; @@ -16272,7 +16272,7 @@ static int openssl_aes_test(void) #ifdef WOLFSSL_AES_128 { /* EVP_CipherUpdate test */ - static const byte cbcPlain[] = + WOLFSSL_SMALL_STACK_STATIC const byte cbcPlain[] = { 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a, @@ -16491,7 +16491,7 @@ static int openssl_aes_test(void) /* set buffers to be exact size to catch potential over read/write */ { /* EVP_CipherUpdate test */ - static const byte cbcPlain[] = + WOLFSSL_SMALL_STACK_STATIC const byte cbcPlain[] = { 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a, @@ -16598,13 +16598,13 @@ static int openssl_aes_test(void) { /* evp_cipher test: EVP_aes_128_cbc */ EVP_CIPHER_CTX ctx; - static const byte msg[] = { /* "Now is the time for all " w/o trailing 0 */ + WOLFSSL_SMALL_STACK_STATIC const byte msg[] = { /* "Now is the time for all " w/o trailing 0 */ 0x6e,0x6f,0x77,0x20,0x69,0x73,0x20,0x74, 0x68,0x65,0x20,0x74,0x69,0x6d,0x65,0x20, 0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20 }; - static const byte verify[] = + WOLFSSL_SMALL_STACK_STATIC const byte verify[] = { 0x95,0x94,0x92,0x57,0x5f,0x42,0x81,0x53, 0x2c,0xcc,0x9d,0x46,0x77,0xa2,0x33,0xcb @@ -16644,19 +16644,19 @@ static int openssl_aes_test(void) #if defined(HAVE_AES_ECB) && defined(WOLFSSL_AES_256) { /* evp_cipher test: EVP_aes_256_ecb*/ EVP_CIPHER_CTX ctx; - static const byte msg[] = + WOLFSSL_SMALL_STACK_STATIC const byte msg[] = { 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a }; - static const byte verify[] = + WOLFSSL_SMALL_STACK_STATIC const byte verify[] = { 0xf3,0xee,0xd1,0xbd,0xb5,0xd2,0xa0,0x3c, 0x06,0x4b,0x5a,0x7e,0x3d,0xb1,0x81,0xf8 }; - static const byte key[] = + WOLFSSL_SMALL_STACK_STATIC const byte key[] = { 0x60,0x3d,0xeb,0x10,0x15,0xca,0x71,0xbe, 0x2b,0x73,0xae,0xf0,0x85,0x7d,0x77,0x81, @@ -16700,19 +16700,19 @@ static int openssl_aes_test(void) AES_KEY dec; #endif - static const byte msg[] = + WOLFSSL_SMALL_STACK_STATIC const byte msg[] = { 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a }; - static const byte verify[] = + WOLFSSL_SMALL_STACK_STATIC const byte verify[] = { 0xf3,0xee,0xd1,0xbd,0xb5,0xd2,0xa0,0x3c, 0x06,0x4b,0x5a,0x7e,0x3d,0xb1,0x81,0xf8 }; - static const byte key[] = + WOLFSSL_SMALL_STACK_STATIC const byte key[] = { 0x60,0x3d,0xeb,0x10,0x15,0xca,0x71,0xbe, 0x2b,0x73,0xae,0xf0,0x85,0x7d,0x77,0x81, @@ -16746,20 +16746,20 @@ static int openssl_aes_test(void) byte cipherBuff[64]; #ifdef WOLFSSL_AES_128 - static const byte ctrKey[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctrKey[] = { 0x2b,0x7e,0x15,0x16,0x28,0xae,0xd2,0xa6, 0xab,0xf7,0x15,0x88,0x09,0xcf,0x4f,0x3c }; - static const byte ctrIv[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctrIv[] = { 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7, 0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff }; - static const byte ctrPlain[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctrPlain[] = { 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a, @@ -16771,7 +16771,7 @@ static int openssl_aes_test(void) 0xad,0x2b,0x41,0x7b,0xe6,0x6c,0x37,0x10 }; - static const byte ctrCipher[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctrCipher[] = { 0x87,0x4d,0x61,0x91,0xb6,0x20,0xe3,0x26, 0x1b,0xef,0x68,0x64,0x99,0x0d,0xb6,0xce, @@ -16783,7 +16783,7 @@ static int openssl_aes_test(void) 0x79,0x21,0x70,0xa0,0xf3,0x00,0x9c,0xee }; - static const byte oddCipher[] = + WOLFSSL_SMALL_STACK_STATIC const byte oddCipher[] = { 0xb9,0xd7,0xcb,0x08,0xb0,0xe1,0x7b,0xa0, 0xc2 @@ -16793,27 +16793,27 @@ static int openssl_aes_test(void) /* test vector from "Recommendation for Block Cipher Modes of Operation" * NIST Special Publication 800-38A */ #ifdef WOLFSSL_AES_192 - static const byte ctr192Key[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctr192Key[] = { 0x8e,0x73,0xb0,0xf7,0xda,0x0e,0x64,0x52, 0xc8,0x10,0xf3,0x2b,0x80,0x90,0x79,0xe5, 0x62,0xf8,0xea,0xd2,0x52,0x2c,0x6b,0x7b }; - static const byte ctr192Iv[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctr192Iv[] = { 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7, 0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff }; - static const byte ctr192Plain[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctr192Plain[] = { 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a }; - static const byte ctr192Cipher[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctr192Cipher[] = { 0x1a,0xbc,0x93,0x24,0x17,0x52,0x1c,0xa2, 0x4f,0x2b,0x04,0x59,0xfe,0x7e,0x6e,0x0b @@ -16823,7 +16823,7 @@ static int openssl_aes_test(void) #ifdef WOLFSSL_AES_256 /* test vector from "Recommendation for Block Cipher Modes of Operation" * NIST Special Publication 800-38A */ - static const byte ctr256Key[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctr256Key[] = { 0x60,0x3d,0xeb,0x10,0x15,0xca,0x71,0xbe, 0x2b,0x73,0xae,0xf0,0x85,0x7d,0x77,0x81, @@ -16831,20 +16831,20 @@ static int openssl_aes_test(void) 0x2d,0x98,0x10,0xa3,0x09,0x14,0xdf,0xf4 }; - static const byte ctr256Iv[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctr256Iv[] = { 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7, 0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff }; - static const byte ctr256Plain[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctr256Plain[] = { 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a }; - static const byte ctr256Cipher[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctr256Cipher[] = { 0x60,0x1e,0xc3,0x13,0x77,0x57,0x89,0xa5, 0xb7,0xa7,0xf5,0x04,0xbb,0xf3,0xd2,0x28 @@ -16993,18 +16993,18 @@ static int openssl_aes_test(void) AES_KEY enc; AES_KEY dec; - static const byte setIv[] = { + WOLFSSL_SMALL_STACK_STATIC const byte setIv[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, 0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f }; - static const byte key[] = + WOLFSSL_SMALL_STACK_STATIC const byte key[] = { 0x2b,0x7e,0x15,0x16,0x28,0xae,0xd2,0xa6, 0xab,0xf7,0x15,0x88,0x09,0xcf,0x4f,0x3c }; - static const byte cipher1[] = + WOLFSSL_SMALL_STACK_STATIC const byte cipher1[] = { 0x3b,0x3f,0xd9,0x2e,0xb7,0x2d,0xad,0x20, 0x33,0x34,0x49,0xf8,0xe8,0x3c,0xfb,0x4a, @@ -17012,7 +17012,7 @@ static int openssl_aes_test(void) 0xcd,0xe3,0xcd,0xad,0x9f,0x1c,0xe5,0x8b }; - static const byte msg[] = + WOLFSSL_SMALL_STACK_STATIC const byte msg[] = { 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a, @@ -17336,7 +17336,7 @@ static int openssl_test(void) #ifndef NO_DES3 { /* des test */ - static const byte vector[] = { /* "now is the time for all " w/o trailing 0 */ + WOLFSSL_SMALL_STACK_STATIC const byte vector[] = { /* "now is the time for all " w/o trailing 0 */ 0x6e,0x6f,0x77,0x20,0x69,0x73,0x20,0x74, 0x68,0x65,0x20,0x74,0x69,0x6d,0x65,0x20, 0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20 @@ -17350,7 +17350,7 @@ static int openssl_test(void) 0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef }; DES_key_schedule sched; - static const byte verify[] = { + WOLFSSL_SMALL_STACK_STATIC const byte verify[] = { 0x8b,0x7c,0x52,0xb0,0x01,0x2b,0x6c,0xb8, 0x4f,0x0f,0xeb,0xf3,0xfb,0x5f,0x86,0x73, 0x15,0x85,0xb3,0x22,0x4b,0x86,0x2b,0x4b @@ -17386,18 +17386,18 @@ static int openssl_test(void) { /* evp_cipher test: EVP_aes_128_cbc */ EVP_CIPHER_CTX ctx; int idx, cipherSz, plainSz; - static const byte msg[] = { /* "Now is the time for all " w/o trailing 0 */ + WOLFSSL_SMALL_STACK_STATIC const byte msg[] = { /* "Now is the time for all " w/o trailing 0 */ 0x6e,0x6f,0x77,0x20,0x69,0x73,0x20,0x74, 0x68,0x65,0x20,0x74,0x69,0x6d,0x65,0x20, 0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20 }; - static const byte verify[] = { + WOLFSSL_SMALL_STACK_STATIC const byte verify[] = { 0x95,0x94,0x92,0x57,0x5f,0x42,0x81,0x53, 0x2c,0xcc,0x9d,0x46,0x77,0xa2,0x33,0xcb, 0x3b,0x5d,0x41,0x97,0x94,0x25,0xa4,0xb4, 0xae,0x7b,0x34,0xd0,0x3f,0x0c,0xbc,0x06 }; - static const byte verify2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte verify2[] = { 0x95,0x94,0x92,0x57,0x5f,0x42,0x81,0x53, 0x2c,0xcc,0x9d,0x46,0x77,0xa2,0x33,0xcb, 0x7d,0x37,0x7b,0x0b,0x44,0xaa,0xb5,0xf0, @@ -17493,11 +17493,11 @@ static int openssl_test(void) #if defined(HAVE_AES_ECB) && defined(WOLFSSL_AES_256) { /* evp_cipher test: EVP_aes_256_ecb*/ EVP_CIPHER_CTX ctx; - static const byte msg[] = { + WOLFSSL_SMALL_STACK_STATIC const byte msg[] = { 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a }; - static const byte verify[] = { + WOLFSSL_SMALL_STACK_STATIC const byte verify[] = { 0xf3,0xee,0xd1,0xbd,0xb5,0xd2,0xa0,0x3c, 0x06,0x4b,0x5a,0x7e,0x3d,0xb1,0x81,0xf8 }; @@ -17545,19 +17545,19 @@ static int openssl_test(void) AES_KEY dec; #endif - static const byte msg[] = + WOLFSSL_SMALL_STACK_STATIC const byte msg[] = { 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a }; - static const byte verify[] = + WOLFSSL_SMALL_STACK_STATIC const byte verify[] = { 0xf3,0xee,0xd1,0xbd,0xb5,0xd2,0xa0,0x3c, 0x06,0x4b,0x5a,0x7e,0x3d,0xb1,0x81,0xf8 }; - static const byte key[] = + WOLFSSL_SMALL_STACK_STATIC const byte key[] = { 0x60,0x3d,0xeb,0x10,0x15,0xca,0x71,0xbe, 0x2b,0x73,0xae,0xf0,0x85,0x7d,0x77,0x81, @@ -17595,19 +17595,19 @@ static int openssl_test(void) byte cipherBuff[64]; #ifdef WOLFSSL_AES_128 - static const byte ctrKey[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctrKey[] = { 0x2b,0x7e,0x15,0x16,0x28,0xae,0xd2,0xa6, 0xab,0xf7,0x15,0x88,0x09,0xcf,0x4f,0x3c }; - static const byte ctrIv[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctrIv[] = { 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7, 0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff }; - static const byte ctrPlain[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctrPlain[] = { 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a, @@ -17619,7 +17619,7 @@ static int openssl_test(void) 0xad,0x2b,0x41,0x7b,0xe6,0x6c,0x37,0x10 }; - static const byte ctrCipher[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctrCipher[] = { 0x87,0x4d,0x61,0x91,0xb6,0x20,0xe3,0x26, 0x1b,0xef,0x68,0x64,0x99,0x0d,0xb6,0xce, @@ -17631,7 +17631,7 @@ static int openssl_test(void) 0x79,0x21,0x70,0xa0,0xf3,0x00,0x9c,0xee }; - static const byte oddCipher[] = + WOLFSSL_SMALL_STACK_STATIC const byte oddCipher[] = { 0xb9,0xd7,0xcb,0x08,0xb0,0xe1,0x7b,0xa0, 0xc2 @@ -17641,27 +17641,27 @@ static int openssl_test(void) #ifdef WOLFSSL_AES_192 /* test vector from "Recommendation for Block Cipher Modes of Operation" * NIST Special Publication 800-38A */ - static const byte ctr192Key[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctr192Key[] = { 0x8e,0x73,0xb0,0xf7,0xda,0x0e,0x64,0x52, 0xc8,0x10,0xf3,0x2b,0x80,0x90,0x79,0xe5, 0x62,0xf8,0xea,0xd2,0x52,0x2c,0x6b,0x7b }; - static const byte ctr192Iv[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctr192Iv[] = { 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7, 0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff }; - static const byte ctr192Plain[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctr192Plain[] = { 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a }; - static const byte ctr192Cipher[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctr192Cipher[] = { 0x1a,0xbc,0x93,0x24,0x17,0x52,0x1c,0xa2, 0x4f,0x2b,0x04,0x59,0xfe,0x7e,0x6e,0x0b @@ -17671,7 +17671,7 @@ static int openssl_test(void) #ifdef WOLFSSL_AES_256 /* test vector from "Recommendation for Block Cipher Modes of Operation" * NIST Special Publication 800-38A */ - static const byte ctr256Key[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctr256Key[] = { 0x60,0x3d,0xeb,0x10,0x15,0xca,0x71,0xbe, 0x2b,0x73,0xae,0xf0,0x85,0x7d,0x77,0x81, @@ -17679,20 +17679,20 @@ static int openssl_test(void) 0x2d,0x98,0x10,0xa3,0x09,0x14,0xdf,0xf4 }; - static const byte ctr256Iv[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctr256Iv[] = { 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7, 0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff }; - static const byte ctr256Plain[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctr256Plain[] = { 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a }; - static const byte ctr256Cipher[] = + WOLFSSL_SMALL_STACK_STATIC const byte ctr256Cipher[] = { 0x60,0x1e,0xc3,0x13,0x77,0x57,0x89,0xa5, 0xb7,0xa7,0xf5,0x04,0xbb,0xf3,0xd2,0x28 @@ -17839,7 +17839,7 @@ static int openssl_test(void) /* EVP_CipherUpdate test */ - static const byte cbcPlain[] = + WOLFSSL_SMALL_STACK_STATIC const byte cbcPlain[] = { 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a, @@ -18395,7 +18395,7 @@ static int openssl_pkey1_test(void) EVP_PKEY* prvKey = NULL; X509* x509 = NULL; - static const unsigned char msg[] = "sugar slapped"; + WOLFSSL_SMALL_STACK_STATIC const unsigned char msg[] = "sugar slapped"; const unsigned char* clikey; long cliKeySz; size_t outlen; @@ -18777,7 +18777,7 @@ static int scrypt_test(void) int ret; byte derived[64]; - static const byte verify1[] = { + WOLFSSL_SMALL_STACK_STATIC const byte verify1[] = { 0x77, 0xd6, 0x57, 0x62, 0x38, 0x65, 0x7b, 0x20, 0x3b, 0x19, 0xca, 0x42, 0xc1, 0x8a, 0x04, 0x97, 0xf1, 0x6b, 0x48, 0x44, 0xe3, 0x07, 0x4a, 0xe8, @@ -18787,7 +18787,7 @@ static int scrypt_test(void) 0xe8, 0xd3, 0xe0, 0xfb, 0x2e, 0x0d, 0x36, 0x28, 0xcf, 0x35, 0xe2, 0x0c, 0x38, 0xd1, 0x89, 0x06 }; - static const byte verify2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte verify2[] = { 0xfd, 0xba, 0xbe, 0x1c, 0x9d, 0x34, 0x72, 0x00, 0x78, 0x56, 0xe7, 0x19, 0x0d, 0x01, 0xe9, 0xfe, 0x7c, 0x6a, 0xd7, 0xcb, 0xc8, 0x23, 0x78, 0x30, @@ -18798,7 +18798,7 @@ static int scrypt_test(void) 0x83, 0x60, 0xcb, 0xdf, 0xa2, 0xcc, 0x06, 0x40 }; #if !defined(BENCH_EMBEDDED) && !defined(WOLFSSL_LINUXKM) && !defined(HAVE_INTEL_QA) - static const byte verify3[] = { + WOLFSSL_SMALL_STACK_STATIC const byte verify3[] = { 0x70, 0x23, 0xbd, 0xcb, 0x3a, 0xfd, 0x73, 0x48, 0x46, 0x1c, 0x06, 0xcd, 0x81, 0xfd, 0x38, 0xeb, 0xfd, 0xa8, 0xfb, 0xba, 0x90, 0x4f, 0x8e, 0x3e, @@ -18813,7 +18813,7 @@ static int scrypt_test(void) /* Test case is very slow. * Use for confirmation after code change or new platform. */ - static const byte verify4[] = { + WOLFSSL_SMALL_STACK_STATIC const byte verify4[] = { 0x21, 0x01, 0xcb, 0x9b, 0x6a, 0x51, 0x1a, 0xae, 0xad, 0xdb, 0xbe, 0x09, 0xcf, 0x70, 0xf8, 0x81, 0xec, 0x56, 0x8d, 0x57, 0x4a, 0x2f, 0xfd, 0x4d, @@ -18873,22 +18873,22 @@ static int scrypt_test(void) #ifdef HAVE_PKCS12 static int pkcs12_test(void) { - static const byte passwd[] = { 0x00, 0x73, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x67, + WOLFSSL_SMALL_STACK_STATIC const byte passwd[] = { 0x00, 0x73, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x67, 0x00, 0x00 }; - static const byte salt[] = { 0x0a, 0x58, 0xCF, 0x64, 0x53, 0x0d, 0x82, 0x3f }; + WOLFSSL_SMALL_STACK_STATIC const byte salt[] = { 0x0a, 0x58, 0xCF, 0x64, 0x53, 0x0d, 0x82, 0x3f }; - static const byte passwd2[] = { 0x00, 0x71, 0x00, 0x75, 0x00, 0x65, 0x00, 0x65, + WOLFSSL_SMALL_STACK_STATIC const byte passwd2[] = { 0x00, 0x71, 0x00, 0x75, 0x00, 0x65, 0x00, 0x65, 0x00, 0x67, 0x00, 0x00 }; - static const byte salt2[] = { 0x16, 0x82, 0xC0, 0xfC, 0x5b, 0x3f, 0x7e, 0xc5 }; + WOLFSSL_SMALL_STACK_STATIC const byte salt2[] = { 0x16, 0x82, 0xC0, 0xfC, 0x5b, 0x3f, 0x7e, 0xc5 }; byte derived[64]; - static const byte verify[] = { + WOLFSSL_SMALL_STACK_STATIC const byte verify[] = { 0x27, 0xE9, 0x0D, 0x7E, 0xD5, 0xA1, 0xC4, 0x11, 0xBA, 0x87, 0x8B, 0xC0, 0x90, 0xF5, 0xCE, 0xBE, 0x5E, 0x9D, 0x5F, 0xE3, 0xD6, 0x2B, 0x73, 0xAA }; - static const byte verify2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte verify2[] = { 0x90, 0x1B, 0x49, 0x70, 0xF0, 0x94, 0xF0, 0xF8, 0x45, 0xC0, 0xF3, 0xF3, 0x13, 0x59, 0x18, 0x6A, 0x35, 0xE3, 0x67, 0xFE, 0xD3, 0x21, 0xFD, 0x7C @@ -18928,12 +18928,12 @@ static int pkcs12_test(void) static int pbkdf2_test(void) { char passwd[] = "passwordpassword"; - static const byte salt[] = { 0x78, 0x57, 0x8E, 0x5a, 0x5d, 0x63, 0xcb, 0x06 }; + WOLFSSL_SMALL_STACK_STATIC const byte salt[] = { 0x78, 0x57, 0x8E, 0x5a, 0x5d, 0x63, 0xcb, 0x06 }; int iterations = 2048; int kLen = 24; byte derived[64]; - static const byte verify[] = { + WOLFSSL_SMALL_STACK_STATIC const byte verify[] = { 0x43, 0x6d, 0xb5, 0xe8, 0xd0, 0xfb, 0x3f, 0x35, 0x42, 0x48, 0x39, 0xbc, 0x2d, 0xd4, 0xf9, 0x37, 0xd4, 0x95, 0x16, 0xa7, 0x2a, 0x9a, 0x21, 0xd1 }; @@ -18955,12 +18955,12 @@ static int pbkdf2_test(void) static int pbkdf1_test(void) { char passwd[] = "password"; - static const byte salt[] = { 0x78, 0x57, 0x8E, 0x5a, 0x5d, 0x63, 0xcb, 0x06 }; + WOLFSSL_SMALL_STACK_STATIC const byte salt[] = { 0x78, 0x57, 0x8E, 0x5a, 0x5d, 0x63, 0xcb, 0x06 }; int iterations = 1000; int kLen = 16; byte derived[16]; - static const byte verify[] = { + WOLFSSL_SMALL_STACK_STATIC const byte verify[] = { 0xDC, 0x19, 0x84, 0x7E, 0x05, 0xC6, 0x4D, 0x2F, 0xAF, 0x10, 0xEB, 0xFB, 0x4A, 0x3D, 0x2A, 0x20 }; @@ -19110,13 +19110,13 @@ static int x963kdf_test(void) * SharedInfo length: 0 * key data length: 128 */ - static const byte Z[] = { + WOLFSSL_SMALL_STACK_STATIC const byte Z[] = { 0x1c, 0x7d, 0x7b, 0x5f, 0x05, 0x97, 0xb0, 0x3d, 0x06, 0xa0, 0x18, 0x46, 0x6e, 0xd1, 0xa9, 0x3e, 0x30, 0xed, 0x4b, 0x04, 0xdc, 0x64, 0xcc, 0xdd }; - static const byte verify[] = { + WOLFSSL_SMALL_STACK_STATIC const byte verify[] = { 0xbf, 0x71, 0xdf, 0xfd, 0x8f, 0x4d, 0x99, 0x22, 0x39, 0x36, 0xbe, 0xb4, 0x6f, 0xee, 0x8c, 0xcc }; @@ -19128,13 +19128,13 @@ static int x963kdf_test(void) * SharedInfo length: 0 * key data length: 128 */ - static const byte Z2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte Z2[] = { 0xd3, 0x8b, 0xdb, 0xe5, 0xc4, 0xfc, 0x16, 0x4c, 0xdd, 0x96, 0x7f, 0x63, 0xc0, 0x4f, 0xe0, 0x7b, 0x60, 0xcd, 0xe8, 0x81, 0xc2, 0x46, 0x43, 0x8c }; - static const byte verify2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte verify2[] = { 0x5e, 0x67, 0x4d, 0xb9, 0x71, 0xba, 0xc2, 0x0a, 0x80, 0xba, 0xd0, 0xd4, 0x51, 0x4d, 0xc4, 0x84 }; @@ -19146,13 +19146,13 @@ static int x963kdf_test(void) * SharedInfo length: 0 * key data length: 128 */ - static const byte Z3[] = { + WOLFSSL_SMALL_STACK_STATIC const byte Z3[] = { 0x87, 0xfc, 0x0d, 0x8c, 0x44, 0x77, 0x48, 0x5b, 0xb5, 0x74, 0xf5, 0xfc, 0xea, 0x26, 0x4b, 0x30, 0x88, 0x5d, 0xc8, 0xd9, 0x0a, 0xd8, 0x27, 0x82 }; - static const byte verify3[] = { + WOLFSSL_SMALL_STACK_STATIC const byte verify3[] = { 0x94, 0x76, 0x65, 0xfb, 0xb9, 0x15, 0x21, 0x53, 0xef, 0x46, 0x02, 0x38, 0x50, 0x6a, 0x02, 0x45 }; @@ -19162,7 +19162,7 @@ static int x963kdf_test(void) * SharedInfo length: 128 * key data length: 1024 */ - static const byte Z4[] = { + WOLFSSL_SMALL_STACK_STATIC const byte Z4[] = { 0x00, 0xaa, 0x5b, 0xb7, 0x9b, 0x33, 0xe3, 0x89, 0xfa, 0x58, 0xce, 0xad, 0xc0, 0x47, 0x19, 0x7f, 0x14, 0xe7, 0x37, 0x12, 0xf4, 0x52, 0xca, 0xa9, @@ -19174,12 +19174,12 @@ static int x963kdf_test(void) 0x5a, 0x2d }; - static const byte info4[] = { + WOLFSSL_SMALL_STACK_STATIC const byte info4[] = { 0xe3, 0xb5, 0xb4, 0xc1, 0xb0, 0xd5, 0xcf, 0x1d, 0x2b, 0x3a, 0x2f, 0x99, 0x37, 0x89, 0x5d, 0x31 }; - static const byte verify4[] = { + WOLFSSL_SMALL_STACK_STATIC const byte verify4[] = { 0x44, 0x63, 0xf8, 0x69, 0xf3, 0xcc, 0x18, 0x76, 0x9b, 0x52, 0x26, 0x4b, 0x01, 0x12, 0xb5, 0x85, 0x8f, 0x7a, 0xd3, 0x2a, 0x5a, 0x2d, 0x96, 0xd8, @@ -19735,12 +19735,12 @@ static int ecc_test_cdh_vectors(WC_RNG* rng) byte sharedA[32] = {0}, sharedB[32] = {0}; word32 x, z; - static const char* QCAVSx = "700c48f77f56584c5cc632ca65640db91b6bacce3a4df6b42ce7cc838833d287"; - static const char* QCAVSy = "db71e509e3fd9b060ddb20ba5c51dcc5948d46fbf640dfe0441782cab85fa4ac"; - static const char* dIUT = "7d7dc5f71eb29ddaf80d6214632eeae03d9058af1fb6d22ed80badb62bc1a534"; - static const char* QIUTx = "ead218590119e8876b29146ff89ca61770c4edbbf97d38ce385ed281d8a6b230"; - static const char* QIUTy = "28af61281fd35e2fa7002523acc85a429cb06ee6648325389f59edfce1405141"; - static const char* ZIUT = "46fc62106420ff012e54a434fbdd2d25ccc5852060561e68040dd7778997bd7b"; + WOLFSSL_SMALL_STACK_STATIC const char* QCAVSx = "700c48f77f56584c5cc632ca65640db91b6bacce3a4df6b42ce7cc838833d287"; + WOLFSSL_SMALL_STACK_STATIC const char* QCAVSy = "db71e509e3fd9b060ddb20ba5c51dcc5948d46fbf640dfe0441782cab85fa4ac"; + WOLFSSL_SMALL_STACK_STATIC const char* dIUT = "7d7dc5f71eb29ddaf80d6214632eeae03d9058af1fb6d22ed80badb62bc1a534"; + WOLFSSL_SMALL_STACK_STATIC const char* QIUTx = "ead218590119e8876b29146ff89ca61770c4edbbf97d38ce385ed281d8a6b230"; + WOLFSSL_SMALL_STACK_STATIC const char* QIUTy = "28af61281fd35e2fa7002523acc85a429cb06ee6648325389f59edfce1405141"; + WOLFSSL_SMALL_STACK_STATIC const char* ZIUT = "46fc62106420ff012e54a434fbdd2d25ccc5852060561e68040dd7778997bd7b"; #ifdef WOLFSSL_SMALL_STACK if ((pub_key == NULL) || @@ -20999,7 +20999,7 @@ static int ecc_sig_test(WC_RNG* rng, ecc_key* key) int size; byte out[ECC_MAX_SIG_SIZE]; byte in[] = "Everyone gets Friday off."; - static const byte hash[] = { + WOLFSSL_SMALL_STACK_STATIC const byte hash[] = { 0xf2, 0x02, 0x95, 0x65, 0xcb, 0xf6, 0x2a, 0x59, 0x39, 0x2c, 0x05, 0xff, 0x0e, 0x29, 0xaf, 0xfe, 0x47, 0x33, 0x8c, 0x99, 0x8d, 0x58, 0x64, 0x83, @@ -21379,7 +21379,7 @@ static int ecc_decode_test(void) /* SECP256R1 OID: 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07 */ /* This is ecc_clikeypub_der_256. */ - static const byte good[] = { + WOLFSSL_SMALL_STACK_STATIC const byte good[] = { 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x55, 0xbf, 0xf4, @@ -21390,24 +21390,24 @@ static int ecc_decode_test(void) 0x95, 0x06, 0xcc, 0x01, 0xa9, 0xbd, 0xf6, 0x75, 0x1a, 0x42, 0xf7, 0xbd, 0xa9, 0xb2, 0x36, 0x22, 0x5f, 0xc7, 0x5d, 0x7f, 0xb4 }; - static const byte badNoObjId[] = { 0x30, 0x08, 0x30, 0x06, 0x03, 0x04, + WOLFSSL_SMALL_STACK_STATIC const byte badNoObjId[] = { 0x30, 0x08, 0x30, 0x06, 0x03, 0x04, 0x00, 0x04, 0x01, 0x01 }; - static const byte badOneObjId[] = { 0x30, 0x0a, 0x30, 0x08, 0x06, 0x00, + WOLFSSL_SMALL_STACK_STATIC const byte badOneObjId[] = { 0x30, 0x0a, 0x30, 0x08, 0x06, 0x00, 0x03, 0x04, 0x00, 0x04, 0x01, 0x01 }; - static const byte badObjId1Len[] = { 0x30, 0x0c, 0x30, 0x0a, 0x06, 0x09, + WOLFSSL_SMALL_STACK_STATIC const byte badObjId1Len[] = { 0x30, 0x0c, 0x30, 0x0a, 0x06, 0x09, 0x06, 0x00, 0x03, 0x04, 0x00, 0x04, 0x01, 0x01 }; - static const byte badObj2d1Len[] = { 0x30, 0x0c, 0x30, 0x0a, 0x06, 0x00, + WOLFSSL_SMALL_STACK_STATIC const byte badObj2d1Len[] = { 0x30, 0x0c, 0x30, 0x0a, 0x06, 0x00, 0x06, 0x07, 0x03, 0x04, 0x00, 0x04, 0x01, 0x01 }; - static const byte badNotBitStr[] = { 0x30, 0x14, 0x30, 0x0b, 0x06, 0x00, + WOLFSSL_SMALL_STACK_STATIC const byte badNotBitStr[] = { 0x30, 0x14, 0x30, 0x0b, 0x06, 0x00, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x04, 0x04, 0x00, 0x04, 0x01, 0x01 }; - static const byte badBitStrLen[] = { 0x30, 0x14, 0x30, 0x0b, 0x06, 0x00, + WOLFSSL_SMALL_STACK_STATIC const byte badBitStrLen[] = { 0x30, 0x14, 0x30, 0x0b, 0x06, 0x00, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x05, 0x00, 0x04, 0x01, 0x01 }; - static const byte badNoBitStrZero[] = { 0x30, 0x13, 0x30, 0x0a, 0x06, 0x00, + WOLFSSL_SMALL_STACK_STATIC const byte badNoBitStrZero[] = { 0x30, 0x13, 0x30, 0x0a, 0x06, 0x00, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x03, 0x04, 0x01, 0x01 }; - static const byte badPoint[] = { 0x30, 0x12, 0x30, 0x09, 0x06, 0x00, + WOLFSSL_SMALL_STACK_STATIC const byte badPoint[] = { 0x30, 0x12, 0x30, 0x09, 0x06, 0x00, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x03, 0x00, 0x04, 0x01 }; @@ -21584,7 +21584,7 @@ static int ecc_test_custom_curves(WC_RNG* rng) /* test use of custom curve - using BRAINPOOLP256R1 for test */ #ifndef WOLFSSL_ECC_CURVE_STATIC - static const ecc_oid_t ecc_oid_brainpoolp256r1[] = { + WOLFSSL_SMALL_STACK_STATIC const ecc_oid_t ecc_oid_brainpoolp256r1[] = { 0x2B,0x24,0x03,0x03,0x02,0x08,0x01,0x01,0x07 }; #define ecc_oid_brainpoolp256r1_sz \ @@ -21597,7 +21597,7 @@ static int ecc_test_custom_curves(WC_RNG* rng) #endif #define ecc_oid_brainpoolp256r1_sum 104 - static const ecc_set_type ecc_dp_brainpool256r1 = { + WOLFSSL_SMALL_STACK_STATIC const ecc_set_type ecc_dp_brainpool256r1 = { 32, /* size/bytes */ ECC_CURVE_CUSTOM, /* ID */ "BRAINPOOLP256R1", /* curve name */ @@ -23528,21 +23528,21 @@ static int ed25519ctx_test(void) #endif /* HAVE_ED25519_VERIFY */ ed25519_key key; - static const byte sKeyCtx[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sKeyCtx[] = { 0x03,0x05,0x33,0x4e,0x38,0x1a,0xf7,0x8f, 0x14,0x1c,0xb6,0x66,0xf6,0x19,0x9f,0x57, 0xbc,0x34,0x95,0x33,0x5a,0x25,0x6a,0x95, 0xbd,0x2a,0x55,0xbf,0x54,0x66,0x63,0xf6 }; - static const byte pKeyCtx[] = { + WOLFSSL_SMALL_STACK_STATIC const byte pKeyCtx[] = { 0xdf,0xc9,0x42,0x5e,0x4f,0x96,0x8f,0x7f, 0x0c,0x29,0xf0,0x25,0x9c,0xf5,0xf9,0xae, 0xd6,0x85,0x1c,0x2b,0xb4,0xad,0x8b,0xfb, 0x86,0x0c,0xfe,0xe0,0xab,0x24,0x82,0x92 }; - static const byte sigCtx1[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sigCtx1[] = { 0x55,0xa4,0xcc,0x2f,0x70,0xa5,0x4e,0x04, 0x28,0x8c,0x5f,0x4c,0xd1,0xe4,0x5a,0x7b, 0xb5,0x20,0xb3,0x62,0x92,0x91,0x18,0x76, @@ -23553,7 +23553,7 @@ static int ed25519ctx_test(void) 0x1f,0x4b,0x88,0x8e,0x4e,0x7e,0xdb,0x0d }; - static const byte sigCtx2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sigCtx2[] = { 0xcc,0x5e,0x63,0xa2,0x7e,0x94,0xaf,0xd3, 0x41,0x83,0x38,0xd2,0x48,0x6f,0xa9,0x2a, 0xf9,0x91,0x7c,0x2d,0x98,0x9e,0x06,0xe5, @@ -23564,12 +23564,12 @@ static int ed25519ctx_test(void) 0x4e,0x39,0x50,0xfb,0x1c,0xcd,0x8d,0x0d }; - static const byte msgCtx[] = { + WOLFSSL_SMALL_STACK_STATIC const byte msgCtx[] = { 0xf7,0x26,0x93,0x6d,0x19,0xc8,0x00,0x49, 0x4e,0x3f,0xda,0xff,0x20,0xb2,0x76,0xa8 }; - static const byte contextCtx[] = { + WOLFSSL_SMALL_STACK_STATIC const byte contextCtx[] = { 0x66,0x6f,0x6f }; @@ -23623,21 +23623,21 @@ static int ed25519ph_test(void) #endif /* HAVE_ED25519_VERIFY */ ed25519_key key; - static const byte sKeyPh[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sKeyPh[] = { 0x83,0x3f,0xe6,0x24,0x09,0x23,0x7b,0x9d, 0x62,0xec,0x77,0x58,0x75,0x20,0x91,0x1e, 0x9a,0x75,0x9c,0xec,0x1d,0x19,0x75,0x5b, 0x7d,0xa9,0x01,0xb9,0x6d,0xca,0x3d,0x42 }; - static const byte pKeyPh[] = { + WOLFSSL_SMALL_STACK_STATIC const byte pKeyPh[] = { 0xec,0x17,0x2b,0x93,0xad,0x5e,0x56,0x3b, 0xf4,0x93,0x2c,0x70,0xe1,0x24,0x50,0x34, 0xc3,0x54,0x67,0xef,0x2e,0xfd,0x4d,0x64, 0xeb,0xf8,0x19,0x68,0x34,0x67,0xe2,0xbf }; - static const byte sigPh1[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sigPh1[] = { 0x98,0xa7,0x02,0x22,0xf0,0xb8,0x12,0x1a, 0xa9,0xd3,0x0f,0x81,0x3d,0x68,0x3f,0x80, 0x9e,0x46,0x2b,0x46,0x9c,0x7f,0xf8,0x76, @@ -23648,7 +23648,7 @@ static int ed25519ph_test(void) 0xaa,0xd1,0x1c,0x2a,0x26,0x08,0x34,0x06 }; - static const byte sigPh2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sigPh2[] = { 0xe0,0x39,0x70,0x2b,0x4c,0x25,0x95,0xa6, 0xa5,0x41,0xac,0x85,0x09,0x23,0x6e,0x29, 0x90,0x47,0x47,0x95,0x33,0x0c,0x9b,0x34, @@ -23659,12 +23659,12 @@ static int ed25519ph_test(void) 0x3f,0x73,0xe6,0xe3,0xba,0xa8,0x1c,0x0e }; - static const byte msgPh[] = { + WOLFSSL_SMALL_STACK_STATIC const byte msgPh[] = { 0x61,0x62,0x63 }; /* SHA-512 hash of msgPh */ - static const byte hashPh[] = { + WOLFSSL_SMALL_STACK_STATIC const byte hashPh[] = { 0xdd,0xaf,0x35,0xa1,0x93,0x61,0x7a,0xba, 0xcc,0x41,0x73,0x49,0xae,0x20,0x41,0x31, 0x12,0xe6,0xfa,0x4e,0x89,0xa9,0x7e,0xa2, @@ -23675,7 +23675,7 @@ static int ed25519ph_test(void) 0x2a,0x9a,0xc9,0x4f,0xa5,0x4c,0xa4,0x9f }; - static const byte contextPh2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte contextPh2[] = { 0x66,0x6f,0x6f }; @@ -23786,21 +23786,21 @@ static int ed25519_test(void) https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-02 */ - static const byte sKey1[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sKey1[] = { 0x9d,0x61,0xb1,0x9d,0xef,0xfd,0x5a,0x60, 0xba,0x84,0x4a,0xf4,0x92,0xec,0x2c,0xc4, 0x44,0x49,0xc5,0x69,0x7b,0x32,0x69,0x19, 0x70,0x3b,0xac,0x03,0x1c,0xae,0x7f,0x60 }; - static const byte sKey2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sKey2[] = { 0x4c,0xcd,0x08,0x9b,0x28,0xff,0x96,0xda, 0x9d,0xb6,0xc3,0x46,0xec,0x11,0x4e,0x0f, 0x5b,0x8a,0x31,0x9f,0x35,0xab,0xa6,0x24, 0xda,0x8c,0xf6,0xed,0x4f,0xb8,0xa6,0xfb }; - static const byte sKey3[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sKey3[] = { 0xc5,0xaa,0x8d,0xf4,0x3f,0x9f,0x83,0x7b, 0xed,0xb7,0x44,0x2f,0x31,0xdc,0xb7,0xb1, 0x66,0xd3,0x85,0x35,0x07,0x6f,0x09,0x4b, @@ -23808,7 +23808,7 @@ static int ed25519_test(void) }; /* uncompressed test */ - static const byte sKey4[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sKey4[] = { 0x9d,0x61,0xb1,0x9d,0xef,0xfd,0x5a,0x60, 0xba,0x84,0x4a,0xf4,0x92,0xec,0x2c,0xc4, 0x44,0x49,0xc5,0x69,0x7b,0x32,0x69,0x19, @@ -23816,37 +23816,37 @@ static int ed25519_test(void) }; /* compressed prefix test */ - static const byte sKey5[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sKey5[] = { 0x9d,0x61,0xb1,0x9d,0xef,0xfd,0x5a,0x60, 0xba,0x84,0x4a,0xf4,0x92,0xec,0x2c,0xc4, 0x44,0x49,0xc5,0x69,0x7b,0x32,0x69,0x19, 0x70,0x3b,0xac,0x03,0x1c,0xae,0x7f,0x60 }; - static const byte sKey6[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sKey6[] = { 0xf5,0xe5,0x76,0x7c,0xf1,0x53,0x31,0x95, 0x17,0x63,0x0f,0x22,0x68,0x76,0xb8,0x6c, 0x81,0x60,0xcc,0x58,0x3b,0xc0,0x13,0x74, 0x4c,0x6b,0xf2,0x55,0xf5,0xcc,0x0e,0xe5 }; - static const byte* sKeys[] = {sKey1, sKey2, sKey3, sKey4, sKey5, sKey6}; + WOLFSSL_SMALL_STACK_STATIC const byte* sKeys[] = {sKey1, sKey2, sKey3, sKey4, sKey5, sKey6}; - static const byte pKey1[] = { + WOLFSSL_SMALL_STACK_STATIC const byte pKey1[] = { 0xd7,0x5a,0x98,0x01,0x82,0xb1,0x0a,0xb7, 0xd5,0x4b,0xfe,0xd3,0xc9,0x64,0x07,0x3a, 0x0e,0xe1,0x72,0xf3,0xda,0xa6,0x23,0x25, 0xaf,0x02,0x1a,0x68,0xf7,0x07,0x51,0x1a }; - static const byte pKey2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte pKey2[] = { 0x3d,0x40,0x17,0xc3,0xe8,0x43,0x89,0x5a, 0x92,0xb7,0x0a,0xa7,0x4d,0x1b,0x7e,0xbc, 0x9c,0x98,0x2c,0xcf,0x2e,0xc4,0x96,0x8c, 0xc0,0xcd,0x55,0xf1,0x2a,0xf4,0x66,0x0c }; - static const byte pKey3[] = { + WOLFSSL_SMALL_STACK_STATIC const byte pKey3[] = { 0xfc,0x51,0xcd,0x8e,0x62,0x18,0xa1,0xa3, 0x8d,0xa4,0x7e,0xd0,0x02,0x30,0xf0,0x58, 0x08,0x16,0xed,0x13,0xba,0x33,0x03,0xac, @@ -23854,7 +23854,7 @@ static int ed25519_test(void) }; /* uncompressed test */ - static const byte pKey4[] = { + WOLFSSL_SMALL_STACK_STATIC const byte pKey4[] = { 0x04,0x55,0xd0,0xe0,0x9a,0x2b,0x9d,0x34, 0x29,0x22,0x97,0xe0,0x8d,0x60,0xd0,0xf6, 0x20,0xc5,0x13,0xd4,0x72,0x53,0x18,0x7c, @@ -23867,25 +23867,25 @@ static int ed25519_test(void) }; /* compressed prefix */ - static const byte pKey5[] = { + WOLFSSL_SMALL_STACK_STATIC const byte pKey5[] = { 0x40,0xd7,0x5a,0x98,0x01,0x82,0xb1,0x0a,0xb7, 0xd5,0x4b,0xfe,0xd3,0xc9,0x64,0x07,0x3a, 0x0e,0xe1,0x72,0xf3,0xda,0xa6,0x23,0x25, 0xaf,0x02,0x1a,0x68,0xf7,0x07,0x51,0x1a }; - static const byte pKey6[] = { + WOLFSSL_SMALL_STACK_STATIC const byte pKey6[] = { 0x27,0x81,0x17,0xfc,0x14,0x4c,0x72,0x34, 0x0f,0x67,0xd0,0xf2,0x31,0x6e,0x83,0x86, 0xce,0xff,0xbf,0x2b,0x24,0x28,0xc9,0xc5, 0x1f,0xef,0x7c,0x59,0x7f,0x1d,0x42,0x6e }; - static const byte* pKeys[] = {pKey1, pKey2, pKey3, pKey4, pKey5, pKey6}; - static const byte pKeySz[] = {sizeof(pKey1), sizeof(pKey2), sizeof(pKey3), + WOLFSSL_SMALL_STACK_STATIC const byte* pKeys[] = {pKey1, pKey2, pKey3, pKey4, pKey5, pKey6}; + WOLFSSL_SMALL_STACK_STATIC const byte pKeySz[] = {sizeof(pKey1), sizeof(pKey2), sizeof(pKey3), sizeof(pKey4), sizeof(pKey5), sizeof(pKey6)}; - static const byte sig1[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sig1[] = { 0xe5,0x56,0x43,0x00,0xc3,0x60,0xac,0x72, 0x90,0x86,0xe2,0xcc,0x80,0x6e,0x82,0x8a, 0x84,0x87,0x7f,0x1e,0xb8,0xe5,0xd9,0x74, @@ -23896,7 +23896,7 @@ static int ed25519_test(void) 0x65,0x51,0x41,0x43,0x8e,0x7a,0x10,0x0b }; - static const byte sig2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sig2[] = { 0x92,0xa0,0x09,0xa9,0xf0,0xd4,0xca,0xb8, 0x72,0x0e,0x82,0x0b,0x5f,0x64,0x25,0x40, 0xa2,0xb2,0x7b,0x54,0x16,0x50,0x3f,0x8f, @@ -23907,7 +23907,7 @@ static int ed25519_test(void) 0xb0,0x0d,0x29,0x16,0x12,0xbb,0x0c,0x00 }; - static const byte sig3[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sig3[] = { 0x62,0x91,0xd6,0x57,0xde,0xec,0x24,0x02, 0x48,0x27,0xe6,0x9c,0x3a,0xbe,0x01,0xa3, 0x0c,0xe5,0x48,0xa2,0x84,0x74,0x3a,0x44, @@ -23919,7 +23919,7 @@ static int ed25519_test(void) }; /* uncompressed test */ - static const byte sig4[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sig4[] = { 0xe5,0x56,0x43,0x00,0xc3,0x60,0xac,0x72, 0x90,0x86,0xe2,0xcc,0x80,0x6e,0x82,0x8a, 0x84,0x87,0x7f,0x1e,0xb8,0xe5,0xd9,0x74, @@ -23931,7 +23931,7 @@ static int ed25519_test(void) }; /* compressed prefix */ - static const byte sig5[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sig5[] = { 0xe5,0x56,0x43,0x00,0xc3,0x60,0xac,0x72, 0x90,0x86,0xe2,0xcc,0x80,0x6e,0x82,0x8a, 0x84,0x87,0x7f,0x1e,0xb8,0xe5,0xd9,0x74, @@ -23942,7 +23942,7 @@ static int ed25519_test(void) 0x65,0x51,0x41,0x43,0x8e,0x7a,0x10,0x0b }; - static const byte sig6[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sig6[] = { 0x0a,0xab,0x4c,0x90,0x05,0x01,0xb3,0xe2, 0x4d,0x7c,0xdf,0x46,0x63,0x32,0x6a,0x3a, 0x87,0xdf,0x5e,0x48,0x43,0xb2,0xcb,0xdb, @@ -23953,14 +23953,14 @@ static int ed25519_test(void) 0xac,0x00,0xa9,0x70,0x4a,0x18,0x8a,0x03 }; - static const byte* sigs[] = {sig1, sig2, sig3, sig4, sig5, sig6}; + WOLFSSL_SMALL_STACK_STATIC const byte* sigs[] = {sig1, sig2, sig3, sig4, sig5, sig6}; - static const byte msg1[] = {0x0 }; - static const byte msg2[] = {0x72}; - static const byte msg3[] = {0xAF,0x82}; + WOLFSSL_SMALL_STACK_STATIC const byte msg1[] = {0x0 }; + WOLFSSL_SMALL_STACK_STATIC const byte msg2[] = {0x72}; + WOLFSSL_SMALL_STACK_STATIC const byte msg3[] = {0xAF,0x82}; /* test of a 1024 byte long message */ - static const byte msg4[] = { + WOLFSSL_SMALL_STACK_STATIC const byte msg4[] = { 0x08,0xb8,0xb2,0xb7,0x33,0x42,0x42,0x43, 0x76,0x0f,0xe4,0x26,0xa4,0xb5,0x49,0x08, 0x63,0x21,0x10,0xa6,0x6c,0x2f,0x65,0x91, @@ -24091,8 +24091,8 @@ static int ed25519_test(void) 0x40,0xb9,0x4c,0x00,0xa0,0xb9,0xd0 }; - static const byte* msgs[] = {msg1, msg2, msg3, msg1, msg1, msg4}; - static const word16 msgSz[] = {0 /*sizeof(msg1)*/, + WOLFSSL_SMALL_STACK_STATIC const byte* msgs[] = {msg1, msg2, msg3, msg1, msg1, msg4}; + WOLFSSL_SMALL_STACK_STATIC const word16 msgSz[] = {0 /*sizeof(msg1)*/, sizeof(msg2), sizeof(msg3), 0 /*sizeof(msg1)*/, @@ -24811,7 +24811,7 @@ static int ed448_ctx_test(void) #endif /* HAVE_ED448_VERIFY */ ed448_key key; - static const byte sKeyCtx[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sKeyCtx[] = { 0xc4, 0xea, 0xb0, 0x5d, 0x35, 0x70, 0x07, 0xc6, 0x32, 0xf3, 0xdb, 0xb4, 0x84, 0x89, 0x92, 0x4d, 0x55, 0x2b, 0x08, 0xfe, 0x0c, 0x35, 0x3a, 0x0d, @@ -24822,7 +24822,7 @@ static int ed448_ctx_test(void) 0x4e }; - static const byte pKeyCtx[] = { + WOLFSSL_SMALL_STACK_STATIC const byte pKeyCtx[] = { 0x43, 0xba, 0x28, 0xf4, 0x30, 0xcd, 0xff, 0x45, 0x6a, 0xe5, 0x31, 0x54, 0x5f, 0x7e, 0xcd, 0x0a, 0xc8, 0x34, 0xa5, 0x5d, 0x93, 0x58, 0xc0, 0x37, @@ -24833,7 +24833,7 @@ static int ed448_ctx_test(void) 0x80 }; - static const byte sigCtx[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sigCtx[] = { 0xd4, 0xf8, 0xf6, 0x13, 0x17, 0x70, 0xdd, 0x46, 0xf4, 0x08, 0x67, 0xd6, 0xfd, 0x5d, 0x50, 0x55, 0xde, 0x43, 0x54, 0x1f, 0x8c, 0x5e, 0x35, 0xab, @@ -24851,11 +24851,11 @@ static int ed448_ctx_test(void) 0x3c, 0x00 }; - static const byte msgCtx[] = { + WOLFSSL_SMALL_STACK_STATIC const byte msgCtx[] = { 0x03 }; - static const byte contextCtx[] = { + WOLFSSL_SMALL_STACK_STATIC const byte contextCtx[] = { 0x66,0x6f,0x6f }; @@ -24894,7 +24894,7 @@ static int ed448ph_test(void) #endif /* HAVE_ED448_VERIFY */ ed448_key key; - static const byte sKeyPh[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sKeyPh[] = { 0x83, 0x3f, 0xe6, 0x24, 0x09, 0x23, 0x7b, 0x9d, 0x62, 0xec, 0x77, 0x58, 0x75, 0x20, 0x91, 0x1e, 0x9a, 0x75, 0x9c, 0xec, 0x1d, 0x19, 0x75, 0x5b, @@ -24905,7 +24905,7 @@ static int ed448ph_test(void) 0x49 }; - static const byte pKeyPh[] = { + WOLFSSL_SMALL_STACK_STATIC const byte pKeyPh[] = { 0x25, 0x9b, 0x71, 0xc1, 0x9f, 0x83, 0xef, 0x77, 0xa7, 0xab, 0xd2, 0x65, 0x24, 0xcb, 0xdb, 0x31, 0x61, 0xb5, 0x90, 0xa4, 0x8f, 0x7d, 0x17, 0xde, @@ -24916,7 +24916,7 @@ static int ed448ph_test(void) 0x80 }; - static const byte sigPh1[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sigPh1[] = { 0x82, 0x2f, 0x69, 0x01, 0xf7, 0x48, 0x0f, 0x3d, 0x5f, 0x56, 0x2c, 0x59, 0x29, 0x94, 0xd9, 0x69, 0x36, 0x02, 0x87, 0x56, 0x14, 0x48, 0x32, 0x56, @@ -24934,7 +24934,7 @@ static int ed448ph_test(void) 0x0f, 0x00 }; - static const byte sigPh2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sigPh2[] = { 0xc3, 0x22, 0x99, 0xd4, 0x6e, 0xc8, 0xff, 0x02, 0xb5, 0x45, 0x40, 0x98, 0x28, 0x14, 0xdc, 0xe9, 0xa0, 0x58, 0x12, 0xf8, 0x19, 0x62, 0xb6, 0x49, @@ -24952,12 +24952,12 @@ static int ed448ph_test(void) 0x21, 0x00 }; - static const byte msgPh[] = { + WOLFSSL_SMALL_STACK_STATIC const byte msgPh[] = { 0x61,0x62,0x63 }; /* SHA-512 hash of msgPh */ - static const byte hashPh[] = { + WOLFSSL_SMALL_STACK_STATIC const byte hashPh[] = { 0x48, 0x33, 0x66, 0x60, 0x13, 0x60, 0xa8, 0x77, 0x1c, 0x68, 0x63, 0x08, 0x0c, 0xc4, 0x11, 0x4d, 0x8d, 0xb4, 0x45, 0x30, 0xf8, 0xf1, 0xe1, 0xee, @@ -24968,7 +24968,7 @@ static int ed448ph_test(void) 0xeb, 0x06, 0xbd, 0x88, 0x01, 0xe7, 0x51, 0xe4 }; - static const byte contextPh2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte contextPh2[] = { 0x66,0x6f,0x6f }; @@ -25077,7 +25077,7 @@ static int ed448_test(void) https://tools.ietf.org/html/rfc8032 */ - static const byte sKey1[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sKey1[] = { 0x6c, 0x82, 0xa5, 0x62, 0xcb, 0x80, 0x8d, 0x10, 0xd6, 0x32, 0xbe, 0x89, 0xc8, 0x51, 0x3e, 0xbf, 0x6c, 0x92, 0x9f, 0x34, 0xdd, 0xfa, 0x8c, 0x9f, @@ -25088,7 +25088,7 @@ static int ed448_test(void) 0x5b }; - static const byte sKey2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sKey2[] = { 0xc4, 0xea, 0xb0, 0x5d, 0x35, 0x70, 0x07, 0xc6, 0x32, 0xf3, 0xdb, 0xb4, 0x84, 0x89, 0x92, 0x4d, 0x55, 0x2b, 0x08, 0xfe, 0x0c, 0x35, 0x3a, 0x0d, @@ -25099,7 +25099,7 @@ static int ed448_test(void) 0x4e }; - static const byte sKey3[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sKey3[] = { 0x25, 0x8c, 0xdd, 0x4a, 0xda, 0x32, 0xed, 0x9c, 0x9f, 0xf5, 0x4e, 0x63, 0x75, 0x6a, 0xe5, 0x82, 0xfb, 0x8f, 0xab, 0x2a, 0xc7, 0x21, 0xf2, 0xc8, @@ -25111,7 +25111,7 @@ static int ed448_test(void) }; /* uncompressed test */ - static const byte sKey4[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sKey4[] = { 0x6c, 0x82, 0xa5, 0x62, 0xcb, 0x80, 0x8d, 0x10, 0xd6, 0x32, 0xbe, 0x89, 0xc8, 0x51, 0x3e, 0xbf, 0x6c, 0x92, 0x9f, 0x34, 0xdd, 0xfa, 0x8c, 0x9f, @@ -25123,7 +25123,7 @@ static int ed448_test(void) }; /* compressed prefix test */ - static const byte sKey5[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sKey5[] = { 0x6c, 0x82, 0xa5, 0x62, 0xcb, 0x80, 0x8d, 0x10, 0xd6, 0x32, 0xbe, 0x89, 0xc8, 0x51, 0x3e, 0xbf, 0x6c, 0x92, 0x9f, 0x34, 0xdd, 0xfa, 0x8c, 0x9f, @@ -25134,7 +25134,7 @@ static int ed448_test(void) 0x5b }; - static const byte sKey6[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sKey6[] = { 0x87, 0x2d, 0x09, 0x37, 0x80, 0xf5, 0xd3, 0x73, 0x0d, 0xf7, 0xc2, 0x12, 0x66, 0x4b, 0x37, 0xb8, 0xa0, 0xf2, 0x4f, 0x56, 0x81, 0x0d, 0xaa, 0x83, @@ -25145,9 +25145,9 @@ static int ed448_test(void) 0xe8 }; - static const byte* sKeys[] = {sKey1, sKey2, sKey3, sKey4, sKey5, sKey6}; + WOLFSSL_SMALL_STACK_STATIC const byte* sKeys[] = {sKey1, sKey2, sKey3, sKey4, sKey5, sKey6}; - static const byte pKey1[] = { + WOLFSSL_SMALL_STACK_STATIC const byte pKey1[] = { 0x5f, 0xd7, 0x44, 0x9b, 0x59, 0xb4, 0x61, 0xfd, 0x2c, 0xe7, 0x87, 0xec, 0x61, 0x6a, 0xd4, 0x6a, 0x1d, 0xa1, 0x34, 0x24, 0x85, 0xa7, 0x0e, 0x1f, @@ -25158,7 +25158,7 @@ static int ed448_test(void) 0x80 }; - static const byte pKey2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte pKey2[] = { 0x43, 0xba, 0x28, 0xf4, 0x30, 0xcd, 0xff, 0x45, 0x6a, 0xe5, 0x31, 0x54, 0x5f, 0x7e, 0xcd, 0x0a, 0xc8, 0x34, 0xa5, 0x5d, 0x93, 0x58, 0xc0, 0x37, @@ -25169,7 +25169,7 @@ static int ed448_test(void) 0x80 }; - static const byte pKey3[] = { + WOLFSSL_SMALL_STACK_STATIC const byte pKey3[] = { 0x3b, 0xa1, 0x6d, 0xa0, 0xc6, 0xf2, 0xcc, 0x1f, 0x30, 0x18, 0x77, 0x40, 0x75, 0x6f, 0x5e, 0x79, 0x8d, 0x6b, 0xc5, 0xfc, 0x01, 0x5d, 0x7c, 0x63, @@ -25181,7 +25181,7 @@ static int ed448_test(void) }; /* uncompressed test */ - static const byte pKey4[] = { + WOLFSSL_SMALL_STACK_STATIC const byte pKey4[] = { 0x5f, 0xd7, 0x44, 0x9b, 0x59, 0xb4, 0x61, 0xfd, 0x2c, 0xe7, 0x87, 0xec, 0x61, 0x6a, 0xd4, 0x6a, 0x1d, 0xa1, 0x34, 0x24, 0x85, 0xa7, 0x0e, 0x1f, @@ -25193,7 +25193,7 @@ static int ed448_test(void) }; /* compressed prefix */ - static const byte pKey5[] = { + WOLFSSL_SMALL_STACK_STATIC const byte pKey5[] = { 0x5f, 0xd7, 0x44, 0x9b, 0x59, 0xb4, 0x61, 0xfd, 0x2c, 0xe7, 0x87, 0xec, 0x61, 0x6a, 0xd4, 0x6a, 0x1d, 0xa1, 0x34, 0x24, 0x85, 0xa7, 0x0e, 0x1f, @@ -25204,7 +25204,7 @@ static int ed448_test(void) 0x80 }; - static const byte pKey6[] = { + WOLFSSL_SMALL_STACK_STATIC const byte pKey6[] = { 0xa8, 0x1b, 0x2e, 0x8a, 0x70, 0xa5, 0xac, 0x94, 0xff, 0xdb, 0xcc, 0x9b, 0xad, 0xfc, 0x3f, 0xeb, 0x08, 0x01, 0xf2, 0x58, 0x57, 0x8b, 0xb1, 0x14, @@ -25215,11 +25215,11 @@ static int ed448_test(void) 0x00 }; - static const byte* pKeys[] = {pKey1, pKey2, pKey3, pKey4, pKey5, pKey6}; - static const byte pKeySz[] = {sizeof(pKey1), sizeof(pKey2), sizeof(pKey3), + WOLFSSL_SMALL_STACK_STATIC const byte* pKeys[] = {pKey1, pKey2, pKey3, pKey4, pKey5, pKey6}; + WOLFSSL_SMALL_STACK_STATIC const byte pKeySz[] = {sizeof(pKey1), sizeof(pKey2), sizeof(pKey3), sizeof(pKey4), sizeof(pKey5), sizeof(pKey6)}; - static const byte sig1[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sig1[] = { 0x53, 0x3a, 0x37, 0xf6, 0xbb, 0xe4, 0x57, 0x25, 0x1f, 0x02, 0x3c, 0x0d, 0x88, 0xf9, 0x76, 0xae, 0x2d, 0xfb, 0x50, 0x4a, 0x84, 0x3e, 0x34, 0xd2, @@ -25237,7 +25237,7 @@ static int ed448_test(void) 0x26, 0x00 }; - static const byte sig2[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sig2[] = { 0x26, 0xb8, 0xf9, 0x17, 0x27, 0xbd, 0x62, 0x89, 0x7a, 0xf1, 0x5e, 0x41, 0xeb, 0x43, 0xc3, 0x77, 0xef, 0xb9, 0xc6, 0x10, 0xd4, 0x8f, 0x23, 0x35, @@ -25255,7 +25255,7 @@ static int ed448_test(void) 0x3a, 0x00 }; - static const byte sig3[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sig3[] = { 0x7e, 0xee, 0xab, 0x7c, 0x4e, 0x50, 0xfb, 0x79, 0x9b, 0x41, 0x8e, 0xe5, 0xe3, 0x19, 0x7f, 0xf6, 0xbf, 0x15, 0xd4, 0x3a, 0x14, 0xc3, 0x43, 0x89, @@ -25274,7 +25274,7 @@ static int ed448_test(void) }; /* uncompressed test */ - static const byte sig4[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sig4[] = { 0x53, 0x3a, 0x37, 0xf6, 0xbb, 0xe4, 0x57, 0x25, 0x1f, 0x02, 0x3c, 0x0d, 0x88, 0xf9, 0x76, 0xae, 0x2d, 0xfb, 0x50, 0x4a, 0x84, 0x3e, 0x34, 0xd2, @@ -25293,7 +25293,7 @@ static int ed448_test(void) }; /* compressed prefix */ - static const byte sig5[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sig5[] = { 0x53, 0x3a, 0x37, 0xf6, 0xbb, 0xe4, 0x57, 0x25, 0x1f, 0x02, 0x3c, 0x0d, 0x88, 0xf9, 0x76, 0xae, 0x2d, 0xfb, 0x50, 0x4a, 0x84, 0x3e, 0x34, 0xd2, @@ -25311,7 +25311,7 @@ static int ed448_test(void) 0x26, 0x00 }; - static const byte sig6[] = { + WOLFSSL_SMALL_STACK_STATIC const byte sig6[] = { 0xe3, 0x01, 0x34, 0x5a, 0x41, 0xa3, 0x9a, 0x4d, 0x72, 0xff, 0xf8, 0xdf, 0x69, 0xc9, 0x80, 0x75, 0xa0, 0xcc, 0x08, 0x2b, 0x80, 0x2f, 0xc9, 0xb2, @@ -25329,16 +25329,16 @@ static int ed448_test(void) 0x1a, 0x00 }; - static const byte* sigs[] = {sig1, sig2, sig3, sig4, sig5, sig6}; + WOLFSSL_SMALL_STACK_STATIC const byte* sigs[] = {sig1, sig2, sig3, sig4, sig5, sig6}; #define SIGSZ sizeof(sig1) - static const byte msg1[] = { }; - static const byte msg2[] = { 0x03 }; - static const byte msg3[] = { 0x64, 0xa6, 0x5f, 0x3c, 0xde, 0xdc, 0xdd, + WOLFSSL_SMALL_STACK_STATIC const byte msg1[] = { }; + WOLFSSL_SMALL_STACK_STATIC const byte msg2[] = { 0x03 }; + WOLFSSL_SMALL_STACK_STATIC const byte msg3[] = { 0x64, 0xa6, 0x5f, 0x3c, 0xde, 0xdc, 0xdd, 0x66, 0x81, 0x1e, 0x29, 0x15 }; /* test of a 1023 byte long message */ - static const byte msg4[] = { + WOLFSSL_SMALL_STACK_STATIC const byte msg4[] = { 0x6d, 0xdf, 0x80, 0x2e, 0x1a, 0xae, 0x49, 0x86, 0x93, 0x5f, 0x7f, 0x98, 0x1b, 0xa3, 0xf0, 0x35, 0x1d, 0x62, 0x73, 0xc0, 0xa0, 0xc2, 0x2c, 0x9c, @@ -25469,8 +25469,8 @@ static int ed448_test(void) 0x02, 0xe6, 0x2f, 0xf6, 0x6c, 0xba, 0x87 }; - static const byte* msgs[] = {msg1, msg2, msg3, msg1, msg1, msg4}; - static const word16 msgSz[] = {0 /*sizeof(msg1)*/, + WOLFSSL_SMALL_STACK_STATIC const byte* msgs[] = {msg1, msg2, msg3, msg1, msg1, msg4}; + WOLFSSL_SMALL_STACK_STATIC const word16 msgSz[] = {0 /*sizeof(msg1)*/, sizeof(msg2), sizeof(msg3), 0 /*sizeof(msg1)*/, @@ -25712,7 +25712,7 @@ typedef struct CMAC_Test_Case { static int cmac_test(void) { #ifdef WOLFSSL_AES_128 - static const byte k128[] = + WOLFSSL_SMALL_STACK_STATIC const byte k128[] = { 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c @@ -25720,7 +25720,7 @@ static int cmac_test(void) #define KLEN_128 (sizeof(k128)) #endif #ifdef WOLFSSL_AES_192 - static const byte k192[] = + WOLFSSL_SMALL_STACK_STATIC const byte k192[] = { 0x8e, 0x73, 0xb0, 0xf7, 0xda, 0x0e, 0x64, 0x52, 0xc8, 0x10, 0xf3, 0x2b, 0x80, 0x90, 0x79, 0xe5, @@ -25729,7 +25729,7 @@ static int cmac_test(void) #define KLEN_192 (sizeof(k192)) #endif #ifdef WOLFSSL_AES_256 - static const byte k256[] = + WOLFSSL_SMALL_STACK_STATIC const byte k256[] = { 0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81, @@ -25739,7 +25739,7 @@ static int cmac_test(void) #define KLEN_256 (sizeof(k256)) #endif - static const byte m[] = + WOLFSSL_SMALL_STACK_STATIC const byte m[] = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a, @@ -25757,71 +25757,71 @@ static int cmac_test(void) #define MLEN_512 (512/8) #ifdef WOLFSSL_AES_128 - static const byte t128_0[] = + WOLFSSL_SMALL_STACK_STATIC const byte t128_0[] = { 0xbb, 0x1d, 0x69, 0x29, 0xe9, 0x59, 0x37, 0x28, 0x7f, 0xa3, 0x7d, 0x12, 0x9b, 0x75, 0x67, 0x46 }; - static const byte t128_128[] = + WOLFSSL_SMALL_STACK_STATIC const byte t128_128[] = { 0x07, 0x0a, 0x16, 0xb4, 0x6b, 0x4d, 0x41, 0x44, 0xf7, 0x9b, 0xdd, 0x9d, 0xd0, 0x4a, 0x28, 0x7c }; - static const byte t128_319[] = + WOLFSSL_SMALL_STACK_STATIC const byte t128_319[] = { 0x2c, 0x17, 0x84, 0x4c, 0x93, 0x1c, 0x07, 0x95, 0x15, 0x92, 0x73, 0x0a, 0x34, 0xd0, 0xd9, 0xd2 }; - static const byte t128_320[] = + WOLFSSL_SMALL_STACK_STATIC const byte t128_320[] = { 0xdf, 0xa6, 0x67, 0x47, 0xde, 0x9a, 0xe6, 0x30, 0x30, 0xca, 0x32, 0x61, 0x14, 0x97, 0xc8, 0x27 }; - static const byte t128_512[] = + WOLFSSL_SMALL_STACK_STATIC const byte t128_512[] = { 0x51, 0xf0, 0xbe, 0xbf, 0x7e, 0x3b, 0x9d, 0x92, 0xfc, 0x49, 0x74, 0x17, 0x79, 0x36, 0x3c, 0xfe }; #endif #ifdef WOLFSSL_AES_192 - static const byte t192_0[] = + WOLFSSL_SMALL_STACK_STATIC const byte t192_0[] = { 0xd1, 0x7d, 0xdf, 0x46, 0xad, 0xaa, 0xcd, 0xe5, 0x31, 0xca, 0xc4, 0x83, 0xde, 0x7a, 0x93, 0x67 }; - static const byte t192_128[] = + WOLFSSL_SMALL_STACK_STATIC const byte t192_128[] = { 0x9e, 0x99, 0xa7, 0xbf, 0x31, 0xe7, 0x10, 0x90, 0x06, 0x62, 0xf6, 0x5e, 0x61, 0x7c, 0x51, 0x84 }; - static const byte t192_320[] = + WOLFSSL_SMALL_STACK_STATIC const byte t192_320[] = { 0x8a, 0x1d, 0xe5, 0xbe, 0x2e, 0xb3, 0x1a, 0xad, 0x08, 0x9a, 0x82, 0xe6, 0xee, 0x90, 0x8b, 0x0e }; - static const byte t192_512[] = + WOLFSSL_SMALL_STACK_STATIC const byte t192_512[] = { 0xa1, 0xd5, 0xdf, 0x0e, 0xed, 0x79, 0x0f, 0x79, 0x4d, 0x77, 0x58, 0x96, 0x59, 0xf3, 0x9a, 0x11 }; #endif #ifdef WOLFSSL_AES_256 - static const byte t256_0[] = + WOLFSSL_SMALL_STACK_STATIC const byte t256_0[] = { 0x02, 0x89, 0x62, 0xf6, 0x1b, 0x7b, 0xf8, 0x9e, 0xfc, 0x6b, 0x55, 0x1f, 0x46, 0x67, 0xd9, 0x83 }; - static const byte t256_128[] = + WOLFSSL_SMALL_STACK_STATIC const byte t256_128[] = { 0x28, 0xa7, 0x02, 0x3f, 0x45, 0x2e, 0x8f, 0x82, 0xbd, 0x4b, 0xf2, 0x8d, 0x8c, 0x37, 0xc3, 0x5c }; - static const byte t256_320[] = + WOLFSSL_SMALL_STACK_STATIC const byte t256_320[] = { 0xaa, 0xf3, 0xd8, 0xf1, 0xde, 0x56, 0x40, 0xc2, 0x32, 0xf5, 0xb1, 0x69, 0xb9, 0xc9, 0x11, 0xe6 }; - static const byte t256_512[] = + WOLFSSL_SMALL_STACK_STATIC const byte t256_512[] = { 0xe1, 0x99, 0x21, 0x90, 0x54, 0x9f, 0x6e, 0xd5, 0x69, 0x6a, 0x2c, 0x05, 0x6c, 0x31, 0x54, 0x10 @@ -26636,20 +26636,20 @@ static int myDecryptionFunc(PKCS7* pkcs7, int encryptOID, byte* iv, int ivSz, /* looking for KEY ID * fwDecryptKeyID OID "1.2.840.113549.1.9.16.2.37 */ - static const unsigned char OID[] = { + WOLFSSL_SMALL_STACK_STATIC const unsigned char OID[] = { /* 0x06, 0x0B do not pass in tag and length */ 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x10, 0x02, 0x25 }; - static const byte defKey[] = { + WOLFSSL_SMALL_STACK_STATIC const byte defKey[] = { 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08, 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08, 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08, 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08 }; - static const byte altKey[] = { + WOLFSSL_SMALL_STACK_STATIC const byte altKey[] = { 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08, 0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08 }; @@ -26760,7 +26760,7 @@ static int pkcs7enveloped_run_vectors(byte* rsaCert, word32 rsaCertSz, XFILE pkcs7File; #endif - static const byte data[] = { /* Hello World */ + WOLFSSL_SMALL_STACK_STATIC const byte data[] = { /* Hello World */ 0x48,0x65,0x6c,0x6c,0x6f,0x20,0x57,0x6f, 0x72,0x6c,0x64 }; @@ -27337,13 +27337,13 @@ static int pkcs7authenveloped_run_vectors(byte* rsaCert, word32 rsaCertSz, XFILE pkcs7File; #endif - static const byte data[] = { /* Hello World */ + WOLFSSL_SMALL_STACK_STATIC const byte data[] = { /* Hello World */ 0x48,0x65,0x6c,0x6c,0x6f,0x20,0x57,0x6f, 0x72,0x6c,0x64 }; byte senderNonce[PKCS7_NONCE_SZ + 2]; #ifdef HAVE_ECC - static const byte senderNonceOid[] = + WOLFSSL_SMALL_STACK_STATIC const byte senderNonceOid[] = { 0x06, 0x0a, 0x60, 0x86, 0x48, 0x01, 0x86, 0xF8, 0x45, 0x01, 0x09, 0x05 }; @@ -27356,20 +27356,20 @@ static int pkcs7authenveloped_run_vectors(byte* rsaCert, word32 rsaCertSz, #if !defined(NO_AES) && defined(WOLFSSL_AES_256) && defined(HAVE_ECC) && \ defined(WOLFSSL_SHA512) - static const byte optionalUkm[] = { + WOLFSSL_SMALL_STACK_STATIC const byte optionalUkm[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07 }; #endif /* NO_AES */ #if !defined(NO_AES) && !defined(NO_SHA) && defined(WOLFSSL_AES_128) /* encryption key for kekri recipient types */ - static const byte secretKey[] = { + WOLFSSL_SMALL_STACK_STATIC const byte secretKey[] = { 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07 }; /* encryption key identifier */ - static const byte secretKeyId[] = { + WOLFSSL_SMALL_STACK_STATIC const byte secretKeyId[] = { 0x02,0x02,0x03,0x04 }; #endif @@ -27378,12 +27378,12 @@ static int pkcs7authenveloped_run_vectors(byte* rsaCert, word32 rsaCertSz, !defined(NO_SHA) && defined(WOLFSSL_AES_128) #ifndef HAVE_FIPS - static const char password[] = "password"; + WOLFSSL_SMALL_STACK_STATIC const char password[] = "password"; #else - static const char password[] = "passwordFIPS_MODE"; + WOLFSSL_SMALL_STACK_STATIC const char password[] = "passwordFIPS_MODE"; #endif - static const byte salt[] = { + WOLFSSL_SMALL_STACK_STATIC const byte salt[] = { 0x12, 0x34, 0x56, 0x78, 0x78, 0x56, 0x34, 0x12 }; #endif @@ -28063,7 +28063,7 @@ static int envelopedData_encrypt(byte* in, word32 inSz, byte* out, { int ret; PKCS7* pkcs7; - static const byte keyId[] = { 0x00 }; + WOLFSSL_SMALL_STACK_STATIC const byte keyId[] = { 0x00 }; pkcs7 = wc_PKCS7_New(NULL, INVALID_DEVID); if (pkcs7 == NULL) @@ -28213,7 +28213,7 @@ static int verifyBundle(byte* derBuf, word32 derSz, int keyHint) byte decoded[FOURK_BUF/2]; int decodedSz = FOURK_BUF/2; - static const byte expectedSid[] = { + WOLFSSL_SMALL_STACK_STATIC const byte expectedSid[] = { 0x33, 0xD8, 0x45, 0x66, 0xD7, 0x68, 0x87, 0x18, 0x7E, 0x54, 0x0D, 0x70, 0x27, 0x91, 0xC7, 0x26, 0xD7, 0x85, 0x65, 0xC0 @@ -28394,7 +28394,7 @@ static int pkcs7encrypted_test(void) PKCS7Attrib* expectedAttrib; PKCS7DecodedAttrib* decodedAttrib; - static const byte data[] = { /* Hello World */ + WOLFSSL_SMALL_STACK_STATIC const byte data[] = { /* Hello World */ 0x48,0x65,0x6c,0x6c,0x6f,0x20,0x57,0x6f, 0x72,0x6c,0x64 }; @@ -28662,7 +28662,7 @@ static int pkcs7compressed_test(void) XFILE pkcs7File; #endif - static const byte data[] = { /* Hello World */ + WOLFSSL_SMALL_STACK_STATIC const byte data[] = { /* Hello World */ 0x48,0x65,0x6c,0x6c,0x6f,0x20,0x57,0x6f, 0x72,0x6c,0x64 }; @@ -28807,7 +28807,7 @@ static int pkcs7signed_run_vectors( XFILE file; #endif - static const byte data[] = { /* Hello World */ + WOLFSSL_SMALL_STACK_STATIC const byte data[] = { /* Hello World */ 0x48,0x65,0x6c,0x6c,0x6f,0x20,0x57,0x6f, 0x72,0x6c,0x64 }; @@ -29310,7 +29310,7 @@ static int pkcs7signed_run_SingleShotVectors( XFILE file; #endif - static const byte data[] = { /* Hello World */ + WOLFSSL_SMALL_STACK_STATIC const byte data[] = { /* Hello World */ 0x48,0x65,0x6c,0x6c,0x6f,0x20,0x57,0x6f, 0x72,0x6c,0x64 }; @@ -30081,11 +30081,11 @@ static int mp_test_radix_10(mp_int* a, mp_int* r, WC_RNG* rng) int i, j; int size; char str[30]; - static const char* badStr1 = "A"; - static const char* badStr2 = "a"; - static const char* badStr3 = " "; - static const char* zeros = "000"; - static const char* empty = ""; + WOLFSSL_SMALL_STACK_STATIC const char* badStr1 = "A"; + WOLFSSL_SMALL_STACK_STATIC const char* badStr2 = "a"; + WOLFSSL_SMALL_STACK_STATIC const char* badStr3 = " "; + WOLFSSL_SMALL_STACK_STATIC const char* zeros = "000"; + WOLFSSL_SMALL_STACK_STATIC const char* empty = ""; for (i = 0; i < 10; i++) { for (j = 2; j < 12; j++) { @@ -30150,9 +30150,9 @@ static int mp_test_radix_16(mp_int* a, mp_int* r, WC_RNG* rng) #if defined(WOLFSSL_SP_MATH) || defined(USE_FAST_MATH) static char longStr[2 * sizeof(a->dp) + 2]; #endif - static const char* badStr1 = " "; - static const char* badStr2 = "}"; - static const char* empty = ""; + WOLFSSL_SMALL_STACK_STATIC const char* badStr1 = " "; + WOLFSSL_SMALL_STACK_STATIC const char* badStr2 = "}"; + WOLFSSL_SMALL_STACK_STATIC const char* empty = ""; for (i = 0; i < 10; i++) { for (j = 2; j < 12; j++) { @@ -30298,7 +30298,7 @@ static int mp_test_add_sub_d(mp_int* a, mp_int* r1) static int mp_test_read_to_bin(mp_int* a) { - static const byte in[16] = { + WOLFSSL_SMALL_STACK_STATIC const byte in[16] = { 0x91, 0xa2, 0xb3, 0xc4, 0xd5, 0xe6, 0xf7, 0x08, 0x93, 0xa4, 0xb4, 0xc5, 0xd6, 0xe7, 0xf8, 0x09 }; @@ -31809,7 +31809,7 @@ static int mp_test_lcm_gcd(mp_int* a, mp_int* b, mp_int* r, mp_int* exp, int ret; #if !defined(NO_RSA) && defined(WOLFSSL_KEY_GEN) int i; - static const int kat[][3] = { + WOLFSSL_SMALL_STACK_STATIC const int kat[][3] = { { 1, 1, 1 }, { 2, 1, 2 }, { 1, 2, 2 }, { 2, 4, 4 }, { 4, 2, 4 }, { 12, 56, 168 }, { 56, 12, 168 } }; @@ -32848,15 +32848,15 @@ static int berder_test(void) int i; word32 len = 0, l; byte out[32]; - static const byte good1_in[] = { 0x30, 0x80, 0x00, 0x00 }; - static const byte good1_out[] = { 0x30, 0x00 }; - static const byte good2_in[] = { 0x30, 0x80, 0x02, 0x01, 0x01, 0x00, 0x00 }; - static const byte good2_out[] = { 0x30, 0x03, 0x02, 0x01, 0x01 }; - static const byte good3_in[] = { + WOLFSSL_SMALL_STACK_STATIC const byte good1_in[] = { 0x30, 0x80, 0x00, 0x00 }; + WOLFSSL_SMALL_STACK_STATIC const byte good1_out[] = { 0x30, 0x00 }; + WOLFSSL_SMALL_STACK_STATIC const byte good2_in[] = { 0x30, 0x80, 0x02, 0x01, 0x01, 0x00, 0x00 }; + WOLFSSL_SMALL_STACK_STATIC const byte good2_out[] = { 0x30, 0x03, 0x02, 0x01, 0x01 }; + WOLFSSL_SMALL_STACK_STATIC const byte good3_in[] = { 0x24, 0x80, 0x04, 0x01, 0x01, 0x00, 0x00 }; - static const byte good3_out[] = { 0x04, 0x1, 0x01 }; - static const byte good4_in[] = { + WOLFSSL_SMALL_STACK_STATIC const byte good3_out[] = { 0x04, 0x1, 0x01 }; + WOLFSSL_SMALL_STACK_STATIC const byte good4_in[] = { 0x30, 0x80, 0x02, 0x01, 0x01, 0x30, 0x80, @@ -32871,7 +32871,7 @@ static int berder_test(void) 0x00, 0x00, 0x00, 0x00, }; - static const byte good4_out[] = { + WOLFSSL_SMALL_STACK_STATIC const byte good4_out[] = { 0x30, 0x12, 0x02, 0x01, 0x01, 0x30, 0x08, @@ -32880,7 +32880,7 @@ static int berder_test(void) 0x31, 0x03, 0x06, 0x01, 0x01 }; - static const byte good5_in[] = { 0x30, 0x03, 0x02, 0x01, 0x01 }; + WOLFSSL_SMALL_STACK_STATIC const byte good5_in[] = { 0x30, 0x03, 0x02, 0x01, 0x01 }; berDerTestData testData[] = { { good1_in, sizeof(good1_in), good1_out, sizeof(good1_out) }, @@ -33166,13 +33166,13 @@ static int blob_test(void) byte blob[112]; word32 outSz; - static const byte iv[] = + WOLFSSL_SMALL_STACK_STATIC const byte iv[] = { 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7, 0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff }; - static const byte text[] = + WOLFSSL_SMALL_STACK_STATIC const byte text[] = { 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a, @@ -33653,7 +33653,7 @@ static int certpiv_test(void) wc_CertPIV piv; /* Template for Identiv PIV cert, nonce and signature */ - static const byte pivCertIdentiv[] = { + WOLFSSL_SMALL_STACK_STATIC const byte pivCertIdentiv[] = { 0x0A, 0x0D, 0x53, 0x04, /* NIST PIV Cert */ 0x70, 0x02, /* Certificate */ @@ -33664,7 +33664,7 @@ static int certpiv_test(void) 0x0C, 0x01, 0x00, /* Signed Nonce */ }; - static const byte pivCert[] = { + WOLFSSL_SMALL_STACK_STATIC const byte pivCert[] = { 0x53, 0x04, /* NIST PIV Cert */ 0x70, 0x02, /* Certificate */ 0x30, 0x00, diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index b463d22a3..7e6fa8b06 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -2380,6 +2380,13 @@ extern void uITRON4_free(void *p) ; #undef WOLFSSL_SMALL_STACK #endif +#ifdef WOLFSSL_SMALL_STACK_STATIC + #undef WOLFSSL_SMALL_STACK_STATIC + #define WOLFSSL_SMALL_STACK_STATIC static +#else + #define WOLFSSL_SMALL_STACK_STATIC +#endif + /* The client session cache requires time for timeout */ #if defined(NO_ASN_TIME) && !defined(NO_SESSION_CACHE) #define NO_SESSION_CACHE