Community
cancel
Showing results for 
Search instead for 
Did you mean: 
tnjyothi24
Beginner
204 Views

OpenSSL performance better than IPP!!??

Hi,

I have a file transfer application (on Linux 32 bit machine) where data transfered is encrypted/decrypted using AES 128. I have used OpenSSL libraries before.
Now I have used IPP cryptography libraries instead of OpenSSL and found that OpenSSL performance better than IPP.

Is this the expectedbehavior?

Because I have read that Intel IPP libraries are supposed to increase the performance, I am confused with the performance behavior I got.

Please let me know if anyone has observed similar behavior.

Regards,
Jyothi

0 Kudos
9 Replies
Chao_Y_Intel
Employee
204 Views



Hi Jyothi,

which OpenSSL version you are using, and what is the benchmark tool?

Thanks,
Chao
tnjyothi24
Beginner
204 Views

Hi Chao,

I am using openSSL version 0.9.8k.

I am printing date before running the application and date after the application is exited.

In openSSL scenario 1.4G file took approximatley 2mins 56 secs and IPP took around 9Mins in case of CFB mode in both cases. In case of CBC mode openSSL and IPP took approximately 2mins 30secs and 3mins 50secs respectively. I have used IPP libraries both for random generation and AES encryption/decryption.While file transfer I have transfered file in chunks which is 2kB.

When browsed on internet, I have found couple of links where IPP is used in boosting performance of OpenSSL but could not find any performance comparision in case of replacing OpenSSL with IPP.

Please let me know if anyone has this information.

Regards,
Jyothi

Chao_Y_Intel
Employee
204 Views

Hi Jyothi,

I just tested with the IPP OpenSSL sample code with IPP 6.1 update 3 sample. IPP patched OpenSSL is better than the original code. See attached for the performance result.

How are you linking with Intel IPP? If you are dynamically linking with IPP, please note some function are internally threaded. I set the following environment to avoid the threading problem ( or I can see some performance issue in the Hypterthreading system in my test).

> export KMP_AFFINITY=granularity=fine,compact,1,0
> export OMP_NUM_THREADS=1


Regards,
Chao

Chen_Chen
Beginner
204 Views

hi,Chao~
I have the same problem when calling the decrypt functionippsRijndael256DecryptCFB in ipp in my project , I have no idea whether it have something to do with the thread. It bores me very long time.
Hope for help~
Chao_Y_Intel
Employee
204 Views

Hi Chen Chen,

Have you noticed these two articles on AES benchmark?

http://software.intel.com/en-us/articles/boosting-openssl-aes-encryption-with-intel-ipp/

http://software.intel.com/en-us/articles/performance-of-crypto-sample-for-openssl-slowing-down-on-hy...

The first one includes some benchmark steps, and the second is one common issue.

Thanks,

Chao

Alen_Stojanov
Beginner
204 Views

Hi,

It seems that I am reopening an old question, comparing once again OpenSSL with Intel IPP. I am interested in performance of RSA key pair generation comparing Intel IPP and OpenSSL. My tests show once again that OpenSSL version outperforms Intel IPP Crypto libraries. My testing methodology is defined as follows:

    int runs = 10;
    int repetitions = 10;
    myInt64 values[repetitions];

    measurement_init();
    for (int i = 0; i < repetitions; ++i) {
        measurement_start();
        for (int j = 0; j < runs; ++j) {
            status = ippsRSA_GenerateKeys(
                    pSrcPublicExp,
                    pModulus, pPublicExp, pPrivateExp,
                    privateKey, scratchBuffer, nTrials,
                    primeGen, ippsPRNGen, randomGen
            );
        }
        measurement_stop();
        meas_values = meas_values / runs;
    }
    measurement_finish(values);
    qsort(values, meas_i, sizeof(myInt64), cmpMyInt64);
    printf("%4d : %llu\n", bitsRSA, values[repetitions / 2]);

 

  • Compile the code using icpc composer_xe_2015.0.077 on OS X Yosemite 10.10.5, running Intel(R) Core(TM) i7-3720Q CPU @ 2.60 GHz (Ivy Bridge). OpenSSL version is 1.0.2d (9 Jul 2015).
  • Compile the code using icpc composer_xe_2015.0.090 on Debian 8.3, running Intel(R) Xeon(R) CPU E3-1285L v3 @ 3.10GHz. OpenSSL version is 1.1.0-pre4 (beta) 16 Mar 2016
  • Compile the code using -O3 -xHost -no-multibyte-chars, and conisder single core implementation only.
  • Use RDTSC as a timing infrastructure
  • Run each of the RSA generation functions 10 times, and average the runtimes.
  • Repeat each 10 runs for 10 times, and take the median runtime as the final measure.

Obtained results are available bellow:

Intel(R) Xeon(R) CPU E3-1285L v3 @ 3.10GHz (Haswell)

Intel(R) Core(TM) i7-3720Q CPU @ 2.60 GHz (Ivy Bridge)

More information detailing this short experiment is available here, and the timing code is available here.

How different is the Intel IPP version of RSA key generation algorithm (ippsRSA_GenerateKeys) compared to OpenSSL (RSA_generate_key)? Can we expect improvements in the newer versions of Intel IPP Cryptography libraries ?

Chao_Y_Intel
Employee
204 Views

Allen, 

Thanks for sharing the result.   Here is feedback from the engineer expert:

Actually, RSA key generation was not considered as the processing function and it is not considered as the major functions that need to be optimized. 

The main computation functions for the RSA is the RSA_Decrypt and RSA_Encrypt.   Did you test them as well?

thanks,
Chao

Alen_Stojanov
Beginner
204 Views

Chao,

My focus was the RSA key generation only, and I did not look into RSA_Encrypt / RSA_Decrypt functions. I acknowledge the fact that ippsRSA_GenerateKeys is not a processing function, however I had the impression that Intel IPP aims at optimizing all functions that are part of IPP.

Thanks for the explanation,
Alen

204 Views

Hi,

I'm exploring ways to integrate Intel Ipp cryptography optimizations in the Android BoringSSL Framework. (BoringSSL is a fork of OpenSSL).

I was looking for reference/results and found these two articles in this post. But both of these redirect to ipp crypto reference. (https://software.intel.com/en-us/ipp-crypto-reference-2019).  If anyone has the below articles, can you please send it to me or post it here ?

http://software.intel.com/en-us/articles/boosting-openssl-aes-encryption.

http://software.intel.com/en-us/articles/performance-of-crypto-sample-fo.

Thanks in Advance.