00001 #ifndef CRYPTOPP_MARS_H
00002 #define CRYPTOPP_MARS_H
00003
00007 #include "cryptlib.h"
00008 #include "misc.h"
00009
00010 NAMESPACE_BEGIN(CryptoPP)
00011
00013 class MARS : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 56, 4>
00014 {
00015 protected:
00016 MARS(const byte *userKey, unsigned int keylength);
00017
00018 static const word32 Sbox[512];
00019
00020 SecBlock<word32> EK;
00021 };
00022
00024 class MARSEncryption : public MARS
00025 {
00026 public:
00027 MARSEncryption(const byte *userKey, unsigned int keylength=DEFAULT_KEYLENGTH)
00028 : MARS(userKey, keylength) {}
00029
00030 void ProcessBlock(const byte *inBlock, byte * outBlock) const;
00031 void ProcessBlock(byte * inoutBlock) const
00032 {MARSEncryption::ProcessBlock(inoutBlock, inoutBlock);}
00033 };
00034
00036 class MARSDecryption : public MARS
00037 {
00038 public:
00039 MARSDecryption(const byte *userKey, unsigned int keylength=DEFAULT_KEYLENGTH)
00040 : MARS(userKey, keylength) {}
00041
00042 void ProcessBlock(const byte *inBlock, byte * outBlock) const;
00043 void ProcessBlock(byte * inoutBlock) const
00044 {MARSDecryption::ProcessBlock(inoutBlock, inoutBlock);}
00045 };
00046
00047 NAMESPACE_END
00048
00049 #endif