Add 64 bits of entropy gathered from hardware to hasher. Do nothing if not supported. */
| 186 | |
| 187 | /** Add 64 bits of entropy gathered from hardware to hasher. Do nothing if not supported. */ |
| 188 | static void SeedHardwareFast(CSHA512& hasher) noexcept { |
| 189 | #if defined(__x86_64__) || defined(__amd64__) || defined(__i386__) |
| 190 | if (g_rdrand_supported) { |
| 191 | uint64_t out = GetRdRand(); |
| 192 | hasher.Write((const unsigned char*)&out, sizeof(out)); |
| 193 | return; |
| 194 | } |
| 195 | #endif |
| 196 | } |
| 197 | |
| 198 | /** Add 256 bits of entropy gathered from hardware to hasher. Do nothing if not supported. */ |
| 199 | static void SeedHardwareSlow(CSHA512& hasher) noexcept { |