10 // Byte and Byte Array types
11 typedef unsigned char byte;
12 typedef std::vector<byte> byteArray;
14 // Word and Word Array types
15 typedef unsigned int word;
16 typedef std::vector<word> wordArray;
19 class incorrectKeySizeException { };
20 class incorrectTextSizeException { };
21 class badStateArrayException { };
26 AES (const byteArray& key);
28 byteArray encrypt (const byteArray& plaintext) const;
29 byteArray decrypt (const byteArray& ciphertext) const;
36 wordArray keySchedule;
38 void KeyExpansion (const byteArray& key, wordArray& w) const;
39 word SubWord (const word& input) const;
40 word RotWord (const word& input) const;
41 wordArray GetRoundKey (const int round) const;
43 void SubBytes (byteArray& state) const;
44 void ShiftRows (byteArray& state) const;
45 void MixColumns (byteArray& state) const;
46 void AddRoundKey (byteArray& state, const wordArray& w) const;
48 void InvSubBytes (byteArray& state) const;
49 void InvShiftRows (byteArray& state) const;
50 void InvMixColumns (byteArray& state) const;
56 /* vim: set ts=4 sts=4 sw=4 noet tw=112: */