Skip to content

Commit 2c0a6f1

Browse files
committed
Use sanity check timestamps as entropy
1 parent 33f853d commit 2c0a6f1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/random.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ bool Random_SanityCheck()
298298
uint64_t stop = GetPerformanceCounter();
299299
if (stop == start) return false;
300300

301+
// We called GetPerformanceCounter. Use it as entropy.
302+
RAND_add((const unsigned char*)&start, sizeof(start), 1);
303+
RAND_add((const unsigned char*)&stop, sizeof(stop), 1);
304+
301305
return true;
302306
}
303307

0 commit comments

Comments
 (0)