/src/botan/build/include/botan/internal/camellia.h
Line | Count | Source (jump to first uncovered line) |
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 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 | 130 | std::string name() const override { return "Camellia-128"; } |
26 | 0 | 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 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 | 0 | std::string name() const override { return "Camellia-192"; } |
44 | 0 | 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 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 | 281 | std::string name() const override { return "Camellia-256"; } |
62 | 0 | 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 |