crypto: make clear generate_random_bytes is not thread safe

And add a thread safe version to encourage proper use
This commit is contained in:
moneromooo-monero 2016-05-14 22:08:10 +01:00
parent 8b0d22a2aa
commit d539be3359
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
4 changed files with 11 additions and 4 deletions

View file

@ -113,7 +113,7 @@ INITIALIZER(init_random) {
#endif
}
void generate_random_bytes(size_t n, void *result) {
void generate_random_bytes_not_thread_safe(size_t n, void *result) {
#if !defined(NDEBUG)
assert(curstate == 1);
curstate = 2;