Compare commits

...

5 commits

7 changed files with 42 additions and 5 deletions

View file

@ -11,13 +11,17 @@
"name": "AES",
"path": "./aes"
},
{
"name": "AES Performance",
"path": "./aes-performance"
},
{
"name": "AES 32-bit",
"path": "./aes-32bit"
"path": "./aes-performance/aes-32bit"
},
{
"name": "AES TBoxes",
"path": "./aes-tboxes"
"path": "./aes-performance/aes-tboxes"
},
{
"name": "TRNG Attack",

View file

@ -0,0 +1,8 @@
# Performant AES Implementation
| Variant | Time for 1 mio. Iterations | Time for 10 mio. Iterations | Processor | OS | Compiler | Compiler Switches |
| ------------ | -------------------------- | --------------------------- | -------------- | ----------------- | -------- | ----------------- |
| `aes-32bit` | 3163ms | 4632ms | Intel i7-8650U | Arch Linux x86_64 | `gcc` | `-g` |
| `aes-32bit` | 482ms | 5152ms | Intel i7-8650U | Arch Linux x86_64 | `gcc` | `-Ofast` |
| `aes-tboxes` | 203ms | 1708ms | Intel i7-8650U | Arch Linux x86_64 | `gcc` | `-g` |
| `aes-tboxes` | 148ms | 1600ms | Intel i7-8650U | Arch Linux x86_64 | `gcc` | `-Ofast` |

View file

@ -1,4 +1,4 @@
CPPFLAGS = -g -Ofast
CPPFLAGS ?= -Ofast
BUILD_DIR = bin

View file

@ -1,4 +1,4 @@
CPPFLAGS = -g -Ofast
CPPFLAGS = -Ofast
BUILD_DIR = bin

View file

@ -214,6 +214,5 @@ int main(int argc, char* argv[])
std::cout << "AES (" << cycles << " runs)\nElapsed time: ";
std::cout << milliseconds << "ms\n"; // Before C++20
std::cout << "Last result: " << in << "\n";
exit(in[0]);
}

26
aes-performance/measure.sh Executable file
View file

@ -0,0 +1,26 @@
#!/bin/bash
dir="${BASH_SOURCE%/*}";
for program in "aes-32bit" "aes-tboxes"
do
for flags in "-g" ""
do
if [ -z "$flags" ]
then
mode="performance";
else
mode="debug";
export CPPFLAGS="$flags";
fi;
for iterations in "1000000" "10000000"
do
echo "$program ($iterations iterations, $mode mode)";
root="$dir/$program";
make -C "$root" clean > /dev/null 2>&1;
make -C "$root" > /dev/null 2>&1;
"$dir/$program/bin/aes" "$iterations";
unset CPPFLAGS;
done;
done;
done;