4 /**************************************************************************
5 * This code is based on Szymon Stefanek AES implementation: *
6 * http://www.esat.kuleuven.ac.be/~rijmen/rijndael/rijndael-cpplib.tar.gz *
8 * Dynamic tables generation is based on the Brian Gladman's work: *
9 * http://fp.gladman.plus.com/cryptography_technology/rijndael *
10 **************************************************************************/
12 #define _MAX_KEY_COLUMNS (256/32)
13 #define _MAX_ROUNDS 14
14 #define MAX_IV_SIZE 16
19 enum Direction { Encrypt , Decrypt };
21 void keySched(byte key[_MAX_KEY_COLUMNS][4]);
23 void encrypt(const byte a[16], byte b[16]);
24 void decrypt(const byte a[16], byte b[16]);
25 void GenerateTables();
27 Direction m_direction;
28 byte m_initVector[MAX_IV_SIZE];
29 byte m_expandedKey[_MAX_ROUNDS+1][4][4];
32 void init(Direction dir,const byte *key,byte *initVector);
33 int blockEncrypt(const byte *input, int inputLen, byte *outBuffer);
34 int blockDecrypt(const byte *input, int inputLen, byte *outBuffer);
37 #endif // _RIJNDAEL_H_