diff options
Diffstat (limited to 'src/lib/block')
-rw-r--r-- | src/lib/block/idea/idea.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/block/idea/idea.cpp b/src/lib/block/idea/idea.cpp index 4795a126a..c0364b325 100644 --- a/src/lib/block/idea/idea.cpp +++ b/src/lib/block/idea/idea.cpp @@ -26,7 +26,8 @@ inline uint16_t mul(uint16_t x, uint16_t y) const uint32_t P_hi = P >> 16; const uint32_t P_lo = P & 0xFFFF; - const uint16_t r_1 = static_cast<uint16_t>((P_lo - P_hi) + (P_lo < P_hi)); + const uint16_t carry = (P_lo < P_hi); + const uint16_t r_1 = static_cast<uint16_t>((P_lo - P_hi) + carry); const uint16_t r_2 = 1 - x - y; return CT::select(Z_mask, r_1, r_2); |