How to check aes-ni are supported by the processor?
I am looking for a solution how to test aes-ni on CPU. I need to put this information into my application, so I'm not looking for any CPU-Z, bash or whatever commands. I know it displays as aes . I have no idea how to check this in assembly or c. The main application is written in C #, but that doesn't matter.
+3
source to share
2 answers
This information is returned by the command cpuid
. Go to eax=1
, and bit # 25 in will ecx
display support. See the intel instruction manual for more details. Sample code:
mov eax, 1
cpuid
test ecx, 1<<25
jz no_aesni
Alternatively, you can just try executing it and catch the exception.
+4
source to share