Changeset View
Changeset View
Standalone View
Standalone View
src/random.cpp
Show First 20 Lines • Show All 755 Lines • ▼ Show 20 Lines | FastRandomContext::FastRandomContext(bool fDeterministic) noexcept | ||||
: requires_seed(!fDeterministic), bytebuf_size(0), bitbuf_size(0) { | : requires_seed(!fDeterministic), bytebuf_size(0), bitbuf_size(0) { | ||||
if (!fDeterministic) { | if (!fDeterministic) { | ||||
return; | return; | ||||
} | } | ||||
uint256 seed; | uint256 seed; | ||||
rng.SetKey(seed.begin(), 32); | rng.SetKey(seed.begin(), 32); | ||||
} | } | ||||
FastRandomContext &FastRandomContext:: | FastRandomContext & | ||||
operator=(FastRandomContext &&from) noexcept { | FastRandomContext::operator=(FastRandomContext &&from) noexcept { | ||||
requires_seed = from.requires_seed; | requires_seed = from.requires_seed; | ||||
rng = from.rng; | rng = from.rng; | ||||
std::copy(std::begin(from.bytebuf), std::end(from.bytebuf), | std::copy(std::begin(from.bytebuf), std::end(from.bytebuf), | ||||
std::begin(bytebuf)); | std::begin(bytebuf)); | ||||
bytebuf_size = from.bytebuf_size; | bytebuf_size = from.bytebuf_size; | ||||
bitbuf = from.bitbuf; | bitbuf = from.bitbuf; | ||||
bitbuf_size = from.bitbuf_size; | bitbuf_size = from.bitbuf_size; | ||||
from.requires_seed = true; | from.requires_seed = true; | ||||
Show All 11 Lines |