Hi here you go: The header file, aes.h:
#ifndef AES_H
#define AES_H
#include #include using namespace std;
class aes
{
public:
aes(vector& , vector&, unsigned int);
~aes();
vector encrypt();
vector dencrypt();
private:
bool debugg = false;
vector str_key;
vector > KEY;
vector > KEY_SCHEDULE;
vector str_io;
vector > INPUT, OUTPUT;
unsigned int KEY_LENGHT;
unsigned int ROUNDS;
unsigned int GROUP_SIZE;
unsigned int BLOCK_SIZE = 16;
//variabile
static const unsigned char sbox\[256\];
static const unsigned char isbox\[256\];
static const unsigned char srcon\[256\];
static const unsigned char by\_2\[256\];
static const unsigned char by\_3\[256\];
static const unsigned char by\_9\[256\];
static const unsigned char by\_11\[256\];
static const unsigned char by\_13\[256\];
static const unsigned char by\_14\[256\];
//functii
void getKeyFromString(vector&);
void gen\_key\_schedule(vector >&);
vector x\_xor(vector, vector);
vector g(vector&, unsigned int);
void subytes(vector >&);
void isubytes(vector >&);
vector subytesWord(vector&);
void debug(vector >&);
void dgetInputFromString(vector&);
vector > beginEcryptForBlock(vector >&);//beginDEcryptForBlock
vector > beginDEcryptForBlock(vector >&);
void addRound(vector >&, vector >&);
void getWFrmKeySched(unsigned int, vector >&);
void shiftRows(vector >&, vector&, vector&, vector&);
void ishiftRows(vector >&, vector& , vector& , vector& );
void mixCol(vector >&);
void imixCol(vector >&);
unsigned int getNextByte(unsigned int, unsigned int);
void populateVector4x4(vector >&);
};
#endif // AES_H
The cpp file , aes.cpp:
#include "aes.h"
#include
#include
#include
us