CsCrypto  1.0.1
aes.h
1 /***********************************************************************
2 *
3 * Copyright (c) 2021-2024 Tim van Deurzen
4 * Copyright (c) 2021-2024 Barbara Geller
5 * Copyright (c) 2021-2024 Ansel Sermersheim
6 *
7 * This file is part of CsCrypto.
8 *
9 * CsCrypto is free software, released under the BSD 2-Clause license.
10 * For license details refer to LICENSE provided with this project.
11 *
12 * CsCrypto is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 *
16 * https://opensource.org/licenses/BSD-2-Clause
17 *
18 ***********************************************************************/
19 
20 #ifndef CS_CRYPTO_CORE_AES_H
21 #define CS_CRYPTO_CORE_AES_H
22 
23 #include <cstddef>
24 
25 namespace cs_crypto::block_cipher {
26 
27 // all AES variations have the same block size, i.e. 16 bytes.
28 struct aes_base {
29  constexpr static const std::size_t block_size = 16;
30 };
31 
32 // AES 128 has a 16 byte block and a 16 byte key.
33 struct aes128 : public aes_base {
34  constexpr static const std::size_t key_size = 16;
35 };
36 
37 // AES 192 has a 16 byte block and a 24 byte key.
38 
39 struct aes192 : public aes_base {
40  constexpr static const std::size_t key_size = 24;
41 };
42 
43 // AES 256 has a 16 byte block and a 32 byte key.
44 struct aes256 : public aes_base {
45  constexpr static const std::size_t key_size = 32;
46 };
47 
48 } // namespace cs_crypto::block_cipher
49 
50 #endif