Support Intel's AES Native Instructions where available on x86 hardware.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 25 May 2015 09:34:14 +0000 (10:34 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 20 Jul 2015 12:54:22 +0000 (13:54 +0100)
commit226639f3441312d535bccf45b1c0d15d0ae156a1
treebcf023eda113a7c24d5a790f09e5a0a4e038cecc
parente10e6494b18a62339497db09d9712cd5df555714
Support Intel's AES Native Instructions where available on x86 hardware.

  * Add a detector for the CPU feature.

  * Implement AES in terms of the Intel AESNI instructions.

We can't use the fancy instructions to implement Rijndael with large
blocks, unfortunately; we /can/ (and do) use the rather cumbersome
key-scheduling instructions.

There's a slightly annoying endianness difference between Catacomb
(big-endian) and AESNI (little-endian).  Resolve this by (a) maintaining
the key schedule in little-endian order if we're using AESNI (and blocks
are exactly 128 bits); and (b) end-swapping the block on entry and exit
to the block cipher operations.
base/dispatch.c
base/dispatch.h
symm/Makefile.am
symm/rijndael-base.c
symm/rijndael-x86-aesni.s [new file with mode: 0644]
symm/rijndael.c