summaryrefslogtreecommitdiff
path: root/emsa2.h
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.h
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.h')
-rw-r--r--emsa2.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/emsa2.h b/emsa2.h
index 3a9efb07..8dc5da20 100644
--- a/emsa2.h
+++ b/emsa2.h
@@ -58,6 +58,16 @@ CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId<SHA384>;
CRYPTOPP_DLL_TEMPLATE_CLASS EMSA2HashId<SHA512>;
#endif
+// https://github.com/weidai11/cryptopp/issues/300 and
+// https://github.com/weidai11/cryptopp/issues/533
+#if defined(__clang__)
+template<> const byte EMSA2HashId<SHA1>::id;
+template<> const byte EMSA2HashId<SHA224>::id;
+template<> const byte EMSA2HashId<SHA256>::id;
+template<> const byte EMSA2HashId<SHA384>::id;
+template<> const byte EMSA2HashId<SHA512>::id;
+#endif
+
/// \class EMSA2Pad
/// \brief EMSA2 padding method
/// \since Crypto++ 5.0