Botan 3.0.0-alpha0
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 <cstddef> // IWYU pragma: export
16#include <cstdint> // IWYU pragma: export
17#include <memory> // IWYU pragma: export
18
19namespace Botan {
20
21/**
22* @mainpage Botan Crypto Library API Reference
23*
24* <dl>
25* <dt>Abstract Base Classes<dd>
26* BlockCipher, HashFunction, KDF, MessageAuthenticationCode, RandomNumberGenerator,
27* StreamCipher, SymmetricAlgorithm, AEAD_Mode, Cipher_Mode
28* <dt>Public Key Interface Classes<dd>
29* PK_Key_Agreement, PK_Signer, PK_Verifier, PK_Encryptor, PK_Decryptor
30* <dt>Authenticated Encryption Modes<dd>
31* @ref CCM_Mode "CCM", @ref ChaCha20Poly1305_Mode "ChaCha20Poly1305", @ref EAX_Mode "EAX",
32* @ref GCM_Mode "GCM", @ref OCB_Mode "OCB", @ref SIV_Mode "SIV"
33* <dt>Block Ciphers<dd>
34* @ref aria.h "ARIA", @ref aes.h "AES", @ref Blowfish, @ref camellia.h "Camellia", @ref Cascade_Cipher "Cascade",
35* @ref CAST_128 "CAST-128", @ref CAST_128 DES, @ref TripleDES "3DES",
36* @ref GOST_28147_89 "GOST 28147-89", IDEA, Lion, Noekeon, SEED, Serpent, SHACAL2, SM4,
37* @ref Threefish_512 "Threefish", Twofish
38* <dt>Stream Ciphers<dd>
39* ChaCha, @ref CTR_BE "CTR", OFB, RC4, Salsa20
40* <dt>Hash Functions<dd>
41* BLAKE2b, @ref GOST_34_11 "GOST 34.11", @ref Keccak_1600 "Keccak", MD4, MD5, @ref RIPEMD_160 "RIPEMD-160",
42* @ref SHA_160 "SHA-1", @ref SHA_224 "SHA-224", @ref SHA_256 "SHA-256", @ref SHA_384 "SHA-384",
43* @ref SHA_512 "SHA-512", @ref Skein_512 "Skein-512", SM3, Streebog, Whirlpool
44* <dt>Non-Cryptographic Checksums<dd>
45* Adler32, CRC24, CRC32
46* <dt>Message Authentication Codes<dd>
47* CMAC, HMAC, Poly1305, SipHash, ANSI_X919_MAC
48* <dt>Random Number Generators<dd>
49* AutoSeeded_RNG, HMAC_DRBG, Processor_RNG, System_RNG
50* <dt>Key Derivation<dd>
51* HKDF, @ref KDF1 "KDF1 (IEEE 1363)", @ref KDF1_18033 "KDF1 (ISO 18033-2)", @ref KDF2 "KDF2 (IEEE 1363)",
52* @ref sp800_108.h "SP800-108", @ref SP800_56C "SP800-56C", @ref PKCS5_PBKDF2 "PBKDF2 (PKCS#5)"
53* <dt>Password Hashing<dd>
54* @ref argon2.h "Argon2", @ref scrypt.h "scrypt", @ref bcrypt.h "bcrypt", @ref passhash9.h "passhash9"
55* <dt>Public Key Cryptosystems<dd>
56* @ref dlies.h "DLIES", @ref ecies.h "ECIES", @ref elgamal.h "ElGamal"
57* @ref rsa.h "RSA", @ref newhope.h "NewHope", @ref mceliece.h "McEliece"
58* @ref sm2.h "SM2"
59* <dt>Public Key Signature Schemes<dd>
60* @ref dsa.h "DSA", @ref ecdsa.h "ECDSA", @ref ecgdsa.h "ECGDSA", @ref eckcdsa.h "ECKCDSA",
61* @ref gost_3410.h "GOST 34.10-2001", @ref sm2.h "SM2", @ref xmss.h "XMSS"
62* <dt>Key Agreement<dd>
63* @ref dh.h "DH", @ref ecdh.h "ECDH"
64* <dt>Compression<dd>
65* @ref bzip2.h "bzip2", @ref lzma.h "lzma", @ref zlib.h "zlib"
66* <dt>TLS<dd>
67* TLS::Client, TLS::Server, TLS::Policy, TLS::Protocol_Version, TLS::Callbacks, TLS::Ciphersuite,
68* TLS::Session, TLS::Session_Manager, Credentials_Manager
69* <dt>X.509<dd>
70* X509_Certificate, X509_CRL, X509_CA, Certificate_Extension, PKCS10_Request, X509_Cert_Options,
71* Certificate_Store, Certificate_Store_In_SQL, Certificate_Store_In_SQLite
72* </dl>
73*/
74
75using std::uint8_t;
76using std::uint16_t;
77using std::uint32_t;
78using std::uint64_t;
79using std::int32_t;
80using std::int64_t;
81using std::size_t;
82
83#if !defined(BOTAN_IS_BEING_BUILT)
84/*
85* These typedefs are no longer used within the library headers
86* or code. They are kept only for compatability with software
87* written against older versions.
88*/
89using byte = std::uint8_t;
90using u16bit = std::uint16_t;
91using u32bit = std::uint32_t;
92using u64bit = std::uint64_t;
93using s32bit = std::int32_t;
94#endif
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
Definition: alg_id.cpp:13
std::uint64_t u64bit
Definition: types.h:92
std::int32_t s32bit
Definition: types.h:93
std::uint32_t u32bit
Definition: types.h:91
std::uint16_t u16bit
Definition: types.h:90