This repository has been archived on 2022-02-10. You can view files and clone it, but cannot push or open issues or pull requests.
fortuna/urandom_entropy_src.h
surtur 8cfb49e486
All checks were successful
continuous-integration/drone/push Build is passing
fix(-Wsuggest-override): override virtual base fun
2022-02-03 01:17:47 +01:00

35 lines
664 B
C++

#ifndef FORTUNA_URANDOM_ENTROPY_SRC_H
#define FORTUNA_URANDOM_ENTROPY_SRC_H
#include "entropy_src.h"
#include "event_adder_impl.h"
#include <fmt/core.h>
#include <cstddef>
#include <cstdint>
#include <fstream>
#include <mutex>
#include <vector>
namespace fortuna {
namespace accumulator {
class UrandomEntropySrc : public EntropySrc {
private:
std::vector<char> bytes{0};
std::mutex mtx;
public:
auto event(accumulator::EventAdderImpl& adder) -> void override;
auto urandom_entropy_src_service() -> int;
UrandomEntropySrc();
~UrandomEntropySrc() noexcept;
};
} // namespace accumulator
} // namespace fortuna
#endif // FORTUNA_URANDOM_ENTROPY_SRC_H