MCPcopy Create free account
hub / github.com/ElementsProject/elements / randbytes

Method randbytes

src/random.cpp:623–631  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

621}
622
623std::vector<unsigned char> FastRandomContext::randbytes(size_t len)
624{
625 if (requires_seed) RandomSeed();
626 std::vector<unsigned char> ret(len);
627 if (len > 0) {
628 rng.Keystream(ret.data(), len);
629 }
630 return ret;
631}
632
633FastRandomContext::FastRandomContext(const uint256& seed) noexcept : requires_seed(false), bytebuf_size(0), bitbuf_size(0)
634{

Callers 10

BOOST_AUTO_TEST_CASEFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
FUZZ_TARGETFunction · 0.80
RandAddrFunction · 0.80
MuHashMulFunction · 0.80
MuHashDivFunction · 0.80
MuHashPrecomputeFunction · 0.80
CreateAddressesFunction · 0.80
GetUniquePathFunction · 0.80

Calls 3

RandomSeedFunction · 0.85
KeystreamMethod · 0.80
dataMethod · 0.45

Tested by 5

BOOST_AUTO_TEST_CASEFunction · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64
FUZZ_TARGETFunction · 0.64
RandAddrFunction · 0.64