This project has moved and is read-only. For the latest updates, please go here.

Hardware accelerated AES on AMD CPU

Topics: Technical Issues
Oct 11, 2015 at 10:18 PM
Edited Oct 12, 2015 at 2:56 AM
Hi,

Probably this is known but, I found out that on a server with an ADM CPU (Opteron 6128), the AES does not seem to use any hardware acceleration features. I can see that because when I did encrypt a volume on such a computer, I run a test and the speed for AES was comparable with the others.

Is there a way to speed up AES on AMD?

Later: I think I answered my question! Operon 6128 does NOT support the AES instruction set.

Thanks,
G.
Oct 12, 2015 at 4:07 PM
Edited Oct 12, 2015 at 10:20 PM
Coming back to this subject...

In the source code you have this:
    case AES:   
        // In 32-bit kernel mode, due to KeSaveFloatingPointState() overhead, AES instructions can be used only when processing the whole data unit.
#if (defined (_WIN64) || !defined (TC_WINDOWS_DRIVER)) && !defined (TC_WINDOWS_BOOT)
        if (IsAesHwCpuSupported())
            aes_hw_cpu_encrypt (ks, data);
        else
#endif
            aes_encrypt (data, data, ks);
        break;
Essentially this code (in same cases) check to see if the hardware supports the AES instructions, if so runs the aes_hw_cpu_encrypt else fails back on 'aes_encrypt'.

Ok so in the solution beside the hardware aes support (Aes_hw_cpu_asm), there is also a C version but also there are assembler code versions for 64 & 86.
My question is, are the x64 or 86 version EVER USED? If they are, maybe the code can get a boost even on CPUs without AES instruction set.

Thanks,

G.