Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

rc5.h

Go to the documentation of this file.
00001 #ifndef CRYPTOPP_RC5_H
00002 #define CRYPTOPP_RC5_H
00003 
00007 #include "cryptlib.h"
00008 #include "misc.h"
00009 
00010 NAMESPACE_BEGIN(CryptoPP)
00011 
00013 class RC5Base : public FixedBlockSize<8>, public VariableKeyLength<16, 0, 255>
00014 {
00015 public:
00016         typedef word32 RC5_WORD;
00017 
00018         enum {DEFAULT_ROUNDS=16};
00019 
00020 protected:
00021         RC5Base(const byte *key, unsigned int keyLen, unsigned int rounds);
00022 
00023         const unsigned int r;       // number of rounds
00024         SecBlock<RC5_WORD> sTable;  // expanded key table
00025 };
00026 
00028 class RC5Encryption : public RC5Base
00029 {
00030 public:
00031         RC5Encryption(const byte *key, unsigned int keyLen=DEFAULT_KEYLENGTH, unsigned int rounds=DEFAULT_ROUNDS)
00032                 : RC5Base(key, keyLen, rounds) {}
00033 
00034         void ProcessBlock(byte * inoutBlock) const
00035                 {RC5Encryption::ProcessBlock(inoutBlock, inoutBlock);}
00036         void ProcessBlock(const byte *inBlock, byte * outBlock) const;
00037 };
00038 
00040 class RC5Decryption : public RC5Base
00041 {
00042 public:
00043         RC5Decryption(const byte *key, unsigned int keyLen=DEFAULT_KEYLENGTH, unsigned int rounds=DEFAULT_ROUNDS)
00044                 : RC5Base(key, keyLen, rounds) {}
00045 
00046         void ProcessBlock(byte * inoutBlock) const
00047                 {RC5Decryption::ProcessBlock(inoutBlock, inoutBlock);}
00048         void ProcessBlock(const byte *inBlock, byte * outBlock) const;
00049 };
00050 
00051 NAMESPACE_END
00052 
00053 #endif

Generated at Mon Jan 15 01:16:35 2001 for Crypto++ by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000