Recent versions of clang warn about missing PKCS_DigestDecoration
definitions, specifically the decoration members. For example:
In file included from testpkcs.cpp:8:
./pkcspad.h:89:53: warning: instantiation of variable 'CryptoPP::PKCS_DigestDecoration<CryptoPP::SHA1>::decoration' required here, but no definition is available [-Wundefined-var-template]
return HashIdentifier(PKCS_DigestDecoration<H>::decoration, (size_t)PKCS_DigestDecoration<H>::length);
^
./pubkey.h:608:19: note: in instantiation of member function 'CryptoPP::PKCS1v15_SignatureMessageEncodingMethod::HashIdentifierLookup::HashIdentifierLookup2<CryptoPP::SHA1>::Lookup' requested here
return L::Lookup();
^
./pubkey.h:638:26: note: in instantiation of member function 'CryptoPP::TF_ObjectImplBase<CryptoPP::TF_VerifierBase, CryptoPP::TF_SignatureSchemeOptions<CryptoPP::TF_SS<CryptoPP::PKCS1v15, CryptoPP::SHA1, CryptoPP::RSA, int
CryptoPP::RSA, CryptoPP::PKCS1v15_SignatureMessageEncodingMethod, CryptoPP::SHA1>, CryptoPP::RSAFunction>::GetHashIdentifier' requested here
class CRYPTOPP_NO_VTABLE TF_ObjectImpl : public TF_ObjectImplBase<BASE, SCHEME_OPTIONS, KEY_CLASS>
^
./pkcspad.h:32:20: note: forward declaration of template entity is here
static const byte decoration[];
^
This is because pkcspad.h doen't contain explicit instantiation
declarations for PKCS_DigestDecoration. These warnings can be fixed by
adding them in the !CRYPTOPP_IS_DLL case, which appears to apply only to
Windows.
This is the generated error with CLANG 64-bit:
[bcc64 Error] pkcspad.h(79): call to constructor of 'HashIdentifier' (aka 'pair<const byte *, size_t>') is ambiguous
Casting the second parameter as size_t will fix the problem. This fix is not required in C++Builder XE7 and XE8, it must have been fixed.