00001
00002
00003
00004
00005
00006 #ifndef CRYPTOPP_CAMELLIA_H
00007 #define CRYPTOPP_CAMELLIA_H
00008
00009 #include "config.h"
00010 #include "seckey.h"
00011 #include "secblock.h"
00012
00013 NAMESPACE_BEGIN(CryptoPP)
00014
00015
00016 struct Camellia_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8>
00017 {
00018 static const char *StaticAlgorithmName() {return "Camellia";}
00019 };
00020
00021
00022 class Camellia : public Camellia_Info, public BlockCipherDocumentation
00023 {
00024 class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<Camellia_Info>
00025 {
00026 public:
00027 void UncheckedSetKey(const byte *key, unsigned int keylen, const NameValuePairs ¶ms);
00028 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
00029
00030 protected:
00031 static const byte s1[256];
00032 static const word32 SP[4][256];
00033
00034 unsigned int m_rounds;
00035 SecBlock<word32> m_key;
00036 };
00037
00038 public:
00039 typedef BlockCipherFinal<ENCRYPTION, Base> Encryption;
00040 typedef BlockCipherFinal<DECRYPTION, Base> Decryption;
00041 };
00042
00043 typedef Camellia::Encryption CamelliaEncryption;
00044 typedef Camellia::Decryption CamelliaDecryption;
00045
00046 NAMESPACE_END
00047
00048 #endif