Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Chen_Chen
Beginner
249 Views

How to compile the program calling the cryptography libraries in amd 64bits machine...

hi,everybody,

I have finished a program calling the cryptography library in AMD64 bits machine.But I come across a trouble that I have no idea how to compile it to see whether it is right or not.It bores me a long time.

If someone knows the answer,can you tell me how to fix it?

Thanks~

0 Kudos
10 Replies
renegr
New Contributor I
249 Views

use a 64bit compiler
Chen_Chen
Beginner
249 Views

Can gcc compile the program?
I run the command "gcc -o TestIpp TestIpp.c -I /opt/intel/ipp/6.1.2.051/em64t/include -L /opt/intel/ipp/6.1.2.051/em64t/sharedlib -lippiem64t -lippsem64t -lippcoreem64t -liomp5 -lm -lpthread"
Then,it returns some errors:

TestIpp.c:(.text+0x1d5): undefined reference to `ippsRijndael256GetSize'

TestIpp.c:(.text+0x1fc): undefined reference to `ippsRijndael256Init'

TestIpp.c:(.text+0x22e): undefined reference to `ippsRijndael256EncryptCFB'

it seems that the program doesn't link to the cryptography library, but I don't konw how to deal with it next
Can someone help me ?
Thank you ~

PaulF_IntelCorp
Employee
249 Views

Hello Chen,

I don't see a reference to the crypto library in your link list. The crypto libraries are a separate download, they are not included with the standard IPP library package. Visit this page in the IPP knowledge base:

Where Do I Download The Intel Ipp Cryptography Libraries

for information on how to download a copy of the crypto library add-on. Note that you must download and install the version of the crypto libraries that matches your IPP library. For example, if you installed IPP as part of the Intel Compiler Pro package then you need to download and install the Intel Compiler Pro Crypto library. The crypto add-on package will only install on top of its matching IPP installation.

Paul
Ying_S_Intel
Employee
249 Views

Addtionally, as you may know that the Intel IPP supports both GCC and Intel Compiler, you can also choose Intel Compiler for Intel 64 platform to build IPP application. As Paul mentioned above, Intel IPP is part of Intel Compiler Pro package.

Finally, I noticed that you are using Intel IPP 6.1 update 2, you may check out the latest 6.1 update 4 and download the libraries from Intel Registration Center and upgrade it with your valid Intel IPP license.

Thanks,
Ying
Chen_Chen
Beginner
249 Views

Thank you, Paul
I am sorry that I didn't mention I hadinstalled crytography library seperately above,but your answer gives me some ideas.

The path I install IPP library is :/opt/intel/ipp/6.1.2.051/em64t
The path I install cryptography library is :/opt/intel/ipp/6.1.2.051/em64t/l_crypto_ipp_em64t_p_6.1.2.051

WhenI compile the command:
gcc -o TestIpp TestIpp.c -I /opt/intel/ipp/6.1.2.051/em64t/include -L /opt/intel/ipp/6.1.2.051/em64t/sharedlib -lippiem64t -lippsem64t -lippcoreem64t -liomp5 -lm -lpthread

Then the errors return:
TestIpp.c:(.text+0x1d5): undefined reference to `ippsRijndael256GetSize'
TestIpp.c:(.text+0x1fc): undefined reference to `ippsRijndael256Init'
TestIpp.c:(.text+0x22e): undefined reference to `ippsRijndael256EncryptCFB'

Is it because the program doesn't link to the cryptography library?
And when I compile the main.c in the page of intel@ipp install guide, it runs correctly.
Thanks for the valuable suggestions~
Chen_Chen
Beginner
249 Views

Thank you,Ying
I add "-lippcpem64t" in the command and then it works.
Then command is as follows:

g++ -o TestIpp TestIpp.c -I /opt/intel/ipp/6.1.2.051/em64t/include -L /opt/intel/ipp/6.1.2.051/em64t/sharedlib -lippiem64t -lippsem64t -lippcoreem64t -lippcpem64t -liomp5 -lm -lpthread

Then it words~It's amazing
But I am surprise to find that the performance of IPP cryptography function is bad.
Is it because that the processor is AMD64bits or the command is wrong?

Call for help~
Thanks
PaulF_IntelCorp
Employee
249 Views

Hello Chen,

Not sure what you mean by "...or the command is wrong?" If you are referring to your the "g++" command line, it appears that everything is okay. Did you get any other compile or link errors?

What are you measuring your performance against?

The performance you get is SIMD architecture dependent; that is, different SSE instruction architectures can give different performance results. For example, the performance on a processor that supports AES-NI is different than the that on a machine that supports SSE4.1 versus SSSE3 versus SSE2, etc. You can compile and run the CPUINFO sample to see which SIMD architecture the library detects your machine to support.

Perhaps you need to use the ippInit() function?

Please review these two articles for more information about the dispatching feature of the library:

Understanding CPU Dispatching in the Intel IPP Library
IPP Dispatcher Control Functions - ipp*Init*() functions

Paul

Chen_Chen
Beginner
249 Views

hello,Paul,
Thanks very much for your detail help !

Now I am testing the performance of Intel@IPP cryptography library against OpenSSL cryptography functions.

I have read the article titled "Boosting Cryptography Performance with Intel_ Libraries - Intel_ Software" and amazed to the performance of Intel@IPP cryptography functions , so I want to have a try.

The machine I am using is the AMD-64bits processor.Buttheresult is notsatisfy me.Even though I add ippInit() function,butthe performancedoesn't improve very much.

Some part of my program is as follows:

ippsRijndael256GetSize(&ctxsize);
IppsRijndael256Spec* pCtx = (IppsRijndael256Spec*)(new Ipp8u [ctxsize]);
ippsRijndael256Init(key,IppsRijndaelKey256,pCtx);
ippsRijndael256EncryptCFB(plaintext,ciphertext,len,32,pCtx,iv,IppsCPPaddingNONE);

It does works, but the performance is worse than OpenSSL functions.
Can you tell me the reasons?
Thank you ~

Chen_Chen
Beginner
249 Views

I have found the reason.

The performance is not very goodhas something to do with the processor, when I run the same program on a machine with Inter xeon processor ,the performance improve.

However,the performanceof Intel@IPP is just a little higher than that of Openssl,about 2% higher in my test.Thetest is to measure the cost time of encrypt. Some of my codes are as follows:


ippInit();
...
...
ippsRijndael256GetSize(&ctxsize);
IppsRijndael256Spec* pCtx = (IppsRijndael256Spec*)(new Ipp8u [ctxsize]);
ippsRijndael256Init(key,IppsRijndaelKey256,pCtx);
ippsRijndael256EncryptCFB(plaintext,ciphertext,len,32,pCtx,iv,IppsCPPaddingNONE);
...
...


I am puzzled with the result.

Wait for someone's help~
Thanks~

ALaza1
Novice
249 Views

working with Update 5, OpenSSL 0.9.8n, em64t: having a number of problems that might be due to the age of the IPP/OpenSSL provided patch. I've gotten as far as a number of unsatisfied externals, but I've had to work around a few problems to get this far. The non-patched version builds OK . I've tested the unpatched library using a Fortran example that links and runs correctly for MD5 sums. w_ipp-samples-cryptography_p_6.1.2.051.zip. I just checked w_ipp-samples-cryptography_p_6.1.5.060.zip and it appears to have the same patch as .051. I worked on SHA256 and it's not one of the unsatisfed externals below. Otherwise there weren't any fatal compile errors. I checked sha256.obj and found entry points for SHA256_Update and SHA256_Final. The corresponding entry points are not present in sha512.obj. rc /fo"tmp32dll\libeay32.res" /d CRYPTO ms\version32.rc Microsoft Windows Resource Compiler Version 6.1.7600.16385 Copyright (C) Microsoft Corporation. All rights reserved. link /nologo /subsystem:console /opt:ref /dll /out:out32dll\libeay32.dll /def:ms/LIBEAY32.def @C:\Users\art\AppData\Local\Temp\nmBF0A.tmp LIBEAY32.def : error LNK2001: unresolved external symbol MD4_Final LIBEAY32.def : error LNK2001: unresolved external symbol MD4_Update LIBEAY32.def : error LNK2001: unresolved external symbol MD5_Final LIBEAY32.def : error LNK2001: unresolved external symbol MD5_Update LIBEAY32.def : error LNK2001: unresolved external symbol RIPEMD160_Final LIBEAY32.def : error LNK2001: unresolved external symbol RIPEMD160_Update LIBEAY32.def : error LNK2001: unresolved external symbol SHA384 LIBEAY32.def : error LNK2001: unresolved external symbol SHA384_Final LIBEAY32.def : error LNK2001: unresolved external symbol SHA384_Update LIBEAY32.def : error LNK2001: unresolved external symbol SHA512 LIBEAY32.def : error LNK2001: unresolved external symbol SHA512_Final LIBEAY32.def : error LNK2001: unresolved external symbol SHA512_Transform LIBEAY32.def : error LNK2001: unresolved external symbol SHA512_Update LIBEAY32.def : error LNK2001: unresolved external symbol SHA_Final LIBEAY32.def : error LNK2001: unresolved external symbol SHA_Update out32dll\libeay32.lib : fatal error LNK1120: 15 unresolved externals TIA, Art
Reply