diff options
| -rw-r--r-- | src/add_developedtweakey/tweakey.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/add_developedtweakey/tweakey.c b/src/add_developedtweakey/tweakey.c index 605098b..0588c1b 100644 --- a/src/add_developedtweakey/tweakey.c +++ b/src/add_developedtweakey/tweakey.c @@ -55,15 +55,12 @@ static uint8_t _M2(uint8_t x) static uint8_t _M3(uint8_t x) { - return x & 0x1f; + return (uint8_t)(x<<3) >> 3; } static uint8_t _M4(uint8_t x) { - /* (x<<2)>>3 would keep bit x6 due to integer promotion. - * Side-step this by writing each shift on its own statement. */ - x <<= 2; - return x>>3; + return (uint8_t)(x<<2) >> 3; } static void _multiply_M(const uint8_t X[LANE_BYTES], uint8_t Y[LANE_BYTES]) |
