Crypto++ 8.9
Free C++ class library of cryptographic schemes
|
Library configuration file. More...
Go to the source code of this file.
Macros | |
#define | CRYPTOPP_NO_GLOBAL_BYTE 1 |
Library byte guard. | |
#define | W64LIT(x) ... |
Declare an unsigned word64. | |
#define | SW64LIT(x) ... |
Declare a signed word64. | |
#define | CRYPTOPP_BOOL_SLOW_WORD64 ... |
Declare ops on word64 are slow. | |
#define | CRYPTOPP_WORD128_AVAILABLE ... |
128-bit word availability | |
Typedefs | |
typedef unsigned char | byte |
8-bit unsigned datatype | |
typedef unsigned short | word16 |
16-bit unsigned datatype | |
typedef unsigned int | word32 |
32-bit unsigned datatype | |
typedef signed char | sbyte |
8-bit signed datatype | |
typedef signed short | sword16 |
16-bit signed datatype | |
typedef signed int | sword32 |
32-bit signed datatype | |
typedef unsigned long long | word64 |
64-bit unsigned datatype | |
typedef signed long long | sword64 |
64-bit signed datatype | |
typedef __uint128_t | word128 |
128-bit unsigned datatype | |
typedef word64 | lword |
Large word type. | |
typedef word32 | hword |
Half word used for multiprecision integer arithmetic. | |
typedef word64 | word |
Full word used for multiprecision integer arithmetic. | |
typedef word128 | dword |
Double word used for multiprecision integer arithmetic. | |
Variables | |
const lword | LWORD_MAX = ... |
Large word type max value. | |
const unsigned int | WORD_SIZE = sizeof(word) |
Size of a platform word in bytes. | |
const unsigned int | WORD_BITS = WORD_SIZE * 8 |
Size of a platform word in bits. | |
Library configuration file.
config_int.h
provides defines and typedefs for fixed size integers. The library's choices for fixed size integers predates other standard-based integers by about 5 years. After fixed sizes were made standard, the library continued to use its own definitions for compatibility with previous versions of the library.
config.h
was split into components in May 2019 to better integrate with Autoconf and its feature tests. The splitting occurred so users could continue to include config.h
while allowing Autoconf to write new config_asm.h
and new config_cxx.h
using its feature tests.
config.h
rather than config_int.h
directly. Definition in file config_int.h.
#define CRYPTOPP_NO_GLOBAL_BYTE 1 |
Library byte guard.
CRYPTOPP_NO_GLOBAL_BYTE indicates byte
is in the Crypto++ namespace.
The Crypto++ byte
was originally in global namespace to avoid ambiguity with other byte typedefs. byte
was moved to CryptoPP namespace at Crypto++ 6.0 due to C++17, std::byte
and potential compile problems.
Definition at line 51 of file config_int.h.
#define W64LIT | ( | x | ) | ... |
Declare an unsigned word64.
W64LIT is used to portability declare or assign 64-bit literal values. W64LIT will append the proper suffix to ensure the compiler accepts the literal.
Use the macro like shown below.
word64 x = W64LIT(0xffffffffffffffff);
Definition at line 129 of file config_int.h.
#define SW64LIT | ( | x | ) | ... |
Declare a signed word64.
SW64LIT is used to portability declare or assign 64-bit literal values. SW64LIT will append the proper suffix to ensure the compiler accepts the literal.
Use the macro like shown below.
sword64 x = SW64LIT(0xffffffffffffffff);
Definition at line 139 of file config_int.h.
#define CRYPTOPP_BOOL_SLOW_WORD64 ... |
Declare ops on word64 are slow.
CRYPTOPP_BOOL_SLOW_WORD64 is typically defined to 1 on platforms that have a machine word smaller than 64-bits. That is, the define is present on 32-bit platforms. The define is also present on platforms where the cpu is slow even with a 64-bit cpu.
Definition at line 146 of file config_int.h.
#define CRYPTOPP_WORD128_AVAILABLE ... |
128-bit word availability
CRYPTOPP_WORD128_AVAILABLE indicates a 128-bit word is available from the platform. 128-bit words are usually available on 64-bit platforms, but not available 32-bit platforms.
If CRYPTOPP_WORD128_AVAILABLE is not defined, then 128-bit words are not available.
GCC and compatible compilers signal 128-bit word availability with the preporcessor macro __SIZEOF_INT128__ >= 16
.
Definition at line 214 of file config_int.h.
typedef unsigned char byte |
8-bit unsigned datatype
The Crypto++ byte
was originally in global namespace to avoid ambiguity with other byte typedefs. byte
was moved to CryptoPP namespace at Crypto++ 6.0 due to C++17, std::byte
and potential compile problems.
Definition at line 66 of file config_int.h.
typedef unsigned short word16 |
typedef unsigned int word32 |
typedef signed char sbyte |
8-bit signed datatype
The 8-bit signed datatype was added to support constant time implementations for curve25519, X25519 key agreement and ed25519 signatures.
Definition at line 79 of file config_int.h.
typedef signed short sword16 |
16-bit signed datatype
The 32-bit signed datatype was added to support constant time implementations for curve25519, X25519 key agreement and ed25519 signatures.
Definition at line 85 of file config_int.h.
typedef signed int sword32 |
32-bit signed datatype
The 32-bit signed datatype was added to support constant time implementations for curve25519, X25519 key agreement and ed25519 signatures.
Definition at line 91 of file config_int.h.
typedef unsigned long long word64 |
64-bit unsigned datatype
The typedef for word64
varies depending on the platform. On Microsoft platforms it is unsigned __int64
. On Unix & Linux with LP64 data model it is unsigned long
. On Unix & Linux with ILP32 data model it is unsigned long long
.
Definition at line 101 of file config_int.h.
typedef signed long long sword64 |
64-bit signed datatype
The typedef for sword64
varies depending on the platform. On Microsoft platforms it is signed __int64
. On Unix & Linux with LP64 data model it is signed long
. On Unix & Linux with ILP32 data model it is signed long long
.
Definition at line 109 of file config_int.h.
typedef __uint128_t word128 |
128-bit unsigned datatype
The typedef for word128
varies depending on the platform. word128
is only available on 64-bit machines when CRYPTOPP_WORD128_AVAILABLE
is defined. On Unix & Linux with LP64 data model it is __uint128_t
. Microsoft platforms do not provide a 128-bit integer type. 32-bit platforms do not provide a 128-bit integer type.
Definition at line 119 of file config_int.h.
Large word type.
lword is a typedef for large word types. It is used for file offsets and such.
Definition at line 168 of file config_int.h.
Half word used for multiprecision integer arithmetic.
hword is used for multiprecision integer arithmetic. The typedef for hword
varies depending on the platform. On 32-bit platforms it is usually word16
. On 64-bit platforms it is usually word32
.
Library users typically use byte, word16, word32 and word64.
Definition at line 184 of file config_int.h.
Full word used for multiprecision integer arithmetic.
word is used for multiprecision integer arithmetic. The typedef for word
varies depending on the platform. On 32-bit platforms it is usually word32
. On 64-bit platforms it is usually word64
.
Library users typically use byte, word16, word32 and word64.
Definition at line 192 of file config_int.h.
Double word used for multiprecision integer arithmetic.
dword is used for multiprecision integer arithmetic. The typedef for dword
varies depending on the platform. On 32-bit platforms it is usually word64
. On 64-bit Unix & Linux platforms it is usually word128
. word128
is not available on Microsoft platforms. word128
is only available when CRYPTOPP_WORD128_AVAILABLE
is defined.
Library users typically use byte, word16, word32 and word64.
Definition at line 203 of file config_int.h.
const lword LWORD_MAX = ... |
Large word type max value.
LWORD_MAX is the maximum value for large word types. Since an lword
is an unsigned type, the value is 0xffffffffffffffff
. W64LIT will append the proper suffix.
Definition at line 174 of file config_int.h.
const unsigned int WORD_SIZE = sizeof(word) |
Size of a platform word in bytes.
The size of a platform word, in bytes
Definition at line 255 of file config_int.h.
const unsigned int WORD_BITS = WORD_SIZE * 8 |
Size of a platform word in bits.
The size of a platform word, in bits
Definition at line 260 of file config_int.h.