diff --git a/src/crypto/random.c b/src/crypto/random.c index 3a86a93a4..fb9241762 100644 --- a/src/crypto/random.c +++ b/src/crypto/random.c @@ -66,6 +66,9 @@ static void random_write_entropy(void); static u32 __ROL32(u32 x, u32 y) { + if (y == 0) + return x; + return (x << (y & 31)) | (x >> (32 - (y & 31))); }