2018-06-09 22:30:07 +02:00
|
|
|
#ifndef PASSWORD_FILE_UTIL_OPENSSLRANDOMDEVICE_H
|
|
|
|
#define PASSWORD_FILE_UTIL_OPENSSLRANDOMDEVICE_H
|
2015-04-22 19:06:29 +02:00
|
|
|
|
2016-08-29 15:42:07 +02:00
|
|
|
#include "../global.h"
|
|
|
|
|
2019-03-13 19:08:30 +01:00
|
|
|
#include <cstdint>
|
2018-06-09 19:47:50 +02:00
|
|
|
#include <limits>
|
|
|
|
|
2015-04-22 19:06:29 +02:00
|
|
|
namespace Util {
|
|
|
|
|
2017-05-01 03:25:30 +02:00
|
|
|
class PASSWORD_FILE_EXPORT OpenSslRandomDevice {
|
2015-04-22 19:06:29 +02:00
|
|
|
public:
|
2019-03-13 19:08:30 +01:00
|
|
|
using result_type = std::uint32_t;
|
2018-06-09 19:47:50 +02:00
|
|
|
|
2015-04-22 19:06:29 +02:00
|
|
|
OpenSslRandomDevice();
|
2018-12-18 23:17:19 +01:00
|
|
|
result_type operator()() const;
|
2015-04-22 19:06:29 +02:00
|
|
|
bool status() const;
|
2018-06-09 19:47:50 +02:00
|
|
|
static constexpr result_type min();
|
|
|
|
static constexpr result_type max();
|
2015-04-22 19:06:29 +02:00
|
|
|
};
|
2018-06-09 19:47:50 +02:00
|
|
|
|
|
|
|
constexpr OpenSslRandomDevice::result_type OpenSslRandomDevice::min()
|
|
|
|
{
|
|
|
|
return std::numeric_limits<result_type>::min();
|
|
|
|
}
|
|
|
|
|
|
|
|
constexpr OpenSslRandomDevice::result_type OpenSslRandomDevice::max()
|
|
|
|
{
|
|
|
|
return std::numeric_limits<result_type>::max();
|
|
|
|
}
|
|
|
|
|
2018-03-20 20:11:31 +01:00
|
|
|
} // namespace Util
|
2015-04-22 19:06:29 +02:00
|
|
|
|
2018-06-09 22:30:07 +02:00
|
|
|
#endif // PASSWORD_FILE_UTIL_OPENSSLRANDOMDEVICE_H
|