3 #include "../io/cryptoexception.h" 5 #include <c++utilities/conversion/binaryconversion.h> 7 #include <openssl/rand.h> 8 #include <openssl/err.h> 29 OpenSslRandomDevice::OpenSslRandomDevice()
35 uint32 OpenSslRandomDevice::operator ()()
const {
37 if(RAND_bytes(buf,
sizeof(buf))) {
38 return ConversionUtilities::LE::toUInt32(reinterpret_cast<char *>(buf));
41 unsigned long errorCode = ERR_get_error();
42 while(errorCode != 0) {
46 msg += ERR_error_string(errorCode, 0);
47 errorCode = ERR_get_error();
56 bool OpenSslRandomDevice::status()
const
Contains utility classes and functions.
The exception that is thrown when an encryption/decryption error occurs.