Botan 1.10.17

camellia.h
Go to the documentation of this file.
1 /*
2 * Camellia
3 * (C) 2012 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
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 : public Block_Cipher_Fixed_Params<16, 16>
19 {
20 public:
21 void encrypt_n(const byte in[], byte out[], size_t blocks) const;
22 void decrypt_n(const byte in[], byte out[], size_t blocks) const;
23
24 void clear() { SK.clear(); }
25 std::string name() const { return "Camellia-128"; }
26 BlockCipher* clone() const { return new Camellia_128; }
27 private:
28 void key_schedule(const byte key[], size_t length);
29
30 SecureVector<u64bit> SK;
31 };
32
33 /**
34 * Camellia-192
35 */
36 class BOTAN_DLL Camellia_192 : public Block_Cipher_Fixed_Params<16, 24>
37 {
38 public:
39 void encrypt_n(const byte in[], byte out[], size_t blocks) const;
40 void decrypt_n(const byte in[], byte out[], size_t blocks) const;
41
42 void clear() { SK.clear(); }
43 std::string name() const { return "Camellia-192"; }
44 BlockCipher* clone() const { return new Camellia_192; }
45 private:
46 void key_schedule(const byte key[], size_t length);
47
48 SecureVector<u64bit> SK;
49 };
50
51 /**
52 * Camellia-256
53 */
54 class BOTAN_DLL Camellia_256 : public Block_Cipher_Fixed_Params<16, 32>
55 {
56 public:
57 void encrypt_n(const byte in[], byte out[], size_t blocks) const;
58 void decrypt_n(const byte in[], byte out[], size_t blocks) const;
59
60 void clear() { SK.clear(); }
61 std::string name() const { return "Camellia-256"; }
62 BlockCipher* clone() const { return new Camellia_256; }
63 private:
64 void key_schedule(const byte key[], size_t length);
65
66 SecureVector<u64bit> SK;
67 };
68
69 }
70
71 #endif
Botan::Camellia_128::name
std::string name() const
Definition: camellia.h:25
Botan::Camellia_256
Definition: camellia.h:54
Botan::Camellia_192::clone
BlockCipher * clone() const
Definition: camellia.h:44
Botan::Camellia_192::clear
void clear()
Definition: camellia.h:42
Botan::Camellia_128::clone
BlockCipher * clone() const
Definition: camellia.h:26
Botan::Camellia_128
Definition: camellia.h:18
Botan::Camellia_256::clear
void clear()
Definition: camellia.h:60
Botan::Camellia_256::name
std::string name() const
Definition: camellia.h:61
Botan::byte
unsigned char byte
Definition: types.h:22
Botan::Camellia_192
Definition: camellia.h:36
Botan::Camellia_192::name
std::string name() const
Definition: camellia.h:43
Botan
Definition: algo_base.h:14
Botan::Camellia_128::clear
void clear()
Definition: camellia.h:24
Botan::SecureVector< u64bit >
Botan::Block_Cipher_Fixed_Params
Definition: block_cipher.h:104
Botan::Camellia_256::clone
BlockCipher * clone() const
Definition: camellia.h:62
Botan::BlockCipher
Definition: block_cipher.h:18