GCC ARM compiler requires explicit signed declaration

This commit is contained in:
Sean Parkinson
2018-12-07 15:01:18 +10:00
parent 6dfc723961
commit fe8080ce4a
2 changed files with 3 additions and 2 deletions

View File

@@ -356,7 +356,8 @@ STATIC WC_INLINE byte ctMaskSel(byte m, byte a, byte b)
/* Constant time - select integer a when mask is set and integer b otherwise. */
STATIC WC_INLINE int ctMaskSelInt(byte m, int a, int b)
{
return (b & (~(int)(char)m)) | (a & ((int)(char)m));
return (b & (~(signed int)(signed char)m)) |
(a & ( (signed int)(signed char)m));
}
/* Constant time - bit set when a <= b. */