Crypto++  5.6.3
Free C++ class library of cryptographic schemes
rc5.h
Go to the documentation of this file.
1 // rc5.h - written and placed in the public domain by Wei Dai
2 
3 //! \file rc5.h
4 //! \brief Classes for the RC5 block cipher
5 
6 #ifndef CRYPTOPP_RC5_H
7 #define CRYPTOPP_RC5_H
8 
9 #include "seckey.h"
10 #include "secblock.h"
11 
12 NAMESPACE_BEGIN(CryptoPP)
13 
14 //! _
15 struct RC5_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 0, 255>, public VariableRounds<16>
16 {
17  static const char *StaticAlgorithmName() {return "RC5";}
18  typedef word32 RC5_WORD;
19 };
20 
21 /// <a href="http://www.weidai.com/scan-mirror/cs.html#RC5">RC5</a>
22 class RC5 : public RC5_Info, public BlockCipherDocumentation
23 {
24  class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<RC5_Info>
25  {
26  public:
27  void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &params);
28 
29  protected:
30  unsigned int r; // number of rounds
31  SecBlock<RC5_WORD> sTable; // expanded key table
32  };
33 
34  class CRYPTOPP_NO_VTABLE Enc : public Base
35  {
36  public:
37  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
38  };
39 
40  class CRYPTOPP_NO_VTABLE Dec : public Base
41  {
42  public:
43  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
44  };
45 
46 public:
49 };
50 
53 
54 NAMESPACE_END
55 
56 #endif
Provides Encryption and Decryption typedefs used by derived classes to implement a block cipher...
Definition: seckey.h:385
RC5
Definition: rc5.h:22
Classes and functions for secure memory allocations.
Inherited by block ciphers with fixed block size.
Definition: seckey.h:34
Inherited by ciphers with variable number of rounds.
Definition: seckey.h:60
Classes and functions for implementing secret key algorithms.
_
Definition: rc5.h:15
Inherited by keyed algorithms with variable key length.
Definition: seckey.h:152
Provides class member functions to access BlockCipher constants.
Definition: seckey.h:292
Crypto++ library namespace.
Interface for retrieving values given their names.
Definition: cryptlib.h:261