Fabcoin Core  0.16.2
P2P Digital Currency
rijndael.h
Go to the documentation of this file.
1 // rijndael.h - written and placed in the public domain by Wei Dai
2 
7 
8 #ifndef CRYPTOPP_RIJNDAEL_H
9 #define CRYPTOPP_RIJNDAEL_H
10 
11 #include "seckey.h"
12 #include "secblock.h"
13 
14 // Clang 3.3 integrated assembler crash on Linux
15 #if CRYPTOPP_BOOL_X32 || (defined(CRYPTOPP_LLVM_CLANG_VERSION) && (CRYPTOPP_LLVM_CLANG_VERSION < 30400))
16 # define CRYPTOPP_DISABLE_RIJNDAEL_ASM
17 #endif
18 
20 
21 struct Rijndael_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8>
23 {
25 };
26 
30 {
33  class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<Rijndael_Info>
34  {
35  public:
36  void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs &params);
37 
38  protected:
39  static void FillEncTable();
40  static void FillDecTable();
41 
42  // VS2005 workaround: have to put these on separate lines, or error C2487 is triggered in DLL build
43  static const byte Se[256];
44  static const byte Sd[256];
45 
46  static const word32 rcon[];
47 
48  unsigned int m_rounds;
50  };
51 
55  {
56  public:
57  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
58 #if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86
59  Enc();
60  size_t AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const;
61  private:
62  SecByteBlock m_aliasBlock;
63 #endif
64  };
65 
69  {
70  public:
71  void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
72 #if CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86
73  size_t AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const;
74 #endif
75  };
76 
77 public:
80 };
81 
84 
86 
87 #endif
uint8_t byte
Definition: Common.h:57
Provides Encryption and Decryption typedefs used by derived classes to implement a block cipher...
Definition: seckey.h:408
virtual void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const =0
Encrypt or decrypt a block.
#define NAMESPACE_BEGIN(x)
Definition: config.h:200
Rijndael block cipher data processing functions.
Definition: rijndael.h:68
virtual size_t AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const
Encrypt and xor multiple blocks using additional flags.
Definition: cryptlib.cpp:178
static CRYPTOPP_DLL const char *CRYPTOPP_API StaticAlgorithmName()
Definition: rijndael.h:24
Rijndael block cipher implementation details.
Definition: rijndael.h:29
Classes and functions for secure memory allocations.
Rijndael::Decryption RijndaelDecryption
Definition: rijndael.h:83
Inherited by algorithms with fixed block size.
Definition: seckey.h:40
BlockCipherFinal< ENCRYPTION, Enc > Encryption
Definition: rijndael.h:78
Rijndael::Encryption RijndaelEncryption
Definition: rijndael.h:82
FixedSizeAlignedSecBlock< word32, 4 *15 > m_key
Definition: rijndael.h:49
Rijndael block cipher data processing functions.
Definition: rijndael.h:54
Classes and functions for implementing secret key algorithms.
unsigned int m_rounds
Definition: rijndael.h:48
#define CRYPTOPP_API
Definition: config.h:705
BlockCipherFinal< DECRYPTION, Dec > Decryption
Definition: rijndael.h:79
Inherited by keyed algorithms with variable key length.
Definition: seckey.h:169
#define CRYPTOPP_NO_VTABLE
Definition: config.h:369
Rijndael block cipher data processing functionss.
Definition: rijndael.h:33
#define CRYPTOPP_RIJNDAEL_NAME
Definition: config.h:116
#define NAMESPACE_END
Definition: config.h:201
Rijndael block cipher information.
Definition: rijndael.h:22
Provides a base implementation of Algorithm and SimpleKeyingInterface for block ciphers.
Definition: seckey.h:311
#define CRYPTOPP_DLL
Definition: config.h:704
unsigned int word32
Definition: config.h:231
Interface for retrieving values given their names.
Definition: cryptlib.h:279