Botan  2.6.0
Crypto and TLS for C++11
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_PUBLIC_API(2,0) 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 
31  };
32 
33 /**
34 * Camellia-192
35 */
36 class BOTAN_PUBLIC_API(2,0) 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 
49  };
50 
51 /**
52 * Camellia-256
53 */
54 class BOTAN_PUBLIC_API(2,0) 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 
67  };
68 
69 }
70 
71 #endif
BlockCipher * clone() const override
Definition: camellia.h:62
BlockCipher * clone() const override
Definition: camellia.h:26
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:27
std::string name() const override
Definition: camellia.h:43
std::string name() const override
Definition: camellia.h:61
Definition: alg_id.cpp:13
std::string name() const override
Definition: camellia.h:25
BlockCipher * clone() const override
Definition: camellia.h:44
std::vector< T, secure_allocator< T > > secure_vector
Definition: secmem.h:88