Botan
1.11.15
|
00001 /* 00002 * Camellia 00003 * (C) 2012 Jack Lloyd 00004 * 00005 * Botan is released under the Simplified BSD License (see license.txt) 00006 */ 00007 00008 #ifndef BOTAN_CAMELLIA_H__ 00009 #define BOTAN_CAMELLIA_H__ 00010 00011 #include <botan/block_cipher.h> 00012 00013 namespace Botan { 00014 00015 /** 00016 * Camellia-128 00017 */ 00018 class BOTAN_DLL Camellia_128 : public Block_Cipher_Fixed_Params<16, 16> 00019 { 00020 public: 00021 void encrypt_n(const byte in[], byte out[], size_t blocks) const; 00022 void decrypt_n(const byte in[], byte out[], size_t blocks) const; 00023 00024 void clear(); 00025 std::string name() const { return "Camellia-128"; } 00026 BlockCipher* clone() const { return new Camellia_128; } 00027 private: 00028 void key_schedule(const byte key[], size_t length); 00029 00030 secure_vector<u64bit> SK; 00031 }; 00032 00033 /** 00034 * Camellia-192 00035 */ 00036 class BOTAN_DLL Camellia_192 : public Block_Cipher_Fixed_Params<16, 24> 00037 { 00038 public: 00039 void encrypt_n(const byte in[], byte out[], size_t blocks) const; 00040 void decrypt_n(const byte in[], byte out[], size_t blocks) const; 00041 00042 void clear(); 00043 std::string name() const { return "Camellia-192"; } 00044 BlockCipher* clone() const { return new Camellia_192; } 00045 private: 00046 void key_schedule(const byte key[], size_t length); 00047 00048 secure_vector<u64bit> SK; 00049 }; 00050 00051 /** 00052 * Camellia-256 00053 */ 00054 class BOTAN_DLL Camellia_256 : public Block_Cipher_Fixed_Params<16, 32> 00055 { 00056 public: 00057 void encrypt_n(const byte in[], byte out[], size_t blocks) const; 00058 void decrypt_n(const byte in[], byte out[], size_t blocks) const; 00059 00060 void clear(); 00061 std::string name() const { return "Camellia-256"; } 00062 BlockCipher* clone() const { return new Camellia_256; } 00063 private: 00064 void key_schedule(const byte key[], size_t length); 00065 00066 secure_vector<u64bit> SK; 00067 }; 00068 00069 } 00070 00071 #endif