Quantcast
Channel: Intel® Software - Intel® Integrated Performance Primitives
Viewing all articles
Browse latest Browse all 1489

Cryptography unresolved external symbol

$
0
0

I installed Trial Composer 15 Desktop and IPP and Cryptography lib 8.2. I have found below code. I run the code, there is no compilation error but there are  four link error like unresolved external symbol.  I searched some issues. Issues say that you must add lib called ippid.lib, libemerged ext. but there is no these libraries. How can I solve this problem.

1>IntelRijndael.obj : error LNK2019: unresolved external symbol _ippsRijndael128GetSize@4 referenced in function _main

1>IntelRijndael.obj : error LNK2019: unresolved external symbol _ippsRijndael128Init@12 referenced in function _main

1>IntelRijndael.obj : error LNK2019: unresolved external symbol _ippsRijndael128EncryptCTR@24 referenced in function _main

1>IntelRijndael.obj : error LNK2019: unresolved external symbol _ippsRijndael128DecryptCTR@24 referenced in function _main

1>D:\RijndaelRefactoring\IntelDeneme\Debug\IntelRijndael.exe : fatal error LNK1120: 4 unresolved externals

 

 

Code:

// size of Rijndael-128 algorithm block is equal to 16

   const int aesBlkSize = 16;

 

   // get the size of the context needed for the encryption/decryption operation

   int ctxSize;

   ippsRijndael128GetSize(&ctxSize);

 

   // and allocate one

   IppsRijndael128Spec* pCtx = (IppsRijndael128Spec*)( new Ipp8u [ctxSize] );

   // define the key

   Ipp8u key[16] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,

                    0x08,0x09,0x10,0x11,0x12,0x13,0x14,0x15};

 

   // and prepare the context for Rijndael128 usage

   ippsRijndael128Init(key,IppsRijndaelKey128, pCtx);

 

   // define the message to be encrypted

   Ipp8u ptext[] = {"quick brown fox jupm over lazy dog"};

 

  // define an initial vector

   Ipp8u crt0[aesBlkSize] = {0xff,0xee,0xdd,0xcc,0xbb,0xaa,0x99,0x88,                         

   0x77,0x66,0x55,0x44,0x33,0x22,0x11,0x00};

   Ipp8u  crt[aesBlkSize];

 

   // counter the variable number of bits

   int ctrNumBitSize = 64;

 

 

    // allocate enough memory for the ciphertext

   // note that

   // the size of the ciphertext is always equal to that of the planetext

   Ipp8u ctext[sizeof(ptext)];

 

   // init the counter

   memcpy(crt, crt0, sizeof(crt0));

   // encrypt (CTR mode) ptext message

   // pay attention to the 'length' parameter

   // it defines the number of bytes to be encrypted

   memcpy(crt, crt0, sizeof(crt0));

   ippsRijndael128EncryptCTR(ptext, ctext, sizeof(ptext),

                             pCtx,

                             crt, ctrNumBitSize);

 

   // allocate memory for the decrypted message

   Ipp8u rtext[sizeof(ptext)];

 

   // init the counter

   memcpy(crt, crt0, sizeof(crt0));

 

 

   // decrypt (ECTR mode) ctext message

   // pay attention to the 'length' parameter

   // it defines the number of bytes to be decrypted

   ippsRijndael128DecryptCTR(ctext, rtext, sizeof(ptext),

                             pCtx,

                             crt, ctrNumBitSize);

   delete (Ipp8u*)pCtx;


Viewing all articles
Browse latest Browse all 1489

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>