From 99b27469b596940771541b1a6b48850a8d4bcf67 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 7 Jul 2015 13:09:25 -0700 Subject: [PATCH] Don't use PRNG for key generation! --- libdevcrypto/Common.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/libdevcrypto/Common.cpp b/libdevcrypto/Common.cpp index 8bf95d02f..e45d1cfb6 100644 --- a/libdevcrypto/Common.cpp +++ b/libdevcrypto/Common.cpp @@ -262,16 +262,9 @@ bytes dev::scrypt(std::string const& _pass, bytes const& _salt, uint64_t _n, uin KeyPair KeyPair::create() { - static boost::thread_specific_ptr s_eng; - static unsigned s_id = 0; - if (!s_eng.get()) - s_eng.reset(new mt19937_64(time(0) + chrono::high_resolution_clock::now().time_since_epoch().count() + ++s_id)); - - uniform_int_distribution d(0, 255); - for (int i = 0; i < 100; ++i) { - KeyPair ret(FixedHash<32>::random(*s_eng.get())); + KeyPair ret(FixedHash<32>::random()); if (ret.address()) return ret; }