surtur
03578f9016
All checks were successful
continuous-integration/drone/push Build is passing
* add event_scheduler_impl.h and properly override its base class * add urandom_entropy_src.cpp, move there logic from header * add urandom_entropy_src.cpp to CMakeLists.txt * add unique_ptr per impl: one for both EventSchedulerImpl and EventAdderImpl each * wrap a call in reinterpret_cast and reformat code * add missing includes (best effort)
33 lines
671 B
C++
33 lines
671 B
C++
#ifndef FORTUNA_URANDOM_ENTROPY_SRC_H
|
|
#define FORTUNA_URANDOM_ENTROPY_SRC_H
|
|
|
|
#include "entropy_src.h"
|
|
#include "event_adder_impl.h"
|
|
#include "event_scheduler_impl.h"
|
|
|
|
#include <fmt/core.h>
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <fstream>
|
|
#include <vector>
|
|
|
|
namespace fortuna {
|
|
namespace accumulator {
|
|
|
|
class UrandomEntropySrc : public EntropySrc {
|
|
private:
|
|
static std::vector<char> bytes;
|
|
|
|
public:
|
|
auto schedule(accumulator::EventSchedulerImpl scheduler) -> void;
|
|
|
|
auto event(accumulator::EventAdderImpl adder) -> void;
|
|
|
|
auto urandom_entropy_src_service() -> int;
|
|
};
|
|
|
|
} // namespace accumulator
|
|
} // namespace fortuna
|
|
#endif // FORTUNA_URANDOM_ENTROPY_SRC_H
|