00001
#ifndef CRYPTOPP_RC5_H
00002
#define CRYPTOPP_RC5_H
00003
00004
00005
00006
00007
#include "seckey.h"
00008
#include "secblock.h"
00009
00010 NAMESPACE_BEGIN(CryptoPP)
00011
00012 struct RC5_Info : public
FixedBlockSize<8>, public
VariableKeyLength<16, 0, 255>, public
VariableRounds<16>
00013 {
00014
static const char *StaticAlgorithmName() {
return "RC5";}
00015
typedef word32 RC5_WORD;
00016 };
00017
00018
00019
class RC5 :
public RC5_Info,
public BlockCipherDocumentation
00020 {
00021
class Base :
public BlockCipherBaseTemplate<RC5_Info>
00022 {
00023
public:
00024
void UncheckedSetKey(
CipherDir direction,
const byte *userKey,
unsigned int length,
unsigned int rounds);
00025
00026
protected:
00027
unsigned int r;
00028
SecBlock<RC5_WORD> sTable;
00029 };
00030
00031
class Enc :
public Base
00032 {
00033
public:
00034
void ProcessAndXorBlock(
const byte *inBlock,
const byte *xorBlock, byte *outBlock)
const;
00035 };
00036
00037
class Dec :
public Base
00038 {
00039
public:
00040
void ProcessAndXorBlock(
const byte *inBlock,
const byte *xorBlock, byte *outBlock)
const;
00041 };
00042
00043 public:
00044 typedef BlockCipherTemplate<ENCRYPTION, Enc> Encryption;
00045
typedef BlockCipherTemplate<DECRYPTION, Dec> Decryption;
00046 };
00047
00048
typedef RC5::Encryption RC5Encryption;
00049
typedef RC5::Decryption RC5Decryption;
00050
00051 NAMESPACE_END
00052
00053
#endif