Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: AES_example shaun_larada Smartage
Fork of Crypto by
AES.h
00001 #ifndef AES_H 00002 #define AES_H 00003 00004 #include "BlockCipher.h" 00005 00006 enum AES_TYPE 00007 { 00008 AES_128 = 4, 00009 AES_192 = 6, 00010 AES_256 = 8 00011 }; 00012 00013 class AES : public BlockCipher 00014 { 00015 public : 00016 00017 AES(const AES_TYPE type, uint8_t *key); 00018 AES(const AES_TYPE type, uint8_t *key, uint8_t *iv, BLOCK_CIPHER_MODE m=CBC_MODE); 00019 void keyExpansion(uint8_t *key); 00020 00021 private : 00022 00023 virtual void encryptBlock(uint8_t *out, uint8_t *in); 00024 virtual void decryptBlock(uint8_t *out, uint8_t *in); 00025 00026 uint32_t rotWord(uint32_t w); 00027 uint32_t invRotWord(uint32_t w); 00028 uint32_t subWord(uint32_t w); 00029 void subBytes(); 00030 void invSubBytes(); 00031 void shiftRows(); 00032 void invShiftRows(); 00033 void mul(uint8_t *r); 00034 void invMul(uint8_t *r); 00035 void mixColumns(); 00036 void invMixColumns(); 00037 void addRoundKey(int round); 00038 00039 uint8_t state[16]; 00040 uint32_t w[60]; 00041 uint8_t nr,nk; 00042 }; 00043 00044 #endif
Generated on Mon Jul 18 2022 02:59:39 by
1.7.2
