AES with vector permutations

Mike Hamburg, Stanford University, 2009, public domain.

This software is a public-domain implementation following my paper on implementing AES using vector permute instructions. Doing so has several advantages:

This code is an implementation in x86-64 GNU C and assembly language. It can be ported to other architectures, but I haven't gotten to this yet and might not for a while. Here are performance numbers on 3 machines I tested:

Performance in cycles/byte
CPU familymode 128-bit 192-bit 256-bit

As you can see, this code is quite fast on recent machines: much faster than OpenSSL, and comparable to Crypto++. The exception here is Conroe, which has a very slow shuffler. vpaes doesn't (yet) implement CTR-mode caching, so CTR mode is not any faster than CBC mode. Furthermore, encryption is faster than decryption due to the more complex MixColumns matrix for decryption.

There are still several "to do" items in vpaes:

I'd also like to try these tricks with Camellia and Fugue, which use the AES core.

Download: vpaes (312 KB).

Note that this is a preliminary release, is only minimally tested, comes with no warranty, etc. Please send questions or comments to Mike Hamburg.