From 06b68e4e31e5c4b5f03f0db799110bb30776dd66 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 11 Jul 2013 21:53:30 +0000 Subject: [PATCH] updated comment. no actual change. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6498 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/util/rsrandom.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libretroshare/src/util/rsrandom.cc b/libretroshare/src/util/rsrandom.cc index 3b275eb9c..95b869a80 100644 --- a/libretroshare/src/util/rsrandom.cc +++ b/libretroshare/src/util/rsrandom.cc @@ -9,10 +9,11 @@ uint32_t RSRandom::index = RSRandom::N ; std::vector RSRandom::MT(RSRandom::N,0u) ; RsMutex RSRandom::rndMtx("RSRandom") ; -// Random seed is called according to the following rules: -// OpenSSL random bytes: -// - on systems that only have /dev/urandom (linux, BSD, MacOS), we don't need to call the seed -// - on windows, we need to +// According to our tests (cyril+thunder), on both Windows and Linux does +// RAND_bytes init itself automatically at first call, from system-based +// unpredictable values, so that seeding is not even needed. +// This call still adds some randomness (not much actually, but it's always good to +// have anyway) // #ifdef WINDOWS_SYS static bool auto_seed = RSRandom::seed( (time(NULL) + ((uint32_t) pthread_self().p)*0x1293fe)^0x18e34a12 ) ;