3 #include "../io/cryptoexception.h"
5 #include <c++utilities/conversion/binaryconversion.h>
7 #include <openssl/err.h>
8 #include <openssl/rand.h>
25 OpenSslRandomDevice::OpenSslRandomDevice()
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();
54 bool OpenSslRandomDevice::status()
const