| 79 | static bool rdrand_supported = false; |
| 80 | static constexpr uint32_t CPUID_F1_ECX_RDRAND = 0x40000000; |
| 81 | static void RDRandInit() |
| 82 | { |
| 83 | uint32_t eax, ebx, ecx, edx; |
| 84 | if (__get_cpuid(1, &eax, &ebx, &ecx, &edx) && (ecx & CPUID_F1_ECX_RDRAND)) { |
| 85 | LogPrintf("Using RdRand as an additional entropy source\n"); |
| 86 | rdrand_supported = true; |
| 87 | } |
| 88 | hwrand_initialized.store(true); |
| 89 | } |
| 90 | #else |
| 91 | static void RDRandInit() {} |
| 92 | #endif |