Typedefs | |
using | RandomNumberEngine = std::mt19937 |
Functions | |
void | generateSecureBytes (span< uint8_t > buffer) |
Fill buffer with cryptographically secure random bytes. More... | |
uint32_t | generateSecureWord32 () |
Generate a cryptographically secure random integer in the range [0, 2^32) . More... | |
uint64_t | generateSecureWord64 () |
Generate a cryptographically secure random integer in the range [0, 2^64) . More... | |
uint32_t | generateWord32 () |
Generate a non-cryptographically-secure random integer in the range [0, 2^32) . More... | |
uint64_t | generateWord64 () |
Generate a non-cryptographically-secure random integer in the range [0, 2^64) . More... | |
RandomNumberEngine & | getRandomNumberEngine () |
Returns a reference to a thread-local instance of a properly seeded PRNG. More... | |
using ndn::random::RandomNumberEngine = typedef std::mt19937 |
Definition at line 56 of file random.hpp.
void ndn::random::generateSecureBytes | ( | span< uint8_t > | buffer | ) |
Fill buffer
with cryptographically secure random bytes.
std::runtime_error | if generation fails. |
Definition at line 47 of file random.cpp.
uint32_t ndn::random::generateSecureWord32 | ( | ) |
Generate a cryptographically secure random integer in the range [0, 2^32)
.
std::runtime_error | if generation fails. |
Definition at line 31 of file random.cpp.
uint64_t ndn::random::generateSecureWord64 | ( | ) |
Generate a cryptographically secure random integer in the range [0, 2^64)
.
std::runtime_error | if generation fails. |
Definition at line 39 of file random.cpp.
uint32_t ndn::random::generateWord32 | ( | ) |
Generate a non-cryptographically-secure random integer in the range [0, 2^32)
.
This version is faster than generateSecureWord32(), but it must not be used when cryptographically secure random integers are needed (e.g., when creating signing or encryption keys).
Definition at line 68 of file random.cpp.
uint64_t ndn::random::generateWord64 | ( | ) |
Generate a non-cryptographically-secure random integer in the range [0, 2^64)
.
This version is faster than generateSecureWord64(), but it must not be used when cryptographically secure random integers are needed (e.g., when creating signing or encryption keys).
Definition at line 75 of file random.cpp.
RandomNumberEngine & ndn::random::getRandomNumberEngine | ( | ) |
Returns a reference to a thread-local instance of a properly seeded PRNG.
Definition at line 56 of file random.cpp.