AES is one of the most famous cipher block in the world. In real life software, you won't find AES code calling a SubBytes function, then a ShiftRows() function, and then a MixColumns() function because that would be inefficient. Instead, fast AES software uses special techniques called table-based implementations and native instructions.
Here we focused on native instructions (NI) which use dedicated assembly instructions within you processor to compute directly AES operations.
This is a listing of every instructions:
Instruction | Description |
---|---|
aesenc | Perform one round of an AES encryption flow |
aesenclast | Perform the last round of an AES encryption flow |
aesdec | Perform one round of an AES decryption flow |
aesdeclast | Perform the last round of an AES decryption flow |
aeskeygenassist | Assist in AES round key generation |
aesimc | Assist in AES decryption round key generation. Applies Inverse Mix Columns to round keys. |
Find all the supported architectures here: link
How to compile a program using AES-NI:
gcc aes-ni.c -o ./aes -maes
-
Interesting White paper with code samples in C and assembly. Benchmark at the end. Intel® Advanced Encryption Standard (AES) New Instructions Set by Shay Gueron
-
Tutorial for assembly -> Assembly tutorial - AsmTutor