Clang 3.8 and above generates lots of "'PKCS_DigestDecoration<SHA1>::decoration' required here, but no definition is available" warningspull/552/head
parent
c0a8dab984
commit
b7133e7b3b
|
|
@ -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,
|
||||
|
|
|
|||
10
emsa2.h
10
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
|
||||
|
|
|
|||
|
|
@ -53,12 +53,6 @@ template<> const unsigned int PKCS_DigestDecoration<SHA3_384>::length = (unsigne
|
|||
|
||||
template<> const byte PKCS_DigestDecoration<SHA3_512>::decoration[] = {0x30,0x51,0x30,0x0d, 0x06,0x09,0x60,0x86, 0x48,0x01,0x65,0x03, 0x04,0x02,0x0a,0x05, 0x00,0x04,0x40};
|
||||
template<> const unsigned int PKCS_DigestDecoration<SHA3_512>::length = (unsigned int)sizeof(PKCS_DigestDecoration<SHA3_512>::decoration);
|
||||
|
||||
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
|
||||
|
||||
size_t PKCS_EncryptionPaddingScheme::MaxUnpaddedLength(size_t paddedLength) const
|
||||
|
|
|
|||
28
pkcspad.h
28
pkcspad.h
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue