Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

camellia.h
Go to the documentation of this file.
1 /*
2 * Camellia
3 * (C) 2012 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7
8 #ifndef BOTAN_CAMELLIA_H__
9 #define BOTAN_CAMELLIA_H__
10
11 #include <botan/block_cipher.h>
12
13 namespace Botan {
14
15 /**
16 * Camellia-128
17 */
18 class BOTAN_DLL Camellia_128 final : public Block_Cipher_Fixed_Params<16, 16>
19 {
20 public:
21 void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
22 void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
23
24 void clear() override;
25 std::string name() const override { return "Camellia-128"; }
26 BlockCipher* clone() const override { return new Camellia_128; }
27 private:
28 void key_schedule(const uint8_t key[], size_t length) override;
29
30 secure_vector<uint64_t> m_SK;
31 };
32
33 /**
34 * Camellia-192
35 */
36 class BOTAN_DLL Camellia_192 final : public Block_Cipher_Fixed_Params<16, 24>
37 {
38 public:
39 void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
40 void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
41
42 void clear() override;
43 std::string name() const override { return "Camellia-192"; }
44 BlockCipher* clone() const override { return new Camellia_192; }
45 private:
46 void key_schedule(const uint8_t key[], size_t length) override;
47
48 secure_vector<uint64_t> m_SK;
49 };
50
51 /**
52 * Camellia-256
53 */
54 class BOTAN_DLL Camellia_256 final : public Block_Cipher_Fixed_Params<16, 32>
55 {
56 public:
57 void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
58 void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
59
60 void clear() override;
61 std::string name() const override { return "Camellia-256"; }
62 BlockCipher* clone() const override { return new Camellia_256; }
63 private:
64 void key_schedule(const uint8_t key[], size_t length) override;
65
66 secure_vector<uint64_t> m_SK;
67 };
68
69 }
70
71 #endif
Botan::Camellia_256
Definition: camellia.h:54
Botan::Camellia_256::clone
BlockCipher * clone() const override
Definition: camellia.h:62
Botan::Camellia_128::clone
BlockCipher * clone() const override
Definition: camellia.h:26
Botan::Camellia_128
Definition: camellia.h:18
Botan::Camellia_192::name
std::string name() const override
Definition: camellia.h:43
Botan::secure_vector
std::vector< T, secure_allocator< T >> secure_vector
Definition: secmem.h:121
Botan::Camellia_192
Definition: camellia.h:36
Botan::Camellia_256::name
std::string name() const override
Definition: camellia.h:61
Botan
Definition: alg_id.cpp:13
Botan::Camellia_128::name
std::string name() const override
Definition: camellia.h:25
Botan::Camellia_192::clone
BlockCipher * clone() const override
Definition: camellia.h:44
Botan::Block_Cipher_Fixed_Params
Definition: block_cipher.h:183
Botan::BlockCipher
Definition: block_cipher.h:19