Add 64 bits of entropy gathered from hardware to hasher. Do nothing if not supported. */
| 197 | |
| 198 | /** Add 64 bits of entropy gathered from hardware to hasher. Do nothing if not supported. */ |
| 199 | void 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. */ |
| 210 | void SeedHardwareSlow(CSHA512& hasher) noexcept { |