Permalink
Browse files

Fixed undefined behavior in ROR/ROL

  • Loading branch information...
SChernykh committed Feb 8, 2019
1 parent 4314d15 commit 6528fbe796ac44dd18961435325503bbccc6c875
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/crypto/variant4_random_math.h
@@ -106,13 +106,13 @@ static FORCEINLINE void v4_random_math(const struct V4_Instruction* code, v4_reg
case ROR: \
{ \
const uint32_t shift = src % REG_BITS; \
*dst = (*dst >> shift) | (*dst << (REG_BITS - shift)); \
*dst = (*dst >> shift) | (*dst << ((REG_BITS - shift) % REG_BITS)); \
} \
break; \
case ROL: \
{ \
const uint32_t shift = src % REG_BITS; \
*dst = (*dst << shift) | (*dst >> (REG_BITS - shift)); \
*dst = (*dst << shift) | (*dst >> ((REG_BITS - shift) % REG_BITS)); \
} \
break; \
case XOR: \

0 comments on commit 6528fbe

Please sign in to comment.