diff --git a/src/crypto/CryptoHash.cpp b/src/crypto/CryptoHash.cpp index 5c56a3a74..31c0c934e 100644 --- a/src/crypto/CryptoHash.cpp +++ b/src/crypto/CryptoHash.cpp @@ -19,6 +19,8 @@ #include +#include "crypto/Crypto.h" + class CryptoHashPrivate { public: @@ -31,6 +33,8 @@ CryptoHash::CryptoHash(CryptoHash::Algorithm algo) { Q_D(CryptoHash); + Q_ASSERT(Crypto::initalized()); + int algoGcrypt; switch (algo) { diff --git a/src/crypto/Random.cpp b/src/crypto/Random.cpp index d84106ec0..a8cd0c5a8 100644 --- a/src/crypto/Random.cpp +++ b/src/crypto/Random.cpp @@ -19,6 +19,8 @@ #include +#include "crypto/Crypto.h" + void Random::randomize(QByteArray& ba) { randomize(ba.data(), ba.size()); @@ -48,6 +50,8 @@ quint32 Random::randomUIntRange(quint32 min, quint32 max) void Random::randomize(void* data, int len) { + Q_ASSERT(Crypto::initalized()); + gcry_randomize(data, len, GCRY_STRONG_RANDOM); }