3#include "../io/cryptoexception.h"
5#include <c++utilities/conversion/binaryconversion.h>
7#include <openssl/err.h>
8#include <openssl/rand.h>
35 if (RAND_bytes(buf,
sizeof(buf))) {
36 return LE::toUInt32(
reinterpret_cast<char *
>(buf));
41 while (
unsigned long errorCode = ERR_get_error()) {
42 if (!errorMsg.empty()) {
45 errorMsg += ERR_error_string(errorCode,
nullptr);
46 errorCode = ERR_get_error();
The exception that is thrown when an encryption/decryption error occurs.
std::uint32_t result_type
result_type operator()() const
Generates a new random number.
bool status() const
Returns the status.
OpenSslRandomDevice()
Constructs a new random device.
Contains utility classes and functions.