Security Scol plugin
config_int.h
Go to the documentation of this file.
1// config_int.h - written and placed in public domain by Jeffrey Walton
2// the bits that make up this source file are from the
3// library's monolithic config.h.
4
24
25#ifndef CRYPTOPP_CONFIG_INT_H
26#define CRYPTOPP_CONFIG_INT_H
27
28#include "config_ns.h"
29#include "config_ver.h"
30
41#define CRYPTOPP_NO_GLOBAL_BYTE 1
42
43NAMESPACE_BEGIN(CryptoPP)
44
45// Signed words added at Issue 609 for early versions of and Visual Studio and
46// the NaCl gear. Also see https://github.com/weidai11/cryptopp/issues/609.
47
48
56typedef unsigned char byte;
59typedef unsigned short word16;
62typedef unsigned int word32;
63
69typedef signed char sbyte;
75typedef signed short sword16;
81typedef signed int sword32;
82
83#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
84
91 typedef unsigned long long word64;
92
99 typedef signed long long sword64;
100
109 typedef __uint128_t word128;
110
119 #define W64LIT(x) ...
120
129 #define SW64LIT(x) ...
130
136 #define CRYPTOPP_BOOL_SLOW_WORD64 ...
137
138#elif defined(_MSC_VER) || defined(__BORLANDC__)
139 typedef signed __int64 sword64;
140 typedef unsigned __int64 word64;
141 #define SW64LIT(x) x##i64
142 #define W64LIT(x) x##ui64
143#elif (_LP64 || __LP64__)
144 typedef signed long sword64;
145 typedef unsigned long word64;
146 #define SW64LIT(x) x##L
147 #define W64LIT(x) x##UL
148#else
149 typedef signed long long sword64;
150 typedef unsigned long long word64;
151 #define SW64LIT(x) x##LL
152 #define W64LIT(x) x##ULL
153#endif
154
158typedef word64 lword;
159
164const lword LWORD_MAX = W64LIT(0xffffffffffffffff);
165
166#if defined(CRYPTOPP_DOXYGEN_PROCESSING)
174 typedef word32 hword;
182 typedef word64 word;
193 typedef word128 dword;
194
204 #define CRYPTOPP_WORD128_AVAILABLE ...
205#else
206 // define hword, word, and dword. these are used for multiprecision integer arithmetic
207 // Intel compiler won't have _umul128 until version 10.0. See http://softwarecommunity.intel.com/isn/Community/en-US/forums/thread/30231625.aspx
208 #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__))
209 typedef word32 hword;
210 typedef word64 word;
211 #else
212 #define CRYPTOPP_NATIVE_DWORD_AVAILABLE 1
213 #if defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || defined(__x86_64__) || defined(__mips64) || defined(__sparc64__) || defined(__aarch64__)
214 #if ((CRYPTOPP_GCC_VERSION >= 30400) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30000) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40300)) && (__SIZEOF_INT128__ >= 16)
215 // GCC 4.0.1 on MacOS X is missing __umodti3 and __udivti3
216 // GCC 4.8.3 and bad uint128_t ops on PPC64/POWER7 (Issue 421)
217 // mode(TI) division broken on amd64 with GCC earlier than GCC 3.4
218 typedef word32 hword;
219 typedef word64 word;
220 typedef __uint128_t dword;
221 typedef __uint128_t word128;
222 #define CRYPTOPP_WORD128_AVAILABLE 1
223 #else
224 // 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
225 typedef word16 hword;
226 typedef word32 word;
227 typedef word64 dword;
228 #endif
229 #else
230 // being here means the native register size is probably 32 bits or less
231 #define CRYPTOPP_BOOL_SLOW_WORD64 1
232 typedef word16 hword;
233 typedef word32 word;
234 typedef word64 dword;
235 #endif
236 #endif
237#endif
238
239#ifndef CRYPTOPP_BOOL_SLOW_WORD64
240# define CRYPTOPP_BOOL_SLOW_WORD64 0
241#endif
242
245const unsigned int WORD_SIZE = sizeof(word);
246
249const unsigned int WORD_BITS = WORD_SIZE * 8;
250
251NAMESPACE_END
252
253#endif // CRYPTOPP_CONFIG_INT_H
const lword LWORD_MAX
Large word type max value.
Definition config_int.h:164
signed int sword32
32-bit signed datatype
Definition config_int.h:81
const unsigned int WORD_BITS
Size of a platform word in bits.
Definition config_int.h:249
unsigned int word32
32-bit unsigned datatype
Definition config_int.h:62
unsigned short word16
16-bit unsigned datatype
Definition config_int.h:59
signed short sword16
16-bit signed datatype
Definition config_int.h:75
signed char sbyte
8-bit signed datatype
Definition config_int.h:69
const unsigned int WORD_SIZE
Size of a platform word in bytes.
Definition config_int.h:245
word64 lword
Large word type.
Definition config_int.h:158
Library configuration file.
Library configuration file.