============================================================================= Include Standard Template Library. Watcom C++ 11.0 doesn`t contain STL. My preference is STLport, which is build upon the SGI STL public distribution. For more info look at the page http://www.metabyte.com/~fbp/stl/index.html maintained by Boris Fomitchev . Crypto++ tested with STLport v3.0 and v3.01. No changes necessary to STLport. ----------------------------------------------------------------------------- change in config.h line 14 from #ifdef __GNUC__ to #if defined(__GNUC__) || defined(__WATCOM_CPLUSPLUS__) line 20 from #ifdef __GNUC__ to #if defined(__GNUC__) || defined(__WATCOM_CPLUSPLUS__) line 97 from #ifdef _MSC_VER to #if defined(_MSC_VER) || defined(__WATCOM_CPLUSPLUS__) lines 109,110,111,112 from #elif defined(_MSC_VER) typedef unsigned __int32 word; typedef unsigned __int64 dword; #else to #elif defined(_MSC_VER) || defined(__WATCOM_CPLUSPLUS__) typedef word32 word; typedef word64 dword; #else ----------------------------------------------------------------------------- change in cryptlib.h (include string from STL, don`t use std::exception) lines 10,11,12,13,14 from #include #include /// base class for all exceptions thrown by Crypto++ class CryptlibException : public std::exception to #if !defined(__WATCOM_CPLUSPLUS__) #include #include #else #include "stl_config.h" #include "rope.h" typedef crope string; #endif /// base class for all exceptions thrown by Crypto++ class CryptlibException #if !defined(__WATCOM_CPLUSPLUS__) : public std::exception #endif ----------------------------------------------------------------------------- change in misc.h line 141 from #ifndef _MSC_VER to #if !(defined(_MSC_VER) || defined(__WATCOM_CPLUSPLUS__)) line 227 from friend void swap(SecBlock &a, SecBlock &b) {a.swap(b);} to #if !defined(__WATCOM_CPLUSPLUS__) friend void swap(SecBlock &a, SecBlock &b) {a.swap(b);} #else void swap(SecBlock &a, SecBlock &b) {a.swap(b);} #endif ----------------------------------------------------------------------------- change in rabin.h (Watcom C++ cannot handle default template parameters) lines 41, 42 from class RabinPrivateKey : public DecryptorTemplate, InvertableRabinFunction>, public SignerTemplate, InvertableRabinFunction> to class RabinPrivateKey : public DecryptorTemplate, InvertableRabinFunction>, public SignerTemplate, InvertableRabinFunction> lines 58, 59 from class RabinPublicKey : public EncryptorTemplate, RabinFunction>, public VerifierTemplate, RabinFunction> to class RabinPublicKey : public EncryptorTemplate, RabinFunction>, public VerifierTemplate, RabinFunction> ----------------------------------------------------------------------------- change in zinflate.h lines 23,24 from private: struct huft { to //private: struct huft { lines 31,32,33 from }; int huft_build (unsigned *, unsigned, unsigned, const word16 *, const word16 *, to }; private: int huft_build (unsigned *, unsigned, unsigned, const word16 *, const word16 *, ----------------------------------------------------------------------------- change in algebra.cpp (otherwise compiler crashes) lines 15, 16, 17, 18 from template T AbstractGroup::Subtract(const Element &a, const Element &b) const { return Add(a, Inverse(b)); } to template T AbstractGroup::Subtract(const Element &a, const Element &b) const { #if !defined(__WATCOM_CPLUSPLUS__) return Add(a, Inverse(b)); #else Element x = Inverse(b); return Add(a, x); #endif } ----------------------------------------------------------------------------- change in cast.cpp line 70 from tmp = rotl( tmp, K[ count + 15 ] ); \ to tmp = rotl( tmp, unsigned(K[ count + 15 ]) ); \ line 75 from tmp = rotl( tmp, K[ count + 15 ] ); \ to tmp = rotl( tmp, unsigned(K[ count + 15 ]) ); \ line 80 from tmp = rotl( tmp, K[ count + 15 ] ); \ to tmp = rotl( tmp, unsigned(K[ count + 15 ]) ); \ ----------------------------------------------------------------------------- change in eprecomp.cpp line 33 from return GeneralCascadeMultiplication(group, eb.begin(), eb.end()); to return GeneralCascadeMultiplication(group, eb.begin(), eb.end()); line 63 from return GeneralCascadeMultiplication(group, eb.begin(), eb.end()); to return GeneralCascadeMultiplication(group, eb.begin(), eb.end()); ----------------------------------------------------------------------------- change in eccrypto.cpp lines 6,7,8,9,10,11 from template class ECPublicKey; template class ECPublicKey; template class ECPrivateKey; template class ECPrivateKey; template class ECKEP; template class ECKEP; to template ECPublicKey; template ECPublicKey; template ECPrivateKey; template ECPrivateKey; template ECKEP; template ECKEP; ----------------------------------------------------------------------------- change in files.cpp (otherwise runtime error occurs) // If end-of-file is encountered as the first character, // ios::eofbit is set in the error state in the inherited ios object. // If end-of-file is encountered before len characters are transferred, // ios::failbit is set in the error state in the inherited ios object. // // Be careful: !in.good() is not equal to in.bad() line 53 from if (!in.good() && !in.eof()) to #if !defined(__WATCOM_CPLUSPLUS__) if (!in.good() && !in.eof()) #else if (in.bad() && !in.eof()) #endif ----------------------------------------------------------------------------- change in filters.cpp lines 6 from #include to #if defined(__WATCOM_CPLUSPLUS__) #include "auto_ptr.h" #endif #include ----------------------------------------------------------------------------- change in forkjoin.cpp lines 6 from #include to #if defined(__WATCOM_CPLUSPLUS__) #include "auto_ptr.h" #endif #include ----------------------------------------------------------------------------- change in pubkey.cpp lines 5,6,7,8,9 from #define INSTANTIATE_PUBKEY_TEMPLATES_MACRO(E, S, F, I) \ template class DecryptorTemplate;\ template class EncryptorTemplate;\ template class SignerTemplate;\ template class VerifierTemplate to #define INSTANTIATE_PUBKEY_TEMPLATES_MACRO(E, S, F, I) \ template DecryptorTemplate;\ template EncryptorTemplate;\ template SignerTemplate;\ template VerifierTemplate #endif ----------------------------------------------------------------------------- change in rabin.cpp (Watcom C++ cannot handle default template parameters) lines 10,11,12,13,14,15 from #include "oaep.cpp" template class OAEP; template class PSSR; INSTANTIATE_PUBKEY_TEMPLATES_MACRO(OAEP, PSSR, RabinFunction, InvertableRabinFunction); to typedef OAEP CLASS_OAEP; typedef PSSR CLASS_PSSR; template OAEP; template PSSR; INSTANTIATE_PUBKEY_TEMPLATES_MACRO(CLASS_OAEP, CLASS_PSSR, RabinFunction, InvertableRabinFunction); ----------------------------------------------------------------------------- change in secshare.cpp (Watcom C++ cannot handle default template parameters) line 33 from typedef PolynomialOverFixedRing Polynomial; to typedef PolynomialOverFixedRing Polynomial; ----------------------------------------------------------------------------- change in square.cpp line 41 from byteReverse(roundkeys[0], roundkeys[0], KEYLENGTH); to byteReverse(roundkeys[0], roundkeys[0], unsigned(KEYLENGTH)); line 47 from roundkeys[i][0] = roundkeys[i-1][0] ^ rotl (roundkeys[i-1][3], 8) ^ offset[i-1]; to roundkeys[i][0] = roundkeys[i-1][0] ^ rotl (roundkeys[i-1][3], unsigned(8)) ^ offset[i-1]; line 124 from byteReverse(text, (word32 *)inBlock, SquareBase::BLOCKSIZE); to byteReverse(text, (word32 *)inBlock, unsigned(SquareBase::BLOCKSIZE)); line 133 from byteReverse((word32 *)outBlock, text, SquareBase::BLOCKSIZE); to byteReverse((word32 *)outBlock, text, unsigned(SquareBase::BLOCKSIZE)); ----------------------------------------------------------------------------- change in test.cpp line 14 from #include to #if !defined(__WATCOM_CPLUSPLUS__) #include #else #include "auto_ptr.h" #endif lines 140,141,142,143,144 from catch(exception &e) { cout << "exception caught: " << e.what() << endl; return -2; } to #if !defined(__WATCOM_CPLUSPLUS__) catch(exception &e) { cout << "exception caught: " << e.what() << endl; return -2; } #endif ----------------------------------------------------------------------------- change in validat1.cpp line 22 from #include to #if defined(__WATCOM_CPLUSPLUS__) #include "auto_ptr.h" #endif #include =============================================================================