Add more missing parentheses around macro parameters

This commit is contained in:
Hanno Becker 2018-10-30 09:29:25 +00:00 committed by Simon Butcher
parent 818bac55ef
commit 26d02e1327
2 changed files with 15 additions and 15 deletions

View file

@ -177,8 +177,8 @@ int mbedtls_internal_md4_process( mbedtls_md4_context *ctx,
#define P(a,b,c,d,x,s) \
do \
{ \
(a) += F(b,c,d) + (x) + 0x5A827999; \
(a) = S(a,s); \
(a) += F((b),(c),(d)) + (x) + 0x5A827999; \
(a) = S((a),(s)); \
} while( 0 )
P( A, B, C, D, X[ 0], 3 );
@ -205,8 +205,8 @@ int mbedtls_internal_md4_process( mbedtls_md4_context *ctx,
#define P(a,b,c,d,x,s) \
do \
{ \
(a) += F(b,c,d) + (x) + 0x6ED9EBA1; \
(a) = S(a,s); \
(a) += F((b),(c),(d)) + (x) + 0x6ED9EBA1; \
(a) = S((a),(s)); \
} while( 0 )
P( A, B, C, D, X[ 0], 3 );

View file

@ -225,7 +225,7 @@ int mbedtls_internal_sha512_process( mbedtls_sha512_context *ctx,
SHA512_VALIDATE_RET( (const unsigned char *)data != NULL );
#define SHR(x,n) ((x) >> (n))
#define ROTR(x,n) (SHR(x,n) | ((x) << (64 - (n))))
#define ROTR(x,n) (SHR((x),(n)) | ((x) << (64 - (n))))
#define S0(x) (ROTR(x, 1) ^ ROTR(x, 8) ^ SHR(x, 7))
#define S1(x) (ROTR(x,19) ^ ROTR(x,61) ^ SHR(x, 6))