summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/tools/qcryptographichash.cpp4
-rw-r--r--src/corelib/tools/qcryptographichash.h6
2 files changed, 9 insertions, 1 deletions
diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp
index 55195ecd6b..f4f465a623 100644
--- a/src/corelib/tools/qcryptographichash.cpp
+++ b/src/corelib/tools/qcryptographichash.cpp
@@ -45,6 +45,10 @@
#include "../../3rdparty/sha1/sha1.cpp"
+#if defined(QT_BOOTSTRAPPED) && !defined(QT_CRYPTOGRAPHICHASH_ONLY_SHA1)
+# error "Are you sure you need the other hashing algorithms besides SHA-1?"
+#endif
+
#ifndef QT_CRYPTOGRAPHICHASH_ONLY_SHA1
// qdoc and qmake only need SHA-1
#include "../../3rdparty/md5/md5.h"
diff --git a/src/corelib/tools/qcryptographichash.h b/src/corelib/tools/qcryptographichash.h
index d4e75c4667..c4f7c3ab4a 100644
--- a/src/corelib/tools/qcryptographichash.h
+++ b/src/corelib/tools/qcryptographichash.h
@@ -55,9 +55,12 @@ class Q_CORE_EXPORT QCryptographicHash
{
public:
enum Algorithm {
+#ifndef QT_CRYPTOGRAPHICHASH_ONLY_SHA1
Md4,
Md5,
- Sha1,
+#endif
+ Sha1 = 2,
+#ifndef QT_CRYPTOGRAPHICHASH_ONLY_SHA1
Sha224,
Sha256,
Sha384,
@@ -66,6 +69,7 @@ public:
Sha3_256,
Sha3_384,
Sha3_512
+#endif
};
explicit QCryptographicHash(Algorithm method);