diff --git a/Source/RNG/AuRNGEntropy.cpp b/Source/RNG/AuRNGEntropy.cpp index 97d28d74..c7178828 100644 --- a/Source/RNG/AuRNGEntropy.cpp +++ b/Source/RNG/AuRNGEntropy.cpp @@ -174,7 +174,11 @@ namespace Aurora::RNG #if 0 return clock(); // [...] resolution of 1 posix clock() tick (this is usually 1,000,000 == CLOCKS_PER_SEC per posix, but it can be 1k) #else - return AuTime::SteadyClockNS() / 10'000ull; + static AuUInt64 gTimeHolder; + static AuUInt64 gTime = (gTimeHolder = AuTime::SteadyClockJiffies()) >= 10'000'000ull ? + 1 : + (10'000'000ull / AuPageRoundUp(gTimeHolder, 1024)); + return AuTime::SteadyClockNS() * gTime / 10'000ull; #endif } @@ -213,6 +217,7 @@ namespace Aurora::RNG // ...but still, let's continue. // Deadlocking preprocess init, because for example the motherboard is failing or a VM configuration changed, is pretty dumb. // (ask me how i know) + // Update oct: it scales with whatever frequency user-land clocks can be trusted with, per the respective kernels' HAL (viso, kshared user data, etc). } while (a == b); // ensure theres enough entropy for a deviation to occur acc = (acc << 1) | a; // push the first bit state