diff options
author | Jack Lloyd <[email protected]> | 2020-09-21 11:17:55 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2020-09-21 11:17:55 -0400 |
commit | cf63241639cf8935c0c0a9fcbb4ccdaf9148dfe9 (patch) | |
tree | 7bbf1527fb9337df0b531708e751f699d9b1b206 /src/lib/rng/rng.h | |
parent | f7561d261a3e1939006dbc305f9a0e74f0c6809f (diff) |
The add_entropy_T function only works with POD - check this
Diffstat (limited to 'src/lib/rng/rng.h')
-rw-r--r-- | src/lib/rng/rng.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/rng/rng.h b/src/lib/rng/rng.h index 86cf9c9dd..b02c27d64 100644 --- a/src/lib/rng/rng.h +++ b/src/lib/rng/rng.h @@ -11,6 +11,7 @@ #include <botan/secmem.h> #include <botan/exceptn.h> #include <botan/mutex.h> +#include <type_traits> #include <chrono> #include <string> @@ -67,6 +68,7 @@ class BOTAN_PUBLIC_API(2,0) RandomNumberGenerator */ template<typename T> void add_entropy_T(const T& t) { + static_assert(std::is_pod<T>::value, "add_entropy_T data must be POD"); this->add_entropy(reinterpret_cast<const uint8_t*>(&t), sizeof(T)); } |