Botan 2.19.3
Crypto and TLS for C&
types.h
Go to the documentation of this file.
1/*
2* Low Level Types
3* (C) 1999-2007 Jack Lloyd
4* (C) 2015 Simon Warta (Kullo GmbH)
5* (C) 2016 René Korthaus, Rohde & Schwarz Cybersecurity
6*
7* Botan is released under the Simplified BSD License (see license.txt)
8*/
9
10#ifndef BOTAN_TYPES_H_
11#define BOTAN_TYPES_H_
12
13#include <botan/build.h> // IWYU pragma: export
14#include <botan/assert.h> // IWYU pragma: export
15#include <climits>
16#include <cstddef> // IWYU pragma: export
17#include <cstdint> // IWYU pragma: export
18#include <memory> // IWYU pragma: export
19
20namespace Botan {
21
22/**
23* @mainpage Botan Crypto Library API Reference
24*
25* <dl>
26* <dt>Abstract Base Classes<dd>
27* BlockCipher, HashFunction, KDF, MessageAuthenticationCode, RandomNumberGenerator,
28* StreamCipher, SymmetricAlgorithm, AEAD_Mode, Cipher_Mode
29* <dt>Public Key Interface Classes<dd>
30* PK_Key_Agreement, PK_Signer, PK_Verifier, PK_Encryptor, PK_Decryptor
31* <dt>Authenticated Encryption Modes<dd>
32* @ref CCM_Mode "CCM", @ref ChaCha20Poly1305_Mode "ChaCha20Poly1305", @ref EAX_Mode "EAX",
33* @ref GCM_Mode "GCM", @ref OCB_Mode "OCB", @ref SIV_Mode "SIV"
34* <dt>Block Ciphers<dd>
35* @ref aria.h "ARIA", @ref aes.h "AES", @ref Blowfish, @ref camellia.h "Camellia", @ref Cascade_Cipher "Cascade",
36* @ref CAST_128 "CAST-128", @ref CAST_128 "CAST-256", DES, @ref DESX "DES-X", @ref TripleDES "3DES",
37* @ref GOST_28147_89 "GOST 28147-89", IDEA, KASUMI, Lion, MISTY1, Noekeon, SEED, Serpent, SHACAL2, SM4,
38* @ref Threefish_512 "Threefish", Twofish, XTEA
39* <dt>Stream Ciphers<dd>
40* ChaCha, @ref CTR_BE "CTR", OFB, RC4, Salsa20
41* <dt>Hash Functions<dd>
42* BLAKE2b, @ref GOST_34_11 "GOST 34.11", @ref Keccak_1600 "Keccak", MD4, MD5, @ref RIPEMD_160 "RIPEMD-160",
43* @ref SHA_160 "SHA-1", @ref SHA_224 "SHA-224", @ref SHA_256 "SHA-256", @ref SHA_384 "SHA-384",
44* @ref SHA_512 "SHA-512", @ref Skein_512 "Skein-512", SM3, Streebog, Tiger, Whirlpool
45* <dt>Non-Cryptographic Checksums<dd>
46* Adler32, CRC24, CRC32
47* <dt>Message Authentication Codes<dd>
48* @ref CBC_MAC "CBC-MAC", CMAC, HMAC, Poly1305, SipHash, ANSI_X919_MAC
49* <dt>Random Number Generators<dd>
50* AutoSeeded_RNG, HMAC_DRBG, Processor_RNG, System_RNG
51* <dt>Key Derivation<dd>
52* HKDF, @ref KDF1 "KDF1 (IEEE 1363)", @ref KDF1_18033 "KDF1 (ISO 18033-2)", @ref KDF2 "KDF2 (IEEE 1363)",
53* @ref sp800_108.h "SP800-108", @ref SP800_56C "SP800-56C", @ref PKCS5_PBKDF1 "PBKDF1 (PKCS#5),
54* @ref PKCS5_PBKDF2 "PBKDF2 (PKCS#5)"
55* <dt>Password Hashing<dd>
56* @ref argon2.h "Argon2", @ref scrypt.h "scrypt", @ref bcrypt.h "bcrypt", @ref passhash9.h "passhash9"
57* <dt>Public Key Cryptosystems<dd>
58* @ref dlies.h "DLIES", @ref ecies.h "ECIES", @ref elgamal.h "ElGamal"
59* @ref rsa.h "RSA", @ref newhope.h "NewHope", @ref mceliece.h "McEliece" and @ref mceies.h "MCEIES",
60* @ref sm2.h "SM2"
61* <dt>Public Key Signature Schemes<dd>
62* @ref dsa.h "DSA", @ref ecdsa.h "ECDSA", @ref ecgdsa.h "ECGDSA", @ref eckcdsa.h "ECKCDSA",
63* @ref gost_3410.h "GOST 34.10-2001", @ref sm2.h "SM2", @ref xmss.h "XMSS"
64* <dt>Key Agreement<dd>
65* @ref dh.h "DH", @ref ecdh.h "ECDH"
66* <dt>Compression<dd>
67* @ref bzip2.h "bzip2", @ref lzma.h "lzma", @ref zlib.h "zlib"
68* <dt>TLS<dd>
69* TLS::Client, TLS::Server, TLS::Policy, TLS::Protocol_Version, TLS::Callbacks, TLS::Ciphersuite,
70* TLS::Session, TLS::Session_Manager, Credentials_Manager
71* <dt>X.509<dd>
72* X509_Certificate, X509_CRL, X509_CA, Certificate_Extension, PKCS10_Request, X509_Cert_Options,
73* Certificate_Store, Certificate_Store_In_SQL, Certificate_Store_In_SQLite
74* </dl>
75*/
76
77using std::uint8_t;
78using std::uint16_t;
79using std::uint32_t;
80using std::uint64_t;
81using std::int32_t;
82using std::int64_t;
83using std::size_t;
84
85/*
86* These typedefs are no longer used within the library headers
87* or code. They are kept only for compatability with software
88* written against older versions.
89*/
90using byte = std::uint8_t;
91using u16bit = std::uint16_t;
92using u32bit = std::uint32_t;
93using u64bit = std::uint64_t;
94using s32bit = std::int32_t;
95
96#if (BOTAN_MP_WORD_BITS == 32)
97 typedef uint32_t word;
98#elif (BOTAN_MP_WORD_BITS == 64)
99 typedef uint64_t word;
100#else
101 #error BOTAN_MP_WORD_BITS must be 32 or 64
102#endif
103
104/*
105* Should this assert fail on your system please contact the developers
106* for assistance in porting.
107*/
108static_assert(sizeof(std::size_t) == 8 || sizeof(std::size_t) == 4,
109 "This platform has an unexpected size for size_t");
110
111}
112
113#endif
std::uint64_t u64bit
Definition types.h:93
std::int32_t s32bit
Definition types.h:94
std::uint32_t u32bit
Definition types.h:92
std::uint16_t u16bit
Definition types.h:91
std::uint8_t byte
Definition types.h:90