MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / SeedHardwareFast

Function SeedHardwareFast

src/random.cpp:199–207  ·  view source on GitHub ↗

Add 64 bits of entropy gathered from hardware to hasher. Do nothing if not supported. */

Source from the content-addressed store, hash-verified

197
198/** Add 64 bits of entropy gathered from hardware to hasher. Do nothing if not supported. */
199void SeedHardwareFast(CSHA512& hasher) noexcept {
200#if defined(__x86_64__) || defined(__amd64__) || defined(__i386__)
201 if (g_rdrand_supported) {
202 uint64_t out = GetRdRand();
203 hasher.Write((const unsigned char*)&out, sizeof(out));
204 return;
205 }
206#endif
207}
208
209/** Add 256 bits of entropy gathered from hardware to hasher. Do nothing if not supported. */
210void SeedHardwareSlow(CSHA512& hasher) noexcept {

Callers 1

SeedFastFunction · 0.85

Calls 2

GetRdRandFunction · 0.85
WriteMethod · 0.45

Tested by

no test coverage detected