#include <rand.hpp>
|
| | OPENVPN_EXCEPTION (rand_error_apple) |
| |
| | AppleRandom ()=default |
| |
| 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.
|
| |
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 24 of file rand.hpp.
◆ Ptr
◆ AppleRandom()
| openvpn::AppleRandom::AppleRandom |
( |
| ) |
|
|
default |
◆ name()
| std::string openvpn::AppleRandom::name |
( |
| ) |
const |
|
inlineoverridevirtual |
Get the name of the random number generation algorithm.
- Returns
- The name of the algorithm
Implements openvpn::RandomAPI.
Definition at line 33 of file rand.hpp.
◆ OPENVPN_EXCEPTION()
| openvpn::AppleRandom::OPENVPN_EXCEPTION |
( |
rand_error_apple |
| ) |
|
◆ rand_bytes()
| void openvpn::AppleRandom::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 39 of file rand.hpp.
◆ rand_bytes_noexcept()
| bool openvpn::AppleRandom::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 47 of file rand.hpp.
◆ rndbytes()
| bool openvpn::AppleRandom::rndbytes |
( |
unsigned char * |
buf, |
|
|
size_t |
size |
|
) |
| |
|
inlineprivate |
The documentation for this class was generated from the following file: