Initial commit
This commit is contained in:
30
main.cpp
Normal file
30
main.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#include "aes.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <chrono>
|
||||
#include <fstream>
|
||||
#include <thread>
|
||||
#include <cstring>
|
||||
|
||||
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};
|
||||
const uint8_t key[16] = {0xA0,0x7C,0x3D,0x99,0xFA,0x00,0x02,0x46,0x97,0x33,0x73,0x50,0x31,0x7C,0xD3,0xDC};
|
||||
ifstream input("/dev/urandom", ios::binary);
|
||||
for (int i = 0;i < 50000;i++)
|
||||
{
|
||||
input.read((char*) data, 16);
|
||||
this_thread::sleep_for(nanoseconds(0));
|
||||
for (int d = 0;d < 16;d++)
|
||||
{
|
||||
cout << dec << (int) data[d] << ",";
|
||||
}
|
||||
auto start = high_resolution_clock::now();
|
||||
AES::encrypt_ecb(data, key);
|
||||
auto stop = high_resolution_clock::now();
|
||||
cout << (stop - start).count() << endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user