A comprehensive benchmark suite for comparing different AES-256-CTR implementations including pure software, AES-NI hardware acceleration, OpenSSL EVP, and Linux kernel AF_ALG.
This benchmark suite includes 7 different AES-256-CTR implementations:
- soft - Pure software implementation (portable)
- aesni - AES-NI hardware acceleration (x86 processors)
- aesni-native - Native AES-NI intrinsics (optimized)
- aesni-atom - Atom/Silvermont optimized (2-way parallelism)
- evp - OpenSSL EVP interface (auto-detection)
- evp-soft - OpenSSL EVP software-only mode
- afalg - Linux kernel crypto API (AF_ALG)
- Python Analysis Suite:
- Automated benchmarking across multiple data sizes
- Statistical analysis and visualization
- Box plots, performance comparisons, heatmaps
- Export to PDF and PNG formats
make# Quick performance comparison
make benchmark
# Test all modes
make test
# Run single mode
./aes --mode evp --size 1048576 --iters 10# Install Python virtual environment and dependencies
make deps
# Quick analysis (3 sizes, faster)
make quick-analysis
# Comprehensive analysis (8 sizes, more thorough)
make analysis./aes --mode {soft|aesni|aesni-native|evp|evp-soft|afalg} [options]
Options:
--mode MODE Implementation to benchmark
--size BYTES Data size in bytes (default: 1048576)
--iters N Number of iterations (default: 10)
--debug N Debug verbosity level (default: 0)
--help Show help message
make all # Build the benchmark (default)
make test # Run tests with different modes
make benchmark # Quick performance comparison
make deps # Install Python dependencies
make quick-analysis # Quick analysis (3 sizes)
make analysis # Comprehensive analysis (8 sizes)
make clean # Remove build artifacts
make help # Show all available targets
The Python analysis suite generates:
- Throughput Box Plots - Performance distribution across data sizes
- Cycles per Byte Plots - Efficiency comparison
- Performance vs Size Charts - Scaling behavior analysis
- Performance Heatmaps - Relative performance ratios
- Summary Statistics - Detailed statistical analysis
benchmark_plots/- Generated visualizations (PNG/PDF)benchmark_results.json- Raw benchmark datasummary_statistics.csv- Statistical summary
Typical performance on modern x86_64 hardware:
| Mode | Throughput (MB/s) | Cycles/Byte | Description |
|---|---|---|---|
| evp-soft | ~4,525 | ~0.64 | OpenSSL software |
| evp | ~3,978 | ~0.73 | OpenSSL optimized |
| aesni-atom | ~3,537 | ~0.82 | Atom/Silvermont opt |
| afalg | ~1,886 | ~1.54 | Linux kernel |
| aesni-native | ~953 | ~3.04 | Native AES-NI |
| aesni | ~848 | ~3.42 | Direct AES-NI |
| soft | ~78 | ~37.2 | Pure software |
- GCC with C99 support
- OpenSSL development libraries (
libssl-dev) - Linux kernel with AF_ALG support
- Python 3.7+
- matplotlib
- seaborn
- pandas
- numpy
# Install build dependencies
sudo apt update
sudo apt install build-essential libssl-dev python3-full python3-venv
# Clone and build
git clone <repository>
cd AES
make deps # Sets up Python environment
make # Builds the benchmarkFeel free to submit issues, feature requests, or pull requests. Areas for improvement:
- Additional cipher modes (GCM, CBC, etc.)
- ARM NEON optimizations
- Windows CryptoAPI support
- GPU acceleration benchmarks
This project is released under the MIT License. See LICENSE file for details.
Created by Eduardo Correia ecorreia@apliant.com.br