/* * Library Internal/Global State * (C) 1999-2008 Jack Lloyd * * Distributed under the terms of the Botan license */ #ifndef BOTAN_LIB_STATE_H__ #define BOTAN_LIB_STATE_H__ #include #include #include #include #include #include #include #include namespace Botan { /** * Global Library State */ class BOTAN_DLL Library_State { public: Library_State() {} Library_State(const Library_State&) = delete; Library_State& operator=(const Library_State&) = delete; void initialize(); /** * @return global Algorithm_Factory */ Algorithm_Factory& algorithm_factory() const; /** * @return global RandomNumberGenerator */ RandomNumberGenerator& global_rng(); void poll_available_sources(class Entropy_Accumulator& accum); private: static std::vector> entropy_sources(); std::unique_ptr m_global_prng; std::mutex m_entropy_src_mutex; std::vector> m_sources; std::unique_ptr m_algorithm_factory; }; } #endif