summaryrefslogtreecommitdiff
path: root/emsa2.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-12-26 00:46:50 -0500
committerJeffrey Walton <noloader@gmail.com>2017-12-26 00:46:50 -0500
commitb7133e7b3b25ad15810ec90911b0bd01a2ff5ad6 (patch)
tree00fcaa836260218bdf9c09d3da1614af5b5e203e /emsa2.cpp
parentc0a8dab984d1214a76b6116a02baf1021bf7dc73 (diff)
downloadcryptopp-git-b7133e7b3b25ad15810ec90911b0bd01a2ff5ad6.tar.gz
Fix Clang specialization and definition warnings (GH #300, GH #533)
Clang 3.8 and above generates lots of "'PKCS_DigestDecoration<SHA1>::decoration' required here, but no definition is available" warnings
Diffstat (limited to 'emsa2.cpp')
-rw-r--r--emsa2.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/emsa2.cpp b/emsa2.cpp
index 1cde59c5..dd5173dd 100644
--- a/emsa2.cpp
+++ b/emsa2.cpp
@@ -7,6 +7,15 @@
NAMESPACE_BEGIN(CryptoPP)
+// Inclusion based on DLL due to Clang, http://github.com/weidai11/cryptopp/issues/300
+#ifndef CRYPTOPP_IS_DLL
+template<> const byte EMSA2HashId<SHA1>::id = 0x33;
+template<> const byte EMSA2HashId<SHA224>::id = 0x38;
+template<> const byte EMSA2HashId<SHA256>::id = 0x34;
+template<> const byte EMSA2HashId<SHA384>::id = 0x36;
+template<> const byte EMSA2HashId<SHA512>::id = 0x35;
+#endif
+
void EMSA2Pad::ComputeMessageRepresentative(RandomNumberGenerator& /*rng*/,
const byte* recoverableMessage, size_t recoverableMessageLength,
HashTransformation &hash, HashIdentifier hashIdentifier, bool messageEmpty,