Skip to content

Commit de3a5ff

Browse files
authored
Merge pull request #159 from YaacovHazan/fix-get-random-in-rand48
fix issue #158, gaussian key-pattern on MAC OS
2 parents 18d2646 + 1a373ee commit de3a5ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

obj_gen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ unsigned long long random_generator::get_random()
8282

8383
rn = jrand48(m_data_blob);
8484
llrn |= rn & 0xffffffff; // reset the sign extension bits of negative numbers
85-
llrn &= 0x8000000000000000; // avoid any trouble from sign mismatch and negative numbers
85+
llrn &= 0x7FFFFFFFFFFFFFFF; // avoid any trouble from sign mismatch and negative numbers
8686
#else
8787
#error no random function
8888
#endif

0 commit comments

Comments
 (0)