TL;DR
Intel’s "Ice Lake" architecture introduces new vectorized instructions (VAES* and VPCLMULQDQ) that expand AES operations to 256-bit and 512-bit registers. This paper demonstrates how these instructions can achieve a 3–4x performance boost, potentially pushing AES throughput to a staggering 0.16 cycles per byte.
What Problem Does This Paper Address?
Advanced Encryption Standard (AES) is the backbone of modern digital security, used in everything from HTTPS traffic to disk encryption. While Intel’s original AES-NI instructions (introduced around 2010) revolutionized performance by moving encryption into hardware, they were limited to 128-bit registers.
As global data traffic grows exponentially, the overhead of encryption remains a bottleneck for high-performance systems. The challenge is twofold:
- Scaling: How do we move from 128-bit to 512-bit (AVX-512) processing for AES?
- Mode Constraints: Some encryption modes (like AES-CTR) are "naturally parallel" and easy to speed up, while others (like AES-CBC) are serial by nature, making them difficult to vectorize.
The authors tackle how to effectively implement both parallel and serial modes using Intel’s then-forthcoming "Ice Lake" instruction set.
Methods
The authors focus on two primary new instruction sets:
- VAES* (Vectorized AES): These allow one round of AES encryption/decryption to be performed on multiple 128-bit blocks simultaneously within a single 256-bit (YMM) or 512-bit (ZMM) register.
- VPCLMULQDQ: A vectorized version of carry-less multiplication, which is essential for the "universal hashing" used in Authenticated Encryption (AEAD) schemes like AES-GCM.
Key Technical Approaches:
* Parallel Modes (CTR): For modes like AES-CTR, the implementation is straightforward: replace 128-bit registers with 512-bit ones and process four blocks at once.
* Serial Modes (CBC): To vectorize serial encryption, the authors propose "transposing" the data. By taking four independent data streams and interleaving them into the wide registers using the VPERMI2Q instruction, they can process four separate messages in parallel.
* Aggregated Reduction: For hashing (GHASH/POLYVAL), they use a "deferred reduction" strategy. They perform multiple multiplications in parallel and accumulate the results before performing a single, final modular reduction, significantly reducing the instruction count.
Datasets
The paper does not use traditional "datasets" in the machine learning sense. Instead, it evaluates the algorithms using synthetic data buffers of various sizes:
- Buffer Sizes: Ranging from 512 bytes to 16,384 bytes.
- Algorithms Tested: AES-CTR, AES-CBC, and POLYVAL (the hash function for AES-GCM-SIV).
Key Insights and Ideas
- The "Aha" Moment for Serial Modes: The realization that while a single CBC stream cannot be parallelized, multiple CBC streams can be interleaved into a single 512-bit register to utilize the hardware fully.
- Pipelining Depth: The AVX-512 architecture provides 32 ZMM registers (up from 16 XMM registers). This allows developers to "hide" the latency of instructions by pipelining up to 10 packets of 4 blocks in parallel, ensuring the processor's execution ports are never idle.
- Instruction Count as a Metric: Because the "Ice Lake" hardware was not yet commercially available at the time of writing, the authors used the Intel Software Developer Emulator (SDE) to count instructions. They argue that a significant reduction in instruction count is a reliable proxy for real-world speedups.
Key Results
The study found a consistent 3x to 4x improvement in instruction efficiency when moving from legacy AES-NI to the new vectorized instructions.
| Algorithm | Buffer Size (Bytes) | Instruction Count Ratio (Legacy vs. Vectorized) |
|---|---|---|
| AES-CTR | 8,192 | 3.96x |
| AES-CTRx8 | 8,192 | 3.94x |
| POLYVALx8 | 16,384 | 3.87x |
The authors predict that these optimizations will allow software to approach the theoretical hardware limit of 0.16 cycles per byte (C/B), a massive leap from the ~0.64 C/B seen on the previous generation of processors.
Limitations and Future Work
- Emulation vs. Silicon: The primary limitation is that the results are based on instruction counts from an emulator. Real-world performance can be affected by microarchitectural bottlenecks, such as port contention or memory alignment issues, which an emulator might not fully capture.
- Code Complexity: Vectorizing serial modes requires complex data shuffling (transposition). While this is efficient for large batches of data, the overhead might make it less beneficial for very small packets.
- Future Directions: The authors suggest that these techniques could be extended to other cryptographic primitives and emerging "nonce-misuse resistant" schemes like AES-GCM-SIV.
Summary updated