Add further missing brackets around macro parameters

This commit is contained in:
Hanno Becker 2018-10-26 09:13:26 +01:00 committed by Gilles Peskine
parent ee60034a60
commit 3ac21aca9b
6 changed files with 10 additions and 10 deletions

View file

@ -397,7 +397,7 @@ static uint32_t RCON[10];
*/ */
#define ROTL8(x) ( ( (x) << 8 ) & 0xFFFFFFFF ) | ( (x) >> 24 ) #define ROTL8(x) ( ( (x) << 8 ) & 0xFFFFFFFF ) | ( (x) >> 24 )
#define XTIME(x) ( ( (x) << 1 ) ^ ( ( (x) & 0x80 ) ? 0x1B : 0x00 ) ) #define XTIME(x) ( ( (x) << 1 ) ^ ( ( (x) & 0x80 ) ? 0x1B : 0x00 ) )
#define MUL(x,y) ( ( (x) && (y) ) ? pow[(log[x]+log[y]) % 255] : 0 ) #define MUL(x,y) ( ( (x) && (y) ) ? pow[(log[(x)]+log[(y)]) % 255] : 0 )
static int aes_init_done = 0; static int aes_init_done = 0;

View file

@ -148,8 +148,8 @@ int mbedtls_internal_md4_process( mbedtls_md4_context *ctx,
#define P(a,b,c,d,x,s) \ #define P(a,b,c,d,x,s) \
do \ do \
{ \ { \
(a) += F(b,c,d) + (x); \ (a) += F((b),(c),(d)) + (x); \
(a) = S(a,s); \ (a) = S((a),(s)); \
} while( 0 ) } while( 0 )

View file

@ -142,7 +142,7 @@ int mbedtls_internal_md5_process( mbedtls_md5_context *ctx,
#define P(a,b,c,d,k,s,t) \ #define P(a,b,c,d,k,s,t) \
do \ do \
{ \ { \
(a) += F((b),(c),(d)) + X[k] + (t); \ (a) += F((b),(c),(d)) + X[(k)] + (t); \
(a) = S((a),(s)) + (b); \ (a) = S((a),(s)) + (b); \
} while( 0 ) } while( 0 )

View file

@ -164,8 +164,8 @@ int mbedtls_internal_sha1_process( mbedtls_sha1_context *ctx,
#define P(a,b,c,d,e,x) \ #define P(a,b,c,d,e,x) \
do \ do \
{ \ { \
(e) += S(a,5) + F(b,c,d) + K + (x); \ (e) += S((a),5) + F((b),(c),(d)) + K + (x); \
(b) = S(b,30); \ (b) = S((b),30); \
} while( 0 ) } while( 0 )
A = ctx->state[0]; A = ctx->state[0];

View file

@ -193,8 +193,8 @@ static const uint32_t K[] =
#define P(a,b,c,d,e,f,g,h,x,K) \ #define P(a,b,c,d,e,f,g,h,x,K) \
do \ do \
{ \ { \
temp1 = (h) + S3(e) + F1(e,f,g) + (K) + (x); \ temp1 = (h) + S3(e) + F1((e),(f),(g)) + (K) + (x); \
temp2 = S2(a) + F0(a,b,c); \ temp2 = S2(a) + F0((a),(b),(c)); \
(d) += temp1; (h) = temp1 + temp2; \ (d) += temp1; (h) = temp1 + temp2; \
} while( 0 ) } while( 0 )

View file

@ -239,8 +239,8 @@ int mbedtls_internal_sha512_process( mbedtls_sha512_context *ctx,
#define P(a,b,c,d,e,f,g,h,x,K) \ #define P(a,b,c,d,e,f,g,h,x,K) \
do \ do \
{ \ { \
temp1 = (h) + S3(e) + F1(e,f,g) + (K) + (x); \ temp1 = (h) + S3(e) + F1((e),(f),(g)) + (K) + (x); \
temp2 = S2(a) + F0(a,b,c); \ temp2 = S2(a) + F0((a),(b),(c)); \
(d) += temp1; (h) = temp1 + temp2; \ (d) += temp1; (h) = temp1 + temp2; \
} while( 0 ) } while( 0 )