Crypto++
rc5.h
Go to the documentation of this file.
1 #ifndef CRYPTOPP_RC5_H
2 #define CRYPTOPP_RC5_H
3 
4 /** \file
5 */
6 
7 #include "seckey.h"
8 #include "secblock.h"
9 
10 NAMESPACE_BEGIN(CryptoPP)
11 
12 //! _
13 struct RC5_Info : public FixedBlockSize<8>, public VariableKeyLength<16, 0, 255>, public VariableRounds<16>
14 {
15  static const char *StaticAlgorithmName() {return "RC5";}
16  typedef word32 RC5_WORD;
17 };
18 
19 /// <a href="http://www.weidai.com/scan-mirror/cs.html#RC5">RC5</a>
20 class RC5 : public RC5_Info, public BlockCipherDocumentation
21 {
22  class CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<RC5_Info>
23  {
24  public:
25  void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &params);
26 
27  protected:
28  unsigned int r; // number of rounds
29  SecBlock<RC5_WORD> sTable; // expanded key table
30  };
31 
32  class CRYPTOPP_NO_VTABLE Enc : public Base
33  {
34  public:
35  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
36  };
37 
38  class CRYPTOPP_NO_VTABLE Dec : public Base
39  {
40  public:
41  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
42  };
43 
44 public:
47 };
48 
51 
52 NAMESPACE_END
53 
54 #endif
These objects usually should not be used directly. See CipherModeDocumentation instead.
Definition: seckey.h:188
RC5
Definition: rc5.h:20
to be inherited by block ciphers with fixed block size
Definition: seckey.h:21
to be inherited by ciphers with variable number of rounds
Definition: seckey.h:39
_
Definition: rc5.h:13
support query of variable key length, template parameters are default, min, max, multiple (default mu...
Definition: seckey.h:80
interface for retrieving values given their names
Definition: cryptlib.h:224