Lines Matching refs:PRNG
34 static PRNG* kGlobalPrng = nullptr;
36 PRNG* GetInstance() {
41 // Returns true if the kernel cmdline provided at least PRNG::kMinEntropy bytes
80 return (entropy_added >= PRNG::kMinEntropy);
85 uint8_t buf[PRNG::kMinEntropy] = {0};
86 size_t remaining = collector->BytesNeeded(8 * PRNG::kMinEntropy);
114 // Instantiates the global PRNG (in non-thread-safe mode) and seeds it.
124 // Statically allocate an array of bytes to put the PRNG into. We do this
125 // to control when the PRNG constructor is called.
126 // TODO(security): This causes the PRNG state to be in a fairly predictable
129 alignas(alignof(PRNG))static uint8_t prng_space[sizeof(PRNG)];
130 kGlobalPrng = new (&prng_space) PRNG(nullptr, 0, PRNG::NonThreadSafeTag());
132 // TODO(security): Have the PRNG reseed based on usage
156 uint8_t buf[PRNG::kMinEntropy] = {0};
165 // Migrate the global PRNG to enter thread-safe mode.