This library implements some hash and cryptographic algorithms.
Dependents: ES_CW2_Starter_JIN EMBEDDED_CW2 EMBEDDED_CW2_Final Spinnybois ... more
Fork of Crypto by
AES.h
- Committer:
- feb11
- Date:
- 2013-09-07
- Revision:
- 0:7a1237bd2d13
File content as of revision 0:7a1237bd2d13:
#ifndef AES_H #define AES_H #include "Cipher.h" enum AES_TYPE { AES_128 = 4, AES_192 = 6, AES_256 = 8 }; class AES : public Cipher { 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; private : void encryptBlock(uint8_t *out, uint8_t *in); void decryptBlock(uint8_t *out, uint8_t *in); void keyExpansion(uint8_t *key); uint32_t rotWord(uint32_t w); uint32_t invRotWord(uint32_t w); uint32_t subWord(uint32_t w); void subBytes(); void invSubBytes(); void shiftRows(); void invShiftRows(); void mul(uint8_t *r); void invMul(uint8_t *r); void mixColumns(); void invMixColumns(); void addRoundKey(int round); uint8_t state[16]; uint32_t w[60]; uint8_t nr,nk; }; #endif