Commit fab1562a authored by Ganesh Ajjanagadde's avatar Ganesh Ajjanagadde

avutil/ripemd: make rol macro more robust by adding parentheses

This ensures that the macro remains correct in the sense of allowing
expressions for value and bits, by placing the value and bits expressions within
parentheses.
Reviewed-by: 's avatarJames Almer <jamrial@gmail.com>
Signed-off-by: 's avatarGanesh Ajjanagadde <gajjanagadde@gmail.com>
parent 2193f537
...@@ -85,7 +85,7 @@ static const int WB[80] = { ...@@ -85,7 +85,7 @@ static const int WB[80] = {
12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
}; };
#define rol(value, bits) ((value << bits) | (value >> (32 - bits))) #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
#define ROUND128_0_TO_15(a,b,c,d,e,f,g,h) \ #define ROUND128_0_TO_15(a,b,c,d,e,f,g,h) \
a = rol(a + (( b ^ c ^ d) + block[WA[n]]), ROTA[n]); \ a = rol(a + (( b ^ c ^ d) + block[WA[n]]), ROTA[n]); \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment