diff options
author | Jeffrey Walton <noloader@gmail.com> | 2017-12-26 00:46:50 -0500 |
---|---|---|
committer | Jeffrey Walton <noloader@gmail.com> | 2017-12-26 00:46:50 -0500 |
commit | b7133e7b3b25ad15810ec90911b0bd01a2ff5ad6 (patch) | |
tree | 00fcaa836260218bdf9c09d3da1614af5b5e203e /pkcspad.h | |
parent | c0a8dab984d1214a76b6116a02baf1021bf7dc73 (diff) | |
download | cryptopp-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 'pkcspad.h')
-rw-r--r-- | pkcspad.h | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -56,6 +56,34 @@ CRYPTOPP_DLL_TEMPLATE_CLASS PKCS_DigestDecoration<SHA3_384>; CRYPTOPP_DLL_TEMPLATE_CLASS PKCS_DigestDecoration<SHA3_512>;
#endif
+// https://github.com/weidai11/cryptopp/issues/300 and
+// https://github.com/weidai11/cryptopp/issues/533
+#if defined(__clang__)
+template<> const byte PKCS_DigestDecoration<SHA1>::decoration[];
+template<> const unsigned int PKCS_DigestDecoration<SHA1>::length;
+template<> const byte PKCS_DigestDecoration<SHA224>::decoration[];
+template<> const unsigned int PKCS_DigestDecoration<SHA224>::length;
+template<> const byte PKCS_DigestDecoration<SHA256>::decoration[];
+template<> const unsigned int PKCS_DigestDecoration<SHA256>::length;
+template<> const byte PKCS_DigestDecoration<SHA384>::decoration[];
+template<> const unsigned int PKCS_DigestDecoration<SHA384>::length;
+template<> const byte PKCS_DigestDecoration<SHA512>::decoration[];
+template<> const unsigned int PKCS_DigestDecoration<SHA512>::length;
+
+// http://github.com/weidai11/cryptopp/issues/517
+template<> const byte PKCS_DigestDecoration<SHA3_256>::decoration[];
+template<> const unsigned int PKCS_DigestDecoration<SHA3_256>::length;
+template<> const byte PKCS_DigestDecoration<SHA3_384>::decoration[];
+template<> const unsigned int PKCS_DigestDecoration<SHA3_384>::length;
+template<> const byte PKCS_DigestDecoration<SHA3_512>::decoration[];
+template<> const unsigned int PKCS_DigestDecoration<SHA3_512>::length;
+
+template<> const byte PKCS_DigestDecoration<Weak1::MD2>::decoration[];
+template<> const unsigned int PKCS_DigestDecoration<Weak1::MD2>::length;
+template<> const byte PKCS_DigestDecoration<Weak1::MD5>::decoration[];
+template<> const unsigned int PKCS_DigestDecoration<Weak1::MD5>::length;
+#endif
+
/// \class PKCS1v15_SignatureMessageEncodingMethod
/// \brief PKCS #1 v1.5 Signature Encoding Scheme
/// \sa <a href="http://www.weidai.com/scan-mirror/sig.html#sem_PKCS1-1.5">EMSA-PKCS1-v1_5</a>
|