Fabcoin Core  0.16.2
P2P Digital Currency
rc5.h
Go to the documentation of this file.
1 // rc5.h - written and placed in the public domain by Wei Dai
2 
5 
6 #ifndef CRYPTOPP_RC5_H
7 #define CRYPTOPP_RC5_H
8 
9 #include "seckey.h"
10 #include "secblock.h"
11 
13 
14 struct RC5_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 0, 255>, public VariableRounds<16>
18 {
19  CRYPTOPP_STATIC_CONSTEXPR const char* StaticAlgorithmName() {return "RC5";}
20  typedef word32 RC5_WORD;
21 };
22 
27 class RC5 : public RC5_Info, public BlockCipherDocumentation
28 {
29  class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<RC5_Info>
30  {
31  public:
32  void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &params);
33 
34  protected:
35  unsigned int r; // number of rounds
36  SecBlock<RC5_WORD> sTable; // expanded key table
37  };
38 
39  class CRYPTOPP_NO_VTABLE Enc : public Base
40  {
41  public:
42  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
43  };
44 
45  class CRYPTOPP_NO_VTABLE Dec : public Base
46  {
47  public:
48  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
49  };
50 
51 public:
54 };
55 
58 
60 
61 #endif
BlockCipherFinal< ENCRYPTION, Enc > Encryption
Definition: rc5.h:52
uint8_t byte
Definition: Common.h:57
#define CRYPTOPP_STATIC_CONSTEXPR
Definition: config.h:892
RC5::Encryption RC5Encryption
Definition: rc5.h:56
CRYPTOPP_STATIC_CONSTEXPR const char * StaticAlgorithmName()
Definition: rc5.h:19
Provides Encryption and Decryption typedefs used by derived classes to implement a block cipher...
Definition: seckey.h:408
SecBlock< RC5_WORD > sTable
Definition: rc5.h:36
BlockCipherFinal< DECRYPTION, Dec > Decryption
Definition: rc5.h:53
#define NAMESPACE_BEGIN(x)
Definition: config.h:200
RC5 block cipher.
Definition: rc5.h:27
Definition: rc5.h:39
Classes and functions for secure memory allocations.
Inherited by algorithms with fixed block size.
Definition: seckey.h:40
Inherited by algorithms with variable number of rounds.
Definition: seckey.h:66
Classes and functions for implementing secret key algorithms.
RC5::Decryption RC5Decryption
Definition: rc5.h:57
unsigned int r
Definition: rc5.h:35
RC5 block cipher information.
Definition: rc5.h:17
Inherited by keyed algorithms with variable key length.
Definition: seckey.h:169
#define CRYPTOPP_NO_VTABLE
Definition: config.h:369
Definition: rc5.h:29
#define NAMESPACE_END
Definition: config.h:201
Provides a base implementation of Algorithm and SimpleKeyingInterface for block ciphers.
Definition: seckey.h:311
Definition: rc5.h:45
word32 RC5_WORD
Definition: rc5.h:20
unsigned int word32
Definition: config.h:231
Interface for retrieving values given their names.
Definition: cryptlib.h:279