Crypto++
rijndael.h
Go to the documentation of this file.
1 #ifndef CRYPTOPP_RIJNDAEL_H
2 #define CRYPTOPP_RIJNDAEL_H
3 
4 /** \file
5 */
6 
7 #include "seckey.h"
8 #include "secblock.h"
9 
10 NAMESPACE_BEGIN(CryptoPP)
11 
12 //! _
13 struct Rijndael_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8>
14 {
15  CRYPTOPP_DLL static const char * CRYPTOPP_API StaticAlgorithmName() {return CRYPTOPP_RIJNDAEL_NAME;}
16 };
17 
18 /// <a href="http://www.weidai.com/scan-mirror/cs.html#Rijndael">Rijndael</a>
19 class CRYPTOPP_DLL Rijndael : public Rijndael_Info, public BlockCipherDocumentation
20 {
21  class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<Rijndael_Info>
22  {
23  public:
24  void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &params);
25 
26  protected:
27  static void FillEncTable();
28  static void FillDecTable();
29 
30  // VS2005 workaround: have to put these on seperate lines, or error C2487 is triggered in DLL build
31  static const byte Se[256];
32  static const byte Sd[256];
33 
34  static const word32 rcon[];
35 
36  unsigned int m_rounds;
38  };
39 
40  class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Enc : public Base
41  {
42  public:
43  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
44 #if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X86
45  size_t AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const;
46 #endif
47  };
48 
49  class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Dec : public Base
50  {
51  public:
52  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
53 #if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE
54  size_t AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const;
55 #endif
56  };
57 
58 public:
61 };
62 
65 
66 NAMESPACE_END
67 
68 #endif
These objects usually should not be used directly. See CipherModeDocumentation instead.
Definition: seckey.h:188
Rijndael
Definition: rijndael.h:19
to be inherited by block ciphers with fixed block size
Definition: seckey.h:21
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