diff options
Diffstat (limited to 'src/lib/rng/system_rng')
-rw-r--r-- | src/lib/rng/system_rng/system_rng.cpp | 12 | ||||
-rw-r--r-- | src/lib/rng/system_rng/system_rng.h | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/rng/system_rng/system_rng.cpp b/src/lib/rng/system_rng/system_rng.cpp index a503c2198..135f4fabd 100644 --- a/src/lib/rng/system_rng/system_rng.cpp +++ b/src/lib/rng/system_rng/system_rng.cpp @@ -38,9 +38,9 @@ class System_RNG_Impl final : public RandomNumberGenerator void clear() override {} - void randomize(Botan::byte out[], size_t len) override; + void randomize(uint8_t out[], size_t len) override; - void add_entropy(const byte in[], size_t length) override; + void add_entropy(const uint8_t in[], size_t length) override; std::string name() const override; @@ -90,7 +90,7 @@ System_RNG_Impl::~System_RNG_Impl() #endif } -void System_RNG_Impl::add_entropy(const byte input[], size_t len) +void System_RNG_Impl::add_entropy(const uint8_t input[], size_t len) { #if defined(BOTAN_TARGET_OS_HAS_CRYPTGENRANDOM) /* @@ -102,14 +102,14 @@ void System_RNG_Impl::add_entropy(const byte input[], size_t len) for(size_t i = 0; i != len; ++i) { - byte b = input[i]; + uint8_t b = input[i]; ::CryptGenRandom(m_prov, 1, &b); } */ if(len > 0) { - secure_vector<byte> buf(input, input + len); + secure_vector<uint8_t> buf(input, input + len); ::CryptGenRandom(m_prov, static_cast<DWORD>(buf.size()), buf.data()); } #else @@ -144,7 +144,7 @@ void System_RNG_Impl::add_entropy(const byte input[], size_t len) #endif } -void System_RNG_Impl::randomize(byte buf[], size_t len) +void System_RNG_Impl::randomize(uint8_t buf[], size_t len) { #if defined(BOTAN_TARGET_OS_HAS_CRYPTGENRANDOM) ::CryptGenRandom(m_prov, static_cast<DWORD>(len), buf); diff --git a/src/lib/rng/system_rng/system_rng.h b/src/lib/rng/system_rng/system_rng.h index a789631d6..9cf31e78b 100644 --- a/src/lib/rng/system_rng/system_rng.h +++ b/src/lib/rng/system_rng/system_rng.h @@ -27,9 +27,9 @@ class BOTAN_DLL System_RNG final : public RandomNumberGenerator public: std::string name() const override { return system_rng().name(); } - void randomize(Botan::byte out[], size_t len) override { system_rng().randomize(out, len); } + void randomize(uint8_t out[], size_t len) override { system_rng().randomize(out, len); } - void add_entropy(const byte in[], size_t length) override { system_rng().add_entropy(in, length); } + void add_entropy(const uint8_t in[], size_t length) override { system_rng().add_entropy(in, length); } bool is_seeded() const override { return true; } |