#include <mtrandapi.hpp>
|
| OPENVPN_EXCEPTION (mtrand_error) |
|
| MTRand (RandomAPI &seed) |
|
| MTRand () |
|
| MTRand (const rand_type::result_type seed) |
|
std::string | name () const override |
| Get the name of the random number generation algorithm.
|
|
void | rand_bytes (unsigned char *buf, size_t size) override |
| Fill a buffer with random bytes.
|
|
bool | rand_bytes_noexcept (unsigned char *buf, size_t size) override |
| Fill a buffer with random bytes without throwing exceptions.
|
|
rand_type::result_type | rand () |
|
Public Member Functions inherited from openvpn::RandomAPI |
template<typename T > |
void | rand_fill (T &obj) |
| Fill a data object with random bytes.
|
|
template<typename T > |
T | rand_get () |
| Create a data object filled with random bytes.
|
|
template<typename T > |
T | rand_get_positive () |
| Create a data object filled with random bytes, always >= 0 for signed types.
|
|
template<typename T > |
T | randrange (const T end) |
| Return a uniformly distributed random number in the range [0, end)
|
|
template<typename T > |
T | randrange (const T start, const T end) |
| Return a uniformly distributed random number in the range [start, end].
|
|
std::uint32_t | randrange32 (const std::uint32_t end) |
| Return a uniformly distributed random number in the range [0, end)
|
|
std::uint32_t | randrange32 (const std::uint32_t start, const std::uint32_t end) |
| Return a uniformly distributed random number in the range [start, end].
|
|
std::uint8_t | randbyte () |
| Return a random byte.
|
|
bool | randbool () |
| Return a random boolean.
|
|
result_type | operator() () |
|
| RC () noexcept=default |
|
| RC (const RC &)=delete |
|
virtual | ~RC ()=default |
|
RC & | operator= (const RC &)=delete |
|
olong | use_count () const noexcept |
| Delegates call to RCImpl and returns the result.
|
|
|
bool | rndbytes (unsigned char *buf, size_t size) |
|
Definition at line 25 of file mtrandapi.hpp.
◆ Ptr
◆ rand_type
◆ MTRand() [1/3]
◆ MTRand() [2/3]
openvpn::MTRand::MTRand |
( |
| ) |
|
|
inline |
◆ MTRand() [3/3]
openvpn::MTRand::MTRand |
( |
const rand_type::result_type |
seed | ) |
|
|
inline |
◆ gen_seed() [1/2]
static rand_type::result_type openvpn::MTRand::gen_seed |
( |
| ) |
|
|
inlinestaticprivate |
◆ gen_seed() [2/2]
static rand_type::result_type openvpn::MTRand::gen_seed |
( |
RandomAPI & |
seed | ) |
|
|
inlinestaticprivate |
◆ name()
std::string openvpn::MTRand::name |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ OPENVPN_EXCEPTION()
openvpn::MTRand::OPENVPN_EXCEPTION |
( |
mtrand_error |
| ) |
|
◆ rand()
rand_type::result_type openvpn::MTRand::rand |
( |
| ) |
|
|
inline |
◆ rand_bytes()
void openvpn::MTRand::rand_bytes |
( |
unsigned char * |
buf, |
|
|
size_t |
size |
|
) |
| |
|
inlineoverridevirtual |
Fill a buffer with random bytes.
- Parameters
-
buf | Pointer to the buffer |
size | Number of bytes to generate |
Implements openvpn::RandomAPI.
Definition at line 55 of file mtrandapi.hpp.
◆ rand_bytes_noexcept()
bool openvpn::MTRand::rand_bytes_noexcept |
( |
unsigned char * |
buf, |
|
|
size_t |
size |
|
) |
| |
|
inlineoverridevirtual |
Fill a buffer with random bytes without throwing exceptions.
- Parameters
-
buf | Pointer to the buffer |
size | Number of bytes to generate |
- Returns
- true on success
-
false on failure
Implements openvpn::RandomAPI.
Definition at line 63 of file mtrandapi.hpp.
◆ rndbytes()
bool openvpn::MTRand::rndbytes |
( |
unsigned char * |
buf, |
|
|
size_t |
size |
|
) |
| |
|
inlineprivate |
◆ rbs
◆ rng
The documentation for this class was generated from the following file: