TAY
Fork of Crypto_light by
Diff: cipher/AES.h
- Revision:
- 8:a090264e9b2d
- Parent:
- 7:2dbbdfb08123
diff -r 2dbbdfb08123 -r a090264e9b2d cipher/AES.h --- a/cipher/AES.h Sat Sep 14 18:21:32 2013 +0000 +++ b/cipher/AES.h Sat Sep 14 20:54:59 2013 +0000 @@ -1,7 +1,7 @@ #ifndef AES_H #define AES_H -#include "Cipher.h" +#include "BlockCipher.h" enum AES_TYPE { @@ -10,20 +10,17 @@ AES_256 = 8 }; -class AES : public Cipher +class AES : public BlockCipher { public : AES(const AES_TYPE type, uint8_t *key); - - virtual void encrypt(uint8_t *out, uint8_t *in, uint32_t length); - virtual void decrypt(uint8_t *out, uint8_t *in, uint32_t length); - virtual uint32_t getBlockSize() const; - + AES(const AES_TYPE type, uint8_t *key, uint8_t *iv); + private : - void encryptBlock(uint8_t *out, uint8_t *in); - void decryptBlock(uint8_t *out, uint8_t *in); + virtual void encryptBlock(uint8_t *out, uint8_t *in); + virtual void decryptBlock(uint8_t *out, uint8_t *in); void keyExpansion(uint8_t *key); uint32_t rotWord(uint32_t w);