00001 #ifndef CRYPTOPP_CONFIG_H
00002 #define CRYPTOPP_CONFIG_H
00003
00004
00005
00006
00007 #if defined(__sparc__) || defined(__hppa__) || defined(__ppc__) || defined(__mips__) || (defined(__MWERKS__) && !defined(__INTEL__))
00008 #define IS_BIG_ENDIAN
00009 #endif
00010
00011
00012
00013 #ifndef IS_BIG_ENDIAN
00014 #define IS_LITTLE_ENDIAN
00015 #endif
00016
00017
00018
00019
00020
00021
00022
00023
00024 #define USE_MS_CRYPTOAPI
00025
00026
00027
00028 #ifdef NO_NAMESPACE
00029 #define std
00030 #define CryptoPP
00031 #define USING_NAMESPACE(x)
00032 #define NAMESPACE_BEGIN(x)
00033 #define NAMESPACE_END
00034 #define ANONYMOUS_NAMESPACE_BEGIN
00035 #else
00036 #define USING_NAMESPACE(x) using namespace x;
00037 #define NAMESPACE_BEGIN(x) namespace x {
00038 #define ANONYMOUS_NAMESPACE_BEGIN namespace {
00039 #define NAMESPACE_END }
00040 #endif
00041
00042
00043
00044
00045
00046 #define SECALLOC_DEFAULT
00047
00048 #define GZIP_OS_CODE 0
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 #define PREFER_BERKELEY_STYLE_SOCKETS
00065
00066
00067
00068
00069
00070 typedef unsigned char byte;
00071
00072 NAMESPACE_BEGIN(CryptoPP)
00073
00074 typedef unsigned short word16;
00075 #if defined(__alpha) && !defined(_MSC_VER)
00076 typedef unsigned int word32;
00077 #else
00078 typedef unsigned long word32;
00079 #endif
00080
00081 #if defined(__GNUC__) || defined(__MWERKS__)
00082 #define WORD64_AVAILABLE
00083 typedef unsigned long long word64;
00084 #define W64LIT(x) x##LL
00085 #elif defined(_MSC_VER) || defined(__BCPLUSPLUS__)
00086 #define WORD64_AVAILABLE
00087 typedef unsigned __int64 word64;
00088 #define W64LIT(x) x##ui64
00089 #endif
00090
00091
00092 #if defined(WORD64_AVAILABLE) && !defined(__alpha)
00093 #define SLOW_WORD64
00094 #endif
00095
00096
00097
00098
00099 #if (defined(__GNUC__) && !defined(__alpha)) || defined(__MWERKS__)
00100 typedef unsigned long word;
00101 typedef unsigned long long dword;
00102 #elif defined(_MSC_VER) || defined(__BCPLUSPLUS__)
00103 typedef unsigned __int32 word;
00104 typedef unsigned __int64 dword;
00105 #else
00106 typedef unsigned int word;
00107 typedef unsigned long dword;
00108 #endif
00109
00110 const unsigned int WORD_SIZE = sizeof(word);
00111 const unsigned int WORD_BITS = WORD_SIZE * 8;
00112
00113 #define LOW_WORD(x) (word)(x)
00114
00115 union dword_union
00116 {
00117 dword_union (const dword &dw) : dw(dw) {}
00118 dword dw;
00119 word w[2];
00120 };
00121
00122 #ifdef IS_LITTLE_ENDIAN
00123 #define HIGH_WORD(x) (dword_union(x).w[1])
00124 #else
00125 #define HIGH_WORD(x) (dword_union(x).w[0])
00126 #endif
00127
00128
00129
00130
00131
00132 #if defined(_MSC_VER) || defined(__BCPLUSPLUS__)
00133 #define INTEL_INTRINSICS
00134 #define FAST_ROTATE
00135 #elif defined(__MWERKS__) && TARGET_CPU_PPC
00136 #define PPC_INTRINSICS
00137 #define FAST_ROTATE
00138 #elif defined(__GNUC__) && defined(__i386__)
00139
00140 #define FAST_ROTATE
00141 #endif
00142
00143
00144 template <class _Tp>
00145 inline const _Tp& STDMIN(const _Tp& __a, const _Tp& __b) {
00146 return __b < __a ? __b : __a;
00147 }
00148
00149 template <class _Tp>
00150 inline const _Tp& STDMAX(const _Tp& __a, const _Tp& __b) {
00151 return __a < __b ? __b : __a;
00152 }
00153
00154 #ifdef _MSC_VER
00155
00156
00157
00158
00159
00160 #pragma warning(disable: 4250 4660 4786 4355 4800)
00161 #endif
00162
00163 NAMESPACE_END
00164
00165 #endif