Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

config.h

00001 /* config.h.  Generated by configure.  */
00002 #ifndef CRYPTOPP_CONFIG_H
00003 #define CRYPTOPP_CONFIG_H
00004 
00005 // ***************** Important Settings ********************
00006 
00007 // Endianness
00008 /* #undef IS_BIG_ENDIAN */
00009 #define IS_LITTLE_ENDIAN 
00010 
00011 // define this if you want to disable all OS-dependent features,
00012 // such as sockets and OS-provided random number generators
00013 // #define NO_OS_DEPENDENCE
00014 
00015 // Define this to use features provided by Microsoft's CryptoAPI.
00016 // Currently the only feature used is random number generation.
00017 // This macro will be ignored if NO_OS_DEPENDENCE is defined.
00018 #define USE_MS_CRYPTOAPI
00019 
00020 // Define this to 1 to enforce the requirement in FIPS 186-2 Change Notice 1 that only 1024 bit moduli be used
00021 #ifndef DSA_1024_BIT_MODULUS_ONLY
00022 #       define DSA_1024_BIT_MODULUS_ONLY 1
00023 #endif
00024 
00025 // ***************** Less Important Settings ***************
00026 
00027 // define this to retain (as much as possible) old deprecated function and class names
00028 // #define CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
00029 
00030 #define GZIP_OS_CODE 0
00031 
00032 // Try this if your CPU has 256K internal cache or a slow multiply instruction
00033 // and you want a (possibly) faster IDEA implementation using log tables
00034 // #define IDEA_LARGECACHE
00035 
00036 // Define this if, for the linear congruential RNG, you want to use
00037 // the original constants as specified in S.K. Park and K.W. Miller's
00038 // CACM paper.
00039 // #define LCRNG_ORIGINAL_NUMBERS
00040 
00041 // choose which style of sockets to wrap (mostly useful for cygwin which has both)
00042 #define PREFER_BERKELEY_STYLE_SOCKETS
00043 // #define PREFER_WINDOWS_STYLE_SOCKETS
00044 
00045 // ***************** Important Settings Again ********************
00046 // But the defaults should be ok.
00047 
00048 // namespace support is now required
00049 #ifdef NO_NAMESPACE
00050 #       error namespace support is now required
00051 #endif
00052 
00053 // Define this to workaround a Microsoft CryptoAPI bug where
00054 // each call to CryptAcquireContext causes a 100 KB memory leak.
00055 // Defining this will cause Crypto++ to make only one call to CryptAcquireContext.
00056 #define WORKAROUND_MS_BUG_Q258000
00057 
00058 #ifdef CRYPTOPP_DOXYGEN_PROCESSING
00059 // Avoid putting "CryptoPP::" in front of everything in Doxygen output
00060 #       define CryptoPP
00061 #       define NAMESPACE_BEGIN(x)
00062 #       define NAMESPACE_END
00063 // Get Doxygen to generate better documentation for these typedefs
00064 #       define DOCUMENTED_TYPEDEF(x, y) class y : public x {};
00065 #else
00066 #       define NAMESPACE_BEGIN(x) namespace x {
00067 #       define NAMESPACE_END }
00068 #       define DOCUMENTED_TYPEDEF(x, y) typedef x y;
00069 #endif
00070 #define ANONYMOUS_NAMESPACE_BEGIN namespace {
00071 #define USING_NAMESPACE(x) using namespace x;
00072 #define DOCUMENTED_NAMESPACE_BEGIN(x) namespace x {
00073 #define DOCUMENTED_NAMESPACE_END }
00074 
00075 // What is the type of the third parameter to bind?
00076 // For Unix, the new standard is ::socklen_t (typically unsigned int), and the old standard is int.
00077 // Unfortunately there is no way to tell whether or not socklen_t is defined.
00078 // To work around this, TYPE_OF_SOCKLEN_T is a macro so that you can change it from the makefile.
00079 #ifndef TYPE_OF_SOCKLEN_T
00080 #       if defined(_WIN32) || defined(__CYGWIN__) || defined(__MACH__)
00081 #               define TYPE_OF_SOCKLEN_T int
00082 #       else
00083 #               define TYPE_OF_SOCKLEN_T ::socklen_t
00084 #       endif
00085 #endif
00086 
00087 #if defined(__CYGWIN__) && defined(PREFER_WINDOWS_STYLE_SOCKETS)
00088 #       define __USE_W32_SOCKETS
00089 #endif
00090 
00091 typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
00092 
00093 NAMESPACE_BEGIN(CryptoPP)
00094 
00095 typedef unsigned short word16;
00096 typedef unsigned int word32;
00097 
00098 #if defined(__GNUC__) || defined(__MWERKS__)
00099         #define WORD64_AVAILABLE
00100         typedef unsigned long long word64;
00101         #define W64LIT(x) x##LL
00102 #elif defined(_MSC_VER) || defined(__BCPLUSPLUS__)
00103         #define WORD64_AVAILABLE
00104         typedef unsigned __int64 word64;
00105         #define W64LIT(x) x##ui64
00106 #endif
00107 
00108 // define largest word type
00109 #ifdef WORD64_AVAILABLE
00110         typedef word64 lword;
00111 #else
00112         typedef word32 lword;
00113 #endif
00114 
00115 #if defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || defined(__x86_64__) || defined(__mips64)
00116         // These platforms have 64-bit CPU registers. Unfortunately most C++ compilers doesn't
00117         // allow any way to access the 64-bit by 64-bit multiply instruction without using
00118         // assembly, so in order to use word64 as word, the assembly instruction must be defined
00119         // in Dword::Multiply().
00120         typedef word32 hword;
00121         typedef word64 word;
00122 #else
00123         #define CRYPTOPP_NATIVE_DWORD_AVAILABLE
00124         #ifdef WORD64_AVAILABLE
00125                 #define CRYPTOPP_SLOW_WORD64 // defined this if your CPU is not 64-bit to use alternative code that avoids word64
00126                 typedef word16 hword;
00127                 typedef word32 word;
00128                 typedef word64 dword;
00129         #else
00130                 typedef word8 hword;
00131                 typedef word16 word;
00132                 typedef word32 dword;
00133         #endif
00134 #endif
00135 
00136 const unsigned int WORD_SIZE = sizeof(word);
00137 const unsigned int WORD_BITS = WORD_SIZE * 8;
00138 
00139 #if defined(_MSC_VER) || defined(__BCPLUSPLUS__)
00140         #define INTEL_INTRINSICS
00141         #define FAST_ROTATE
00142 #elif defined(__MWERKS__) && TARGET_CPU_PPC
00143         #define PPC_INTRINSICS
00144         #define FAST_ROTATE
00145 #elif defined(__GNUC__) && defined(__i386__)
00146         // GCC does peephole optimizations which should result in using rotate instructions
00147         #define FAST_ROTATE
00148 #endif
00149 
00150 NAMESPACE_END
00151 
00152 // VC60 workaround: it doesn't allow typename in some places
00153 #if defined(_MSC_VER) && (_MSC_VER < 1300)
00154 #define CPP_TYPENAME
00155 #else
00156 #define CPP_TYPENAME typename
00157 #endif
00158 
00159 #ifdef _MSC_VER
00160 #define CRYPTOPP_NO_VTABLE __declspec(novtable)
00161 #else
00162 #define CRYPTOPP_NO_VTABLE
00163 #endif
00164 
00165 #ifdef _MSC_VER
00166         // 4231: nonstandard extension used : 'extern' before template explicit instantiation
00167         // 4250: dominance
00168         // 4251: member needs to have dll-interface
00169         // 4275: base needs to have dll-interface
00170         // 4660: explicitly instantiating a class that's already implicitly instantiated
00171         // 4661: no suitable definition provided for explicit template instantiation request
00172         // 4786: identifer was truncated in debug information
00173         // 4355: 'this' : used in base member initializer list
00174 #       pragma warning(disable: 4231 4250 4251 4275 4660 4661 4786 4355)
00175 #endif
00176 
00177 #if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__MWERKS__) || defined(_STLPORT_VERSION)
00178 #define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION
00179 #endif
00180 
00181 #ifndef CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION
00182 #define CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE
00183 #endif
00184 
00185 // CodeWarrior defines _MSC_VER
00186 #if !defined(CRYPTOPP_DISABLE_X86ASM) && ((defined(_MSC_VER) && !defined(__MWERKS__) && defined(_M_IX86)) || (defined(__GNUC__) && defined(__i386__)))
00187 #define CRYPTOPP_X86ASM_AVAILABLE
00188 #endif
00189 
00190 // ***************** determine availability of OS features ********************
00191 
00192 #ifndef NO_OS_DEPENDENCE
00193 
00194 #if defined(_WIN32) || defined(__CYGWIN__)
00195 #define CRYPTOPP_WIN32_AVAILABLE
00196 #endif
00197 
00198 #if defined(__unix__) || defined(__MACH__)
00199 #define CRYPTOPP_UNIX_AVAILABLE
00200 #endif
00201 
00202 #if defined(WORD64_AVAILABLE) && (defined(CRYPTOPP_WIN32_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE))
00203 #       define HIGHRES_TIMER_AVAILABLE
00204 #endif
00205 
00206 #ifdef CRYPTOPP_UNIX_AVAILABLE
00207 #       define HAS_BERKELEY_STYLE_SOCKETS
00208 #endif
00209 
00210 #ifdef CRYPTOPP_WIN32_AVAILABLE
00211 #       define HAS_WINDOWS_STYLE_SOCKETS
00212 #endif
00213 
00214 #if defined(HIGHRES_TIMER_AVAILABLE) && (defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(HAS_WINDOWS_STYLE_SOCKETS))
00215 #       define SOCKETS_AVAILABLE
00216 #endif
00217 
00218 #if defined(HAS_WINDOWS_STYLE_SOCKETS) && (!defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(PREFER_WINDOWS_STYLE_SOCKETS))
00219 #       define USE_WINDOWS_STYLE_SOCKETS
00220 #else
00221 #       define USE_BERKELEY_STYLE_SOCKETS
00222 #endif
00223 
00224 #if defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(USE_BERKELEY_STYLE_SOCKETS)
00225 #       define WINDOWS_PIPES_AVAILABLE
00226 #endif
00227 
00228 #if defined(CRYPTOPP_WIN32_AVAILABLE) && defined(USE_MS_CRYPTOAPI)
00229 #       define NONBLOCKING_RNG_AVAILABLE
00230 #       define OS_RNG_AVAILABLE
00231 #endif
00232 
00233 #if defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING)
00234 #       define NONBLOCKING_RNG_AVAILABLE
00235 #       define BLOCKING_RNG_AVAILABLE
00236 #       define OS_RNG_AVAILABLE
00237 #       define HAS_PTHREADS
00238 #       define THREADS_AVAILABLE
00239 #endif
00240 
00241 #ifdef CRYPTOPP_WIN32_AVAILABLE
00242 #       define HAS_WINTHREADS
00243 #       define THREADS_AVAILABLE
00244 #endif
00245 
00246 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
00247 #       define CRYPTOPP_MALLOC_ALIGNMENT_IS_16
00248 #endif
00249 
00250 #if defined(__linux__) || defined(__sun__) || defined(__CYGWIN__)
00251 #       define CRYPTOPP_MEMALIGN_AVAILABLE
00252 #endif
00253 
00254 #endif  // NO_OS_DEPENDENCE
00255 
00256 // ***************** DLL related ********************
00257 
00258 #ifdef CRYPTOPP_WIN32_AVAILABLE
00259 
00260 #ifdef CRYPTOPP_EXPORTS
00261 #define CRYPTOPP_IS_DLL
00262 #define CRYPTOPP_DLL __declspec(dllexport)
00263 #elif defined(CRYPTOPP_IMPORTS)
00264 #define CRYPTOPP_IS_DLL
00265 #define CRYPTOPP_DLL __declspec(dllimport)
00266 #else
00267 #define CRYPTOPP_DLL
00268 #endif
00269 
00270 #define CRYPTOPP_API __stdcall
00271 #define CRYPTOPP_CDECL __cdecl
00272 
00273 #else   // CRYPTOPP_WIN32_AVAILABLE
00274 
00275 #define CRYPTOPP_DLL
00276 #define CRYPTOPP_API
00277 #define CRYPTOPP_CDECL
00278 
00279 #endif  // CRYPTOPP_WIN32_AVAILABLE
00280 
00281 #if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_IMPORTS)
00282 #define CRYPTOPP_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL
00283 #elif defined(__MWERKS__)
00284 #define CRYPTOPP_DLL_TEMPLATE_CLASS extern class CRYPTOPP_DLL
00285 #else
00286 #define CRYPTOPP_DLL_TEMPLATE_CLASS extern template class CRYPTOPP_DLL
00287 #endif
00288 
00289 #if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_EXPORTS)
00290 #define CRYPTOPP_STATIC_TEMPLATE_CLASS template class
00291 #elif defined(__MWERKS__)
00292 #define CRYPTOPP_STATIC_TEMPLATE_CLASS extern class
00293 #else
00294 #define CRYPTOPP_STATIC_TEMPLATE_CLASS extern template class
00295 #endif
00296 
00297 #endif

Generated on Fri Sep 9 19:01:20 2005 for Crypto++ by  doxygen 1.4.4