-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
29 lines (24 loc) · 715 Bytes
/
main.cpp
File metadata and controls
29 lines (24 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
#include <iomanip>
#include "sbox.h"
template <typename T, size_t width>
void print_array(const T& array) {
std::cout << std::hex;
for( size_t i = 0; i < sizeof(array)/sizeof(decltype(array.back())); ++i ) {
std::cout << std::setw(2) << std::setfill('0') << (int)array[i];
if( (width-1) == (i % width) ) {
std::cout << std::endl;
} else {
std::cout << ' ';
}
}
}
int main(int argc, char** argv) {
print_array<SBOX, 16>(forward_sbox);
std::cout << std::endl;
print_array<SBOX, 16>(reverse_sbox);
std::cout << std::endl;
print_array<ROUND_CONSTANTS, 16>(rc);
std::cout << std::endl;
return 0;
}