Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.
1094 Discussions

Compiling with AES-NI in MS Visual Studio 2008/2010

e_wang
Beginner
1,072 Views
Hi there,

Being new to compiling with specific CPU-instruction set enabled, how would I compile a general C/C++ application in Visual Studio 2008 SP1 / 2010 (I assume also supports AES-NI?) with AES-NI enabled? Are there specific compiler flags to enable?
0 Kudos
1 Reply
Juan_R_Intel1
Employee
1,072 Views

AES-NI support in Microsoft Visual Studio 2008 SP1/2010is enabled via these means:
- Intrinsics : Availablein 32 and 64 bit target compilers (include wmmintrin.h or intrin.h)
- Inline Assembly: Available in 32 bit target compilers
- MASM: Available for 32 and 64 bits (ML, ML64)

There are no new compiler flags needed to enable AES-NI support. VC++ 2008 SP1/VC++ 2010do not automatically generate these instructions.

You will want to make sure that you check for AES-NI availability on the target platform before executing any AES-NI code by using CPUID facilities because not all Intel processors support AES-NI.

Another way to use AES-NI is via use of libraries which enable it, such as Intel Performance Primitives (IPP).

Here is a good reference article to dig further:

http://software.intel.com/en-us/articles/intel-advanced-encryption-standard-aes-instructions-set/

0 Kudos
Reply