Browse Source

Better casting.

cl-refactor
Gav Wood 10 years ago
parent
commit
e92e107fe9
  1. 2
      libdevcore/FixedHash.h
  2. 4
      libdevcrypto/Common.cpp

2
libdevcore/FixedHash.h

@ -151,7 +151,7 @@ public:
{
FixedHash ret;
for (auto& i: ret.m_data)
i = std::uniform_int_distribution<uint16_t>(0, 255)(_eng);
i = std::uniform_int_distribution<uint8_t>(0, 255)(_eng);
return ret;
}

4
libdevcrypto/Common.cpp

@ -344,9 +344,9 @@ void Nonce::initialiseIfNeeded()
{
// todo: replace w/entropy from user and system
std::mt19937_64 s_eng(time(0) + chrono::high_resolution_clock::now().time_since_epoch().count());
std::uniform_int_distribution<uint16_t> d(0, 255);
std::uniform_int_distribution<uint8_t> d(0, 255);
for (unsigned i = 0; i < 32; ++i)
m_value[i] = byte(d(s_eng));
m_value[i] = d(s_eng);
}
if (!m_value)
BOOST_THROW_EXCEPTION(InvalidState());

Loading…
Cancel
Save