File indexing completed on 2025-01-18 09:55:08
0001
0002
0003
0004
0005
0006 #ifndef CRYPTOPP_RC5_H
0007 #define CRYPTOPP_RC5_H
0008
0009 #include "seckey.h"
0010 #include "secblock.h"
0011
0012 NAMESPACE_BEGIN(CryptoPP)
0013
0014
0015
0016 struct RC5_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 0, 255>, public VariableRounds<16>
0017 {
0018 CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "RC5";}
0019 typedef word32 RC5_WORD;
0020 };
0021
0022
0023
0024
0025 class RC5 : public RC5_Info, public BlockCipherDocumentation
0026 {
0027 class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<RC5_Info>
0028 {
0029 public:
0030 void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms);
0031
0032 protected:
0033 unsigned int r;
0034 SecBlock<RC5_WORD> sTable;
0035 };
0036
0037 class CRYPTOPP_NO_VTABLE Enc : public Base
0038 {
0039 public:
0040 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
0041 };
0042
0043 class CRYPTOPP_NO_VTABLE Dec : public Base
0044 {
0045 public:
0046 void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
0047 };
0048
0049 public:
0050 typedef BlockCipherFinal<ENCRYPTION, Enc> Encryption;
0051 typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
0052 };
0053
0054 typedef RC5::Encryption RC5Encryption;
0055 typedef RC5::Decryption RC5Decryption;
0056
0057 NAMESPACE_END
0058
0059 #endif