00001 #ifndef CRYPTOPP_RIJNDAEL_H
00002 #define CRYPTOPP_RIJNDAEL_H
00003
00007 #include "cryptlib.h"
00008 #include "misc.h"
00009
00010 NAMESPACE_BEGIN(CryptoPP)
00011
00013
00023 class Rijndael : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8>
00024 {
00025 protected:
00026 Rijndael(const byte *userKey, unsigned int keylength);
00027
00028 static const word32 Te0[256];
00029 static const word32 Te1[256];
00030 static const word32 Te2[256];
00031 static const word32 Te3[256];
00032 static const word32 Te4[256];
00033
00034 static const word32 Td0[256];
00035 static const word32 Td1[256];
00036 static const word32 Td2[256];
00037 static const word32 Td3[256];
00038 static const word32 Td4[256];
00039
00040 static const word32 rcon[];
00041
00042 unsigned int m_rounds;
00043 SecBlock<word32> m_key;
00044 };
00045
00047 class RijndaelEncryption : public Rijndael
00048 {
00049 public:
00050 RijndaelEncryption(const byte *userKey, unsigned int keylength=DEFAULT_KEYLENGTH)
00051 : Rijndael(userKey, keylength) {}
00052
00053 void ProcessBlock(const byte *inBlock, byte * outBlock) const;
00054 void ProcessBlock(byte * inoutBlock) const
00055 {RijndaelEncryption::ProcessBlock(inoutBlock, inoutBlock);}
00056 };
00057
00059 class RijndaelDecryption : public Rijndael
00060 {
00061 public:
00062 RijndaelDecryption(const byte *userKey, unsigned int keylength=DEFAULT_KEYLENGTH);
00063
00064 void ProcessBlock(const byte *inBlock, byte * outBlock) const;
00065 void ProcessBlock(byte * inoutBlock) const
00066 {RijndaelDecryption::ProcessBlock(inoutBlock, inoutBlock);}
00067 };
00068
00069 NAMESPACE_END
00070
00071 #endif