diff options
author | Jack Lloyd <[email protected]> | 2016-07-03 14:36:55 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-07-17 10:43:41 -0400 |
commit | cae7a66072905bc264ecf0805a8738a674ff2986 (patch) | |
tree | f10d8a79a6ce4be3992da74c6bd1e66a10709d0f /src/lib/entropy/cryptoapi_rng/es_capi.h | |
parent | ee1b5c7e8513b3b97efa87720154d8ca24774eba (diff) |
Revamp entropy polling
Remove Entropy_Accumulator, instead have entropy sources directly
add entropy to the RNG.
Diffstat (limited to 'src/lib/entropy/cryptoapi_rng/es_capi.h')
-rw-r--r-- | src/lib/entropy/cryptoapi_rng/es_capi.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/lib/entropy/cryptoapi_rng/es_capi.h b/src/lib/entropy/cryptoapi_rng/es_capi.h index b1c60bfa1..82a779672 100644 --- a/src/lib/entropy/cryptoapi_rng/es_capi.h +++ b/src/lib/entropy/cryptoapi_rng/es_capi.h @@ -21,15 +21,21 @@ class Win32_CAPI_EntropySource final : public Entropy_Source public: std::string name() const override { return "win32_cryptoapi"; } - void poll(Entropy_Accumulator& accum) override; + size_t poll(RandomNumberGenerator& rng) override; - /** - * Win32_Capi_Entropysource Constructor - * @param provs list of providers, separated by ':' - */ + /** + * Win32_Capi_Entropysource Constructor + * @param provs list of providers, separated by ':' + */ explicit Win32_CAPI_EntropySource(const std::string& provs = ""); + + class CSP_Handle + { + public: + virtual size_t gen_random(byte out[], size_t n) const = 0; + }; private: - std::vector<u64bit> m_prov_types; + std::vector<std::unique_ptr<CSP_Handle>> m_csp_provs; }; } |