1
#ifndef CRYPTOPP_RIJNDAEL_H
2
#define CRYPTOPP_RIJNDAEL_H
10
NAMESPACE_BEGIN(CryptoPP)
13
struct Rijndael_Info : public FixedBlockSize<16>, public VariableKeyLength<16, 16, 32, 8>
15
CRYPTOPP_DLL static const char * CRYPTOPP_API StaticAlgorithmName() {return CRYPTOPP_RIJNDAEL_NAME;}
18
/// <a href="http://www.weidai.com/scan-mirror/cs.html#Rijndael">Rijndael</a>
19
class CRYPTOPP_DLL Rijndael : public Rijndael_Info, public BlockCipherDocumentation
21
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Base : public BlockCipherImpl<Rijndael_Info>
24
void UncheckedSetKey(const byte *userKey, unsigned int length, const NameValuePairs ¶ms);
27
static void FillEncTable();
28
static void FillDecTable();
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];
34
static const word32 rcon[];
36
unsigned int m_rounds;
37
FixedSizeAlignedSecBlock<word32, 4*15> m_key;
40
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Enc : public Base
43
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
44
#if CRYPTOPP_BOOL_SSE2_ASM_AVAILABLE || defined(CRYPTOPP_X64_MASM_AVAILABLE)
45
size_t AdvancedProcessBlocks(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const;
49
class CRYPTOPP_DLL CRYPTOPP_NO_VTABLE Dec : public Base
52
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const;
56
typedef BlockCipherFinal<ENCRYPTION, Enc> Encryption;
57
typedef BlockCipherFinal<DECRYPTION, Dec> Decryption;
60
typedef Rijndael::Encryption RijndaelEncryption;
61
typedef Rijndael::Decryption RijndaelDecryption;