Searched refs:PRNG (Results 1 - 7 of 7) sorted by relevance

/fuchsia/zircon/kernel/lib/crypto/include/lib/crypto/
H A Dglobal_prng.h15 // Returns a pointer to the global PRNG singleton. The pointer is
17 PRNG* GetInstance();
H A Dprng.h23 // This exposes a (optionally-)thread-safe cryptographically secure PRNG.
24 // This PRNG must be seeded with at least 256 bits of "real" entropy before
26 class PRNG { class in namespace:crypto
31 // Construct a thread-safe instance of the PRNG with the byte array at
33 PRNG(const void* data, size_t size);
35 // Construct a non-thread-safe instance of the PRNG with the byte array at
37 PRNG(const void* data, size_t size, NonThreadSafeTag);
39 ~PRNG();
41 // Re-seed the PRNG by mixing-in new entropy. |size| is in bytes. |data|
48 // kMinEntropy bytes of entropy have been added to this PRNG
[all...]
/fuchsia/zircon/kernel/lib/crypto/
H A Dglobal_prng_unittest.cpp18 PRNG* prng1 = GlobalPRNG::GetInstance();
19 PRNG* prng2 = GlobalPRNG::GetInstance();
32 "Validate global PRNG singleton");
H A Dprng.cpp30 PRNG::PRNG(const void* data, size_t size) function in class:crypto::PRNG
31 : PRNG(data, size, NonThreadSafeTag()) {
35 PRNG::PRNG(const void* data, size_t size, NonThreadSafeTag tag) function in class:crypto::PRNG
42 PRNG::~PRNG() {
47 void PRNG::AddEntropy(const void* data, size_t size) {
56 // We mix all of the entropy with the previous key to make the PRNG state
78 void PRNG
[all...]
H A Dglobal_prng.cpp34 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 stat
[all...]
H A Dprng_unittest.cpp18 { PRNG prng("", 0); }
32 PRNG prng1(kSeed1, kSeed1Size, PRNG::NonThreadSafeTag());
33 PRNG prng2(kSeed1, kSeed1Size);
35 EXPECT_FALSE(prng1.is_thread_safe(), "unexpected PRNG state");
36 EXPECT_TRUE(prng2.is_thread_safe(), "unexpected PRNG state");
55 EXPECT_TRUE(prng1.is_thread_safe(), "unexpected PRNG state");
71 PRNG prng1(kSeed1, kSeed1Size);
75 PRNG prng2(kSeed1, kSeed1Size);
84 // negligible. Also this test is fully deterministic for one given PRNG
[all...]
/fuchsia/zircon/kernel/vm/include/vm/
H A Dvm_aspace.h162 // Expose the PRNG for ASLR to VmAddressRegion
163 crypto::PRNG& AslrPrng() {
205 // PRNG used by VMARs for address choices. We record the seed to enable
207 crypto::PRNG aslr_prng_;
208 uint8_t aslr_seed_[crypto::PRNG::kMinEntropy];

Completed in 84 milliseconds