Browse Source

Use sanity check timestamps as entropy

tags/v0.15.1
Pieter Wuille 4 years ago
parent
commit
2c0a6f157d
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      src/random.cpp

+ 4
- 0
src/random.cpp View File

@@ -298,6 +298,10 @@ bool Random_SanityCheck()
uint64_t stop = GetPerformanceCounter();
if (stop == start) return false;

// We called GetPerformanceCounter. Use it as entropy.
RAND_add((const unsigned char*)&start, sizeof(start), 1);
RAND_add((const unsigned char*)&stop, sizeof(stop), 1);

return true;
}


Loading…
Cancel
Save