Compare commits
5 commits
eada851807
...
cd4ed3b423
Author | SHA1 | Date | |
---|---|---|---|
cd4ed3b423 | |||
d2aa7ae5bc | |||
d989f4f0e3 | |||
183ec2907e | |||
7946648558 |
7 changed files with 42 additions and 5 deletions
|
@ -11,13 +11,17 @@
|
||||||
"name": "AES",
|
"name": "AES",
|
||||||
"path": "./aes"
|
"path": "./aes"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "AES Performance",
|
||||||
|
"path": "./aes-performance"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "AES 32-bit",
|
"name": "AES 32-bit",
|
||||||
"path": "./aes-32bit"
|
"path": "./aes-performance/aes-32bit"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "AES TBoxes",
|
"name": "AES TBoxes",
|
||||||
"path": "./aes-tboxes"
|
"path": "./aes-performance/aes-tboxes"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "TRNG Attack",
|
"name": "TRNG Attack",
|
||||||
|
|
8
aes-performance/README.md
Normal file
8
aes-performance/README.md
Normal 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` |
|
|
@ -1,4 +1,4 @@
|
||||||
CPPFLAGS = -g -Ofast
|
CPPFLAGS ?= -Ofast
|
||||||
|
|
||||||
BUILD_DIR = bin
|
BUILD_DIR = bin
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
CPPFLAGS = -g -Ofast
|
CPPFLAGS = -Ofast
|
||||||
|
|
||||||
BUILD_DIR = bin
|
BUILD_DIR = bin
|
||||||
|
|
|
@ -214,6 +214,5 @@ int main(int argc, char* argv[])
|
||||||
|
|
||||||
std::cout << "AES (" << cycles << " runs)\nElapsed time: ";
|
std::cout << "AES (" << cycles << " runs)\nElapsed time: ";
|
||||||
std::cout << milliseconds << "ms\n"; // Before C++20
|
std::cout << milliseconds << "ms\n"; // Before C++20
|
||||||
std::cout << "Last result: " << in << "\n";
|
|
||||||
exit(in[0]);
|
exit(in[0]);
|
||||||
}
|
}
|
26
aes-performance/measure.sh
Executable file
26
aes-performance/measure.sh
Executable 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;
|
Loading…
Reference in a new issue