0

I got sample codes for using AES_NI from Intel website. (https://software.intel.com/en-us/articles/download-the-intel-aesni-sample-library)

However, I dont know how to configure it.

What I want to do is,

  1. First, I have codes using AES from Openssl.
  2. I want to apply AES-NI to my original code.
  3. I checked out my computer support AES-NI. I ran sample code from Intel website using AES-NI and It works.
  4. In my original code, AES function is like this. -> AES_cbc_encrypt(inbuf, outbuf, inlength, key, iv, AES_ENCRYPT);
  5. In Intel sample code for using AES-NI, function is like this. -> intel_AES_enc128_CBC(testVector, testResult, test_key_128, numBlocks, local_test_iv);

I confused I only change the function or change some other things for using AES-NI. Is there any help?

  • OpenSSL, when configured correctly, already supports AES-NI. There is no need to rewrite code. – Maarten Bodewes May 01 '17 at 01:42
  • [How can I check if OpenSSL is support/use the Intel AES-NI?](http://stackoverflow.com/q/25284119/608639), [EVP Interface with AES-NI support](http://stackoverflow.com/q/24516976/608639), etc. – jww May 01 '17 at 03:39
  • You should not use `AES_cbc_encrypt` and friends. That's a software-only implementation, so you will not enjoy hardware support, like AES-NI. You should be using `EVP_*` functions. See [EVP Symmetric Encryption and Decryption](http://wiki.openssl.org/index.php/EVP_Symmetric_Encryption_and_Decryption) on the OpenSSL wiki. In fact, you should probably be using authenticated encryption because it provides *both* confidentiality and authenticity. See [EVP Authenticated Encryption and Decryption](http://wiki.openssl.org/index.php/EVP_Authenticated_Encryption_and_Decryption) on the OpenSSL wiki. – jww May 01 '17 at 03:40
  • Thanks all. Anyway, jww, you mean I have to make codes with EVP function when I want to use AES-NI? – Wonjoon Lee May 01 '17 at 05:50
  • @WonjoonLee - Yes, you need to use EVP interfaces to get AES-NI (or other hardware acceleration, like SHA, CLMUL, ARMv8 Crypto and NEON). – jww May 02 '17 at 13:07

0 Answers0