Files
open_pit/main.cpp
2019-05-15 09:26:42 +02:00

35 lines
902 B
C++

#include "aes.hpp"
#include <iostream>
#include <chrono>
#include <fstream>
#include <thread>
#include <cstring>
#include "profiler.hpp"
using namespace std;
using namespace std::chrono;
int main(int argc, char **argv) {
//uint8_t data[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
uint8_t data[16] = {0xA0,0x7C,0x3D,0x99,0xFA,0x00,0x02,0x46,0x97,0x33,0x73,0x50,0x31,0x7C,0xD3,0xDC};
//const uint8_t key[16] = {0xA0,0x7C,0x3D,0x99,0xFA,0x00,0x02,0x46,0x97,0x33,0x73,0x50,0x31,0x7C,0xD3,0xDC};
uint8_t key[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
ifstream input("/dev/urandom", ios::binary);
for (int i = 0;i < 100000;i++)
{
input.read((char*) key, 16);
AES::encrypt_ecb(data, key);
for (int d = 0;d < 16;d++)
{
cout << dec << (int) key[d] << ",";
}
profiler.clear();
AES::decrypt_ecb(data, key);
cout << profiler.calls["gf_reduce"] << endl;
profiler.clear();
}
return 0;
}