• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

config.h

00001 /* config.h.  Generated from config.h.in by configure.  */
00002 // Debian note: This is a copy of the original config.h file except for the two
00003 // endianness undefs below; they are substituted by the autoconf process
00004 // according to the build architecture.
00005 
00006 #ifndef CRYPTOPP_CONFIG_H
00007 #define CRYPTOPP_CONFIG_H
00008 
00009 // ***************** Important Settings ********************
00010 
00011 // Endianness
00012 /* #undef IS_BIG_ENDIAN */
00013 #define IS_LITTLE_ENDIAN /**/
00014 
00015 // define this if you want to disable all OS-dependent features,
00016 // such as sockets and OS-provided random number generators
00017 // #define NO_OS_DEPENDENCE
00018 
00019 // Define this to use features provided by Microsoft's CryptoAPI.
00020 // Currently the only feature used is random number generation.
00021 // This macro will be ignored if NO_OS_DEPENDENCE is defined.
00022 #define USE_MS_CRYPTOAPI
00023 
00024 // Define this to 1 to enforce the requirement in FIPS 186-2 Change Notice 1 that only 1024 bit moduli be used
00025 #ifndef DSA_1024_BIT_MODULUS_ONLY
00026 #   define DSA_1024_BIT_MODULUS_ONLY 1
00027 #endif
00028 
00029 // ***************** Less Important Settings ***************
00030 
00031 // define this to retain (as much as possible) old deprecated function and class names
00032 // #define CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
00033 
00034 #define GZIP_OS_CODE 0
00035 
00036 // Try this if your CPU has 256K internal cache or a slow multiply instruction
00037 // and you want a (possibly) faster IDEA implementation using log tables
00038 // #define IDEA_LARGECACHE
00039 
00040 // Define this if, for the linear congruential RNG, you want to use
00041 // the original constants as specified in S.K. Park and K.W. Miller's
00042 // CACM paper.
00043 // #define LCRNG_ORIGINAL_NUMBERS
00044 
00045 // choose which style of sockets to wrap (mostly useful for cygwin which has both)
00046 #define PREFER_BERKELEY_STYLE_SOCKETS
00047 // #define PREFER_WINDOWS_STYLE_SOCKETS
00048 
00049 // set the name of Rijndael cipher, was "Rijndael" before version 5.3
00050 #define CRYPTOPP_RIJNDAEL_NAME "AES"
00051 
00052 // ***************** Important Settings Again ********************
00053 // But the defaults should be ok.
00054 
00055 // namespace support is now required
00056 #ifdef NO_NAMESPACE
00057 #   error namespace support is now required
00058 #endif
00059 
00060 // Define this to workaround a Microsoft CryptoAPI bug where
00061 // each call to CryptAcquireContext causes a 100 KB memory leak.
00062 // Defining this will cause Crypto++ to make only one call to CryptAcquireContext.
00063 #define WORKAROUND_MS_BUG_Q258000
00064 
00065 #ifdef CRYPTOPP_DOXYGEN_PROCESSING
00066 // Avoid putting "CryptoPP::" in front of everything in Doxygen output
00067 #   define CryptoPP
00068 #   define NAMESPACE_BEGIN(x)
00069 #   define NAMESPACE_END
00070 // Get Doxygen to generate better documentation for these typedefs
00071 #   define DOCUMENTED_TYPEDEF(x, y) class y : public x {};
00072 #else
00073 #   define NAMESPACE_BEGIN(x) namespace x {
00074 #   define NAMESPACE_END }
00075 #   define DOCUMENTED_TYPEDEF(x, y) typedef x y;
00076 #endif
00077 #define ANONYMOUS_NAMESPACE_BEGIN namespace {
00078 #define USING_NAMESPACE(x) using namespace x;
00079 #define DOCUMENTED_NAMESPACE_BEGIN(x) namespace x {
00080 #define DOCUMENTED_NAMESPACE_END }
00081 
00082 // What is the type of the third parameter to bind?
00083 // For Unix, the new standard is ::socklen_t (typically unsigned int), and the old standard is int.
00084 // Unfortunately there is no way to tell whether or not socklen_t is defined.
00085 // To work around this, TYPE_OF_SOCKLEN_T is a macro so that you can change it from the makefile.
00086 #ifndef TYPE_OF_SOCKLEN_T
00087 #   if defined(_WIN32) || defined(__CYGWIN__)
00088 #       define TYPE_OF_SOCKLEN_T int
00089 #   else
00090 #       define TYPE_OF_SOCKLEN_T ::socklen_t
00091 #   endif
00092 #endif
00093 
00094 #if defined(__CYGWIN__) && defined(PREFER_WINDOWS_STYLE_SOCKETS)
00095 #   define __USE_W32_SOCKETS
00096 #endif
00097 
00098 typedef unsigned char byte;     // put in global namespace to avoid ambiguity with other byte typedefs
00099 
00100 NAMESPACE_BEGIN(CryptoPP)
00101 
00102 typedef unsigned short word16;
00103 typedef unsigned int word32;
00104 
00105 #if defined(_MSC_VER) || defined(__BORLANDC__)
00106     typedef unsigned __int64 word64;
00107     #define W64LIT(x) x##ui64
00108 #else
00109     typedef unsigned long long word64;
00110     #define W64LIT(x) x##ULL
00111 #endif
00112 
00113 // define large word type, used for file offsets and such
00114 typedef word64 lword;
00115 const lword LWORD_MAX = W64LIT(0xffffffffffffffff);
00116 
00117 #ifdef __GNUC__
00118     #define CRYPTOPP_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
00119 #endif
00120 
00121 // define hword, word, and dword. these are used for multiprecision integer arithmetic
00122 // Intel compiler won't have _umul128 until version 10.0. See http://softwarecommunity.intel.com/isn/Community/en-US/forums/thread/30231625.aspx
00123 #if (defined(_MSC_VER) && (!defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1000) && (defined(_M_X64) || defined(_M_IA64))) || (defined(__DECCXX) && defined(__alpha__)) || (defined(__INTEL_COMPILER) && defined(__x86_64__)) || (defined(__SUNPRO_CC) && defined(__x86_64__))
00124     typedef word32 hword;
00125     typedef word64 word;
00126 #else
00127     #define CRYPTOPP_NATIVE_DWORD_AVAILABLE
00128     #if defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || defined(__x86_64__) || defined(__mips64) || defined(__sparc64__)
00129         #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !(CRYPTOPP_GCC_VERSION == 40001 && defined(__APPLE__)) && CRYPTOPP_GCC_VERSION >= 30400
00130             // GCC 4.0.1 on MacOS X is missing __umodti3 and __udivti3
00131             // mode(TI) division broken on amd64 with GCC earlier than GCC 3.4
00132             typedef word32 hword;
00133             typedef word64 word;
00134             typedef __uint128_t dword;
00135             typedef __uint128_t word128;
00136             #define CRYPTOPP_WORD128_AVAILABLE
00137         #else
00138             // if we're here, it means we're on a 64-bit CPU but we don't have a way to obtain 128-bit multiplication results
00139             typedef word16 hword;
00140             typedef word32 word;
00141             typedef word64 dword;
00142         #endif
00143     #else
00144         // being here means the native register size is probably 32 bits or less
00145         #define CRYPTOPP_BOOL_SLOW_WORD64 1
00146         typedef word16 hword;
00147         typedef word32 word;
00148         typedef word64 dword;
00149     #endif
00150 #endif
00151 #ifndef CRYPTOPP_BOOL_SLOW_WORD64
00152     #define CRYPTOPP_BOOL_SLOW_WORD64 0
00153 #endif
00154 
00155 const unsigned int WORD_SIZE = sizeof(word);
00156 const unsigned int WORD_BITS = WORD_SIZE * 8;
00157 
00158 NAMESPACE_END
00159 
00160 #ifndef CRYPTOPP_L1_CACHE_LINE_SIZE
00161     // This should be a lower bound on the L1 cache line size. It's used for defense against timing attacks.
00162     #if defined(_M_X64) || defined(__x86_64__)
00163         #define CRYPTOPP_L1_CACHE_LINE_SIZE 64
00164     #else
00165         // L1 cache line size is 32 on Pentium III and earlier
00166         #define CRYPTOPP_L1_CACHE_LINE_SIZE 32
00167     #endif
00168 #endif
00169 
00170 #if defined(_MSC_VER)
00171     #if _MSC_VER == 1200
00172         #include <malloc.h>
00173     #endif
00174     #if _MSC_VER > 1200 || defined(_mm_free)
00175         #define CRYPTOPP_MSVC6PP_OR_LATER       // VC 6 processor pack or later
00176     #else
00177         #define CRYPTOPP_MSVC6_NO_PP            // VC 6 without processor pack
00178     #endif
00179 #endif
00180 
00181 #ifndef CRYPTOPP_ALIGN_DATA
00182     #if defined(CRYPTOPP_MSVC6PP_OR_LATER)
00183         #define CRYPTOPP_ALIGN_DATA(x) __declspec(align(x))
00184     #elif defined(__GNUC__)
00185         #define CRYPTOPP_ALIGN_DATA(x) __attribute__((aligned(x)))
00186     #else
00187         #define CRYPTOPP_ALIGN_DATA(x)
00188     #endif
00189 #endif
00190 
00191 #ifndef CRYPTOPP_SECTION_ALIGN16
00192     #if defined(__GNUC__) && !defined(__APPLE__)
00193         // the alignment attribute doesn't seem to work without this section attribute when -fdata-sections is turned on
00194         #define CRYPTOPP_SECTION_ALIGN16 __attribute__((section ("CryptoPP_Align16")))
00195     #else
00196         #define CRYPTOPP_SECTION_ALIGN16
00197     #endif
00198 #endif
00199 
00200 #if defined(_MSC_VER) || defined(__fastcall)
00201     #define CRYPTOPP_FASTCALL __fastcall
00202 #else
00203     #define CRYPTOPP_FASTCALL
00204 #endif
00205 
00206 // VC60 workaround: it doesn't allow typename in some places
00207 #if defined(_MSC_VER) && (_MSC_VER < 1300)
00208 #define CPP_TYPENAME
00209 #else
00210 #define CPP_TYPENAME typename
00211 #endif
00212 
00213 // VC60 workaround: can't cast unsigned __int64 to float or double
00214 #if defined(_MSC_VER) && !defined(CRYPTOPP_MSVC6PP_OR_LATER)
00215 #define CRYPTOPP_VC6_INT64 (__int64)
00216 #else
00217 #define CRYPTOPP_VC6_INT64
00218 #endif
00219 
00220 #ifdef _MSC_VER
00221 #define CRYPTOPP_NO_VTABLE __declspec(novtable)
00222 #else
00223 #define CRYPTOPP_NO_VTABLE
00224 #endif
00225 
00226 #ifdef _MSC_VER
00227     // 4231: nonstandard extension used : 'extern' before template explicit instantiation
00228     // 4250: dominance
00229     // 4251: member needs to have dll-interface
00230     // 4275: base needs to have dll-interface
00231     // 4660: explicitly instantiating a class that's already implicitly instantiated
00232     // 4661: no suitable definition provided for explicit template instantiation request
00233     // 4786: identifer was truncated in debug information
00234     // 4355: 'this' : used in base member initializer list
00235     // 4910: '__declspec(dllexport)' and 'extern' are incompatible on an explicit instantiation
00236 #   pragma warning(disable: 4231 4250 4251 4275 4660 4661 4786 4355 4910)
00237 #endif
00238 
00239 #ifdef __BORLANDC__
00240 // 8037: non-const function called for const object. needed to work around BCB2006 bug
00241 #   pragma warn -8037
00242 #endif
00243 
00244 #if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__MWERKS__) || defined(_STLPORT_VERSION)
00245 #define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION
00246 #endif
00247 
00248 #ifndef CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION
00249 #define CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE
00250 #endif
00251 
00252 #ifdef CRYPTOPP_DISABLE_X86ASM      // for backwards compatibility: this macro had both meanings
00253 #define CRYPTOPP_DISABLE_ASM
00254 #define CRYPTOPP_DISABLE_SSE2
00255 #endif
00256 
00257 #if !defined(CRYPTOPP_DISABLE_ASM) && ((defined(_MSC_VER) && defined(_M_IX86)) || (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))))
00258     #define CRYPTOPP_X86_ASM_AVAILABLE
00259 
00260     #if !defined(CRYPTOPP_DISABLE_SSE2) && (defined(CRYPTOPP_MSVC6PP_OR_LATER) || CRYPTOPP_GCC_VERSION >= 30300)
00261         #define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 1
00262     #else
00263         #define CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE 0
00264     #endif
00265 
00266     // SSSE3 was actually introduced in GNU as 2.17, which was released 6/23/2006, but we can't tell what version of binutils is installed.
00267     // GCC 4.1.2 was released on 2/13/2007, so we'll use that as a proxy for the binutils version.
00268     #if !defined(CRYPTOPP_DISABLE_SSSE3) && (_MSC_VER >= 1400 || CRYPTOPP_GCC_VERSION >= 40102)
00269         #define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 1
00270     #else
00271         #define CRYPTOPP_BOOL_SSSE3_ASM_AVAILABLE 0
00272     #endif
00273 #endif
00274 
00275 #if !defined(CRYPTOPP_DISABLE_ASM) && defined(_MSC_VER) && defined(_M_X64)
00276     #define CRYPTOPP_X64_MASM_AVAILABLE
00277 #endif
00278 
00279 #if !defined(CRYPTOPP_DISABLE_ASM) && defined(__GNUC__) && defined(__x86_64__)
00280     #define CRYPTOPP_X64_ASM_AVAILABLE
00281 #endif
00282 
00283 #if !defined(CRYPTOPP_DISABLE_SSE2) && (defined(CRYPTOPP_MSVC6PP_OR_LATER) || defined(__SSE2__))
00284     #define CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE 1
00285 #else
00286     #define CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE 0
00287 #endif
00288 
00289 #if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE || CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)
00290     #define CRYPTOPP_BOOL_ALIGN16_ENABLED 1
00291 #else
00292     #define CRYPTOPP_BOOL_ALIGN16_ENABLED 0
00293 #endif
00294 
00295 // how to allocate 16-byte aligned memory (for SSE2)
00296 #if defined(CRYPTOPP_MSVC6PP_OR_LATER)
00297     #define CRYPTOPP_MM_MALLOC_AVAILABLE
00298 #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
00299     #define CRYPTOPP_MALLOC_ALIGNMENT_IS_16
00300 #elif defined(__linux__) || defined(__sun__) || defined(__CYGWIN__)
00301     #define CRYPTOPP_MEMALIGN_AVAILABLE
00302 #else
00303     #define CRYPTOPP_NO_ALIGNED_ALLOC
00304 #endif
00305 
00306 // how to disable inlining
00307 #if defined(_MSC_VER) && _MSC_VER >= 1300
00308 #   define CRYPTOPP_NOINLINE_DOTDOTDOT
00309 #   define CRYPTOPP_NOINLINE __declspec(noinline)
00310 #elif defined(__GNUC__)
00311 #   define CRYPTOPP_NOINLINE_DOTDOTDOT
00312 #   define CRYPTOPP_NOINLINE __attribute__((noinline))
00313 #else
00314 #   define CRYPTOPP_NOINLINE_DOTDOTDOT ...
00315 #   define CRYPTOPP_NOINLINE 
00316 #endif
00317 
00318 // how to declare class constants
00319 #if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__INTEL_COMPILER)
00320 #   define CRYPTOPP_CONSTANT(x) enum {x};
00321 #else
00322 #   define CRYPTOPP_CONSTANT(x) static const int x;
00323 #endif
00324 
00325 #if defined(_M_X64) || defined(__x86_64__)
00326     #define CRYPTOPP_BOOL_X64 1
00327 #else
00328     #define CRYPTOPP_BOOL_X64 0
00329 #endif
00330 
00331 // see http://predef.sourceforge.net/prearch.html
00332 #if defined(_M_IX86) || defined(__i386__) || defined(__i386) || defined(_X86_) || defined(__I86__) || defined(__INTEL__)
00333     #define CRYPTOPP_BOOL_X86 1
00334 #else
00335     #define CRYPTOPP_BOOL_X86 0
00336 #endif
00337 
00338 #if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X86 || defined(__powerpc__)
00339     #define CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS
00340 #endif
00341 
00342 #define CRYPTOPP_VERSION 560
00343 
00344 // ***************** determine availability of OS features ********************
00345 
00346 #ifndef NO_OS_DEPENDENCE
00347 
00348 #if defined(_WIN32) || defined(__CYGWIN__)
00349 #define CRYPTOPP_WIN32_AVAILABLE
00350 #endif
00351 
00352 #if defined(__unix__) || defined(__MACH__) || defined(__NetBSD__) || defined(__sun)
00353 #define CRYPTOPP_UNIX_AVAILABLE
00354 #endif
00355 
00356 #if defined(CRYPTOPP_WIN32_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE)
00357 #   define HIGHRES_TIMER_AVAILABLE
00358 #endif
00359 
00360 #ifdef CRYPTOPP_UNIX_AVAILABLE
00361 #   define HAS_BERKELEY_STYLE_SOCKETS
00362 #endif
00363 
00364 #ifdef CRYPTOPP_WIN32_AVAILABLE
00365 #   define HAS_WINDOWS_STYLE_SOCKETS
00366 #endif
00367 
00368 #if defined(HIGHRES_TIMER_AVAILABLE) && (defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(HAS_WINDOWS_STYLE_SOCKETS))
00369 #   define SOCKETS_AVAILABLE
00370 #endif
00371 
00372 #if defined(HAS_WINDOWS_STYLE_SOCKETS) && (!defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(PREFER_WINDOWS_STYLE_SOCKETS))
00373 #   define USE_WINDOWS_STYLE_SOCKETS
00374 #else
00375 #   define USE_BERKELEY_STYLE_SOCKETS
00376 #endif
00377 
00378 #if defined(HIGHRES_TIMER_AVAILABLE) && defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(USE_BERKELEY_STYLE_SOCKETS)
00379 #   define WINDOWS_PIPES_AVAILABLE
00380 #endif
00381 
00382 #if defined(CRYPTOPP_WIN32_AVAILABLE) && defined(USE_MS_CRYPTOAPI)
00383 #   define NONBLOCKING_RNG_AVAILABLE
00384 #   define OS_RNG_AVAILABLE
00385 #endif
00386 
00387 #if defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING)
00388 #   define NONBLOCKING_RNG_AVAILABLE
00389 #   define BLOCKING_RNG_AVAILABLE
00390 #   define OS_RNG_AVAILABLE
00391 #   define HAS_PTHREADS
00392 #   define THREADS_AVAILABLE
00393 #endif
00394 
00395 #ifdef CRYPTOPP_WIN32_AVAILABLE
00396 #   define HAS_WINTHREADS
00397 #   define THREADS_AVAILABLE
00398 #endif
00399 
00400 #endif  // NO_OS_DEPENDENCE
00401 
00402 // ***************** DLL related ********************
00403 
00404 #ifdef CRYPTOPP_WIN32_AVAILABLE
00405 
00406 #ifdef CRYPTOPP_EXPORTS
00407 #define CRYPTOPP_IS_DLL
00408 #define CRYPTOPP_DLL __declspec(dllexport)
00409 #elif defined(CRYPTOPP_IMPORTS)
00410 #define CRYPTOPP_IS_DLL
00411 #define CRYPTOPP_DLL __declspec(dllimport)
00412 #else
00413 #define CRYPTOPP_DLL
00414 #endif
00415 
00416 #define CRYPTOPP_API __cdecl
00417 
00418 #else   // CRYPTOPP_WIN32_AVAILABLE
00419 
00420 #define CRYPTOPP_DLL
00421 #define CRYPTOPP_API
00422 
00423 #endif  // CRYPTOPP_WIN32_AVAILABLE
00424 
00425 #if defined(__MWERKS__)
00426 #define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern class CRYPTOPP_DLL
00427 #elif defined(__BORLANDC__) || defined(__SUNPRO_CC)
00428 #define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL
00429 #else
00430 #define CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS extern template class CRYPTOPP_DLL
00431 #endif
00432 
00433 #if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_IMPORTS)
00434 #define CRYPTOPP_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL
00435 #else
00436 #define CRYPTOPP_DLL_TEMPLATE_CLASS CRYPTOPP_EXTERN_DLL_TEMPLATE_CLASS
00437 #endif
00438 
00439 #if defined(__MWERKS__)
00440 #define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern class
00441 #elif defined(__BORLANDC__) || defined(__SUNPRO_CC)
00442 #define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS template class
00443 #else
00444 #define CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS extern template class
00445 #endif
00446 
00447 #if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_EXPORTS)
00448 #define CRYPTOPP_STATIC_TEMPLATE_CLASS template class
00449 #else
00450 #define CRYPTOPP_STATIC_TEMPLATE_CLASS CRYPTOPP_EXTERN_STATIC_TEMPLATE_CLASS
00451 #endif
00452 
00453 #endif

Generated on Sun Jul 25 2010 14:44:10 for Crypto++ by  doxygen 1.7.1