Crypto++ 8.5 Free C++ class library of cryptographic schemes

Macros | Typedefs | Variables
config_int.h File Reference

Library configuration file. More...

Go to the source code of this file.

## Macros
#define | CRYPTOPP_NO_GLOBAL_BYTE 1
| Library byte guard. More...
#define | W64LIT(x) ...
| Declare an unsigned word64. More...
#define | SW64LIT(x) ...
| Declare a signed word64. More...
#define | CRYPTOPP_BOOL_SLOW_WORD64 ...
| Declare ops on word64 are slow. More...
#define | CRYPTOPP_WORD128_AVAILABLE ...
| 128-bit word availability More...

## Typedefs
typedef unsigned char | byte
| 8-bit unsigned datatype More...
typedef unsigned short | word16
| 16-bit unsigned datatype More...
typedef unsigned int | word32
| 32-bit unsigned datatype More...
typedef signed char | sbyte
| 8-bit signed datatype More...
typedef signed short | sword16
| 16-bit signed datatype More...
typedef signed int | sword32
| 32-bit signed datatype More...
typedef unsigned long long | word64
| 64-bit unsigned datatype More...
typedef signed long long | sword64
| 64-bit signed datatype More...
typedef __uint128_t | word128
| 128-bit unsigned datatype More...
typedef word64 | lword
| Large word type. More...
typedef word32 | hword
| Half word used for multiprecision integer arithmetic. More...
typedef word64 | word
| Full word used for multiprecision integer arithmetic. More...
typedef word128 | dword
| Double word used for multiprecision integer arithmetic. More...

## Variables
const lword | LWORD_MAX = ...
| Large word type max value. More...
const unsigned int | WORD_SIZE = sizeof(word)
| Size of a platform word in bytes. More...
const unsigned int | WORD_BITS = WORD_SIZE * 8
| Size of a platform word in bits. More...

## Detailed Description

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.

Note
  You should include `config.h` rather than `config_int.h` directly.

See also
  Issue 835, Make config.h more autoconf friendly, Configure.sh script on the Crypto++ wiki

Since
  Crypto++ 8.3

Definition in file config_int.h.

## Macro Definition Documentation

## ◆ CRYPTOPP_NO_GLOBAL_BYTE

#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.

See also
  Issue 442, std::byte on the Crypto++ wiki

Since
  Crypto++ 6.0

Definition at line 41 of file config_int.h.

## ◆ W64LIT

#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);

Since
  Crypto++ 1.0

Definition at line 119 of file config_int.h.

## ◆ SW64LIT

#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);

Since
  Crypto++ 8.0

Definition at line 129 of file config_int.h.

## ◆ CRYPTOPP_BOOL_SLOW_WORD64

#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 136 of file config_int.h.

## ◆ CRYPTOPP_WORD128_AVAILABLE

#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`.

Since
  Crypto++ 2.0

Definition at line 204 of file config_int.h.

## Typedef Documentation

## ◆ byte

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.

See also
  CRYPTOPP_NO_GLOBAL_BYTE, Issue 442, std::byte on the Crypto++ wiki

Since
  Crypto++ 1.0, CryptoPP namespace since Crypto++ 6.0

Definition at line 56 of file config_int.h.

## ◆ word16

typedef unsigned short word16

16-bit unsigned datatype

Since
  Crypto++ 1.0

Definition at line 59 of file config_int.h.

## ◆ word32

typedef unsigned int word32

32-bit unsigned datatype

Since
  Crypto++ 1.0

Definition at line 62 of file config_int.h.

## ◆ sbyte

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.

Since
  Crypto++ 8.0

Definition at line 69 of file config_int.h.

## ◆ sword16

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.

Since
  Crypto++ 8.0

Definition at line 75 of file config_int.h.

## ◆ sword32

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.

Since
  Crypto++ 8.0

Definition at line 81 of file config_int.h.

## ◆ word64

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`.

Since
  Crypto++ 1.0

Definition at line 91 of file config_int.h.

## ◆ sword64

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`.

Since
  Crypto++ 8.0

Definition at line 99 of file config_int.h.

## ◆ word128

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.

Since
  Crypto++ 5.6

Definition at line 109 of file config_int.h.

## ◆ lword

typedef word64 lword

Large word type.

lword is a typedef for large word types. It is used for file offsets and such.

Definition at line 158 of file config_int.h.

## ◆ hword

typedef word32 hword

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.

Since
  Crypto++ 2.0

Definition at line 174 of file config_int.h.

## ◆ word

typedef word64 word

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.

Since
  Crypto++ 2.0

Definition at line 182 of file config_int.h.

## ◆ dword

typedef word128 dword

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.

See also
  CRYPTOPP_WORD128_AVAILABLE

Since
  Crypto++ 2.0

Definition at line 193 of file config_int.h.

## Variable Documentation

## ◆ LWORD_MAX

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 164 of file config_int.h.

## ◆ WORD_SIZE

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 245 of file config_int.h.

## ◆ WORD_BITS

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 249 of file config_int.h.