Intel AES New Instructions (AESNI) libraries for C on Ubuntu

First, you need to check if your CPU is compatible with hardware accelerated Intel technology for cipher/decrypt with AES.

Next, we need to download the Intel AESNI library and compile it:

cd Intel_AESNI_Sample_Library_v1.2

Maybe, you will get the following errror:

collect2: error: ld returned 1 exit status
Got error on link

If you get it, please install yasm
sudo apt-get install yasm

Now, compile it again:
~/Downloads/Intel_AESNI_Sample_Library_v1.2/aes_example ~/Downloads/Intel_AESNI_Sample_Library_v1.2/aes_example
~/Downloads/Intel_AESNI_Sample_Library_v1.2/intel_aes_lib ~/Downloads/Intel_AESNI_Sample_Library_v1.2/intel_aes_lib
do iaesx64.s
do do_rdtsc.s
mkdir: cannot create directory ‘bin’: File exists
src/aes_example.c: In function ‘main’:
src/aes_example.c:2327:10: warning: too many arguments for format [-Wformat-extra-args]
   printf("input_file (will be overwritten)= %s encoded_file= %s, decoded_file= %s\n",
created bin/aes_example64

Now, you can run bin/aes_example64 
Enjoy it!

If you want more examples remember that AESNI use the following libraries:
#include "iaesni.h"
#include "iaes_asm_interface.h"


Popular posts from this blog

How to fix Android when developer options are not available for this user

from: can't read /var/mail/ in Python scripts

How to fix VirtualBox error when you try to import an ova file