diff --git a/deps/mbedtls/camellia.c b/deps/mbedtls/camellia.c index b66c61ae9c..f8debc0744 100644 --- a/deps/mbedtls/camellia.c +++ b/deps/mbedtls/camellia.c @@ -85,7 +85,7 @@ static const unsigned char SIGMA_CHARS[6][8] = #if defined(MBEDTLS_CAMELLIA_SMALL_MEMORY) -static const unsigned char FSb[256] = +static const unsigned char C_FSb[256] = { 112,130, 44,236,179, 39,192,229,228,133, 87, 53,234, 12,174, 65, 35,239,107,147, 69, 25,165, 33,237, 14, 79, 78, 29,101,146,189, @@ -105,14 +105,14 @@ static const unsigned char FSb[256] = 64, 40,211,123,187,201, 67,193, 21,227,173,244,119,199,128,158 }; -#define SBOX1(n) FSb[(n)] -#define SBOX2(n) (unsigned char)((FSb[(n)] >> 7 ^ FSb[(n)] << 1) & 0xff) -#define SBOX3(n) (unsigned char)((FSb[(n)] >> 1 ^ FSb[(n)] << 7) & 0xff) -#define SBOX4(n) FSb[((n) << 1 ^ (n) >> 7) &0xff] +#define SBOX1(n) C_FSb[(n)] +#define SBOX2(n) (unsigned char)((C_FSb[(n)] >> 7 ^ C_FSb[(n)] << 1) & 0xff) +#define SBOX3(n) (unsigned char)((C_FSb[(n)] >> 1 ^ C_FSb[(n)] << 7) & 0xff) +#define SBOX4(n) C_FSb[((n) << 1 ^ (n) >> 7) &0xff] #else /* MBEDTLS_CAMELLIA_SMALL_MEMORY */ -static const unsigned char FSb[256] = +static const unsigned char C_FSb[256] = { 112, 130, 44, 236, 179, 39, 192, 229, 228, 133, 87, 53, 234, 12, 174, 65, 35, 239, 107, 147, 69, 25, 165, 33, 237, 14, 79, 78, 29, 101, 146, 189, @@ -192,7 +192,7 @@ static const unsigned char FSb4[256] = 7, 85, 238, 10, 73, 104, 56, 164, 40, 123, 201, 193, 227, 244, 199, 158 }; -#define SBOX1(n) FSb[(n)] +#define SBOX1(n) C_FSb[(n)] #define SBOX2(n) FSb2[(n)] #define SBOX3(n) FSb3[(n)] #define SBOX4(n) FSb4[(n)] diff --git a/deps/mbedtls/ccm.c b/deps/mbedtls/ccm.c index 0174097dad..a899ceecc7 100644 --- a/deps/mbedtls/ccm.c +++ b/deps/mbedtls/ccm.c @@ -356,7 +356,7 @@ int mbedtls_ccm_auth_decrypt( mbedtls_ccm_context *ctx, size_t length, /* * The data is the same for all tests, only the used length changes */ -static const unsigned char key[] = { +static const unsigned char ccm_key[] = { 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f }; @@ -403,7 +403,7 @@ int mbedtls_ccm_self_test( int verbose ) mbedtls_ccm_init( &ctx ); - if( mbedtls_ccm_setkey( &ctx, MBEDTLS_CIPHER_ID_AES, key, 8 * sizeof key ) != 0 ) + if( mbedtls_ccm_setkey( &ctx, MBEDTLS_CIPHER_ID_AES, ccm_key, 8 * sizeof ccm_key ) != 0 ) { if( verbose != 0 ) mbedtls_printf( " CCM: setup failed" ); diff --git a/deps/mbedtls/gcm.c b/deps/mbedtls/gcm.c index 2f9a628ec2..cc07e822fe 100644 --- a/deps/mbedtls/gcm.c +++ b/deps/mbedtls/gcm.c @@ -516,7 +516,7 @@ void mbedtls_gcm_free( mbedtls_gcm_context *ctx ) static const int key_index[MAX_TESTS] = { 0, 0, 1, 1, 1, 1 }; -static const unsigned char key[MAX_TESTS][32] = +static const unsigned char gcm_key[MAX_TESTS][32] = { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -753,7 +753,7 @@ int mbedtls_gcm_self_test( int verbose ) mbedtls_printf( " AES-GCM-%3d #%d (%s): ", key_len, i, "enc" ); - mbedtls_gcm_setkey( &ctx, cipher, key[key_index[i]], key_len ); + mbedtls_gcm_setkey( &ctx, cipher, gcm_key[key_index[i]], key_len ); ret = mbedtls_gcm_crypt_and_tag( &ctx, MBEDTLS_GCM_ENCRYPT, pt_len[i], @@ -780,7 +780,7 @@ int mbedtls_gcm_self_test( int verbose ) mbedtls_printf( " AES-GCM-%3d #%d (%s): ", key_len, i, "dec" ); - mbedtls_gcm_setkey( &ctx, cipher, key[key_index[i]], key_len ); + mbedtls_gcm_setkey( &ctx, cipher, gcm_key[key_index[i]], key_len ); ret = mbedtls_gcm_crypt_and_tag( &ctx, MBEDTLS_GCM_DECRYPT, pt_len[i], @@ -807,7 +807,7 @@ int mbedtls_gcm_self_test( int verbose ) mbedtls_printf( " AES-GCM-%3d #%d split (%s): ", key_len, i, "enc" ); - mbedtls_gcm_setkey( &ctx, cipher, key[key_index[i]], key_len ); + mbedtls_gcm_setkey( &ctx, cipher, gcm_key[key_index[i]], key_len ); ret = mbedtls_gcm_starts( &ctx, MBEDTLS_GCM_ENCRYPT, iv[iv_index[i]], iv_len[i], @@ -874,7 +874,7 @@ int mbedtls_gcm_self_test( int verbose ) mbedtls_printf( " AES-GCM-%3d #%d split (%s): ", key_len, i, "dec" ); - mbedtls_gcm_setkey( &ctx, cipher, key[key_index[i]], key_len ); + mbedtls_gcm_setkey( &ctx, cipher, gcm_key[key_index[i]], key_len ); ret = mbedtls_gcm_starts( &ctx, MBEDTLS_GCM_DECRYPT, iv[iv_index[i]], iv_len[i],