On Sep 17, 2:33 am, shinde <[email protected]> wrote:
> Hello Everyone,
>
> I am currently having trouble setting up crypto++ on ubuntu.. Make
> works fine, but when i try make install, I get the following error:
>
> # make install
> ==================================================
> ERROR :
> cp *.h /usr/include/cryptopp
> cp *.a /usr/lib
> cp *.so /usr/lib
> cp: cannot stat `*.so': No such file or directory
> make: *** [install] Error 1
> ===================================================
The shared object was not built, so it does not exist (and hence, does
not stat).

> But somehow i'm able to verify the installation using the following
> commands:
>
> > whereis cryptest.exe
> > whereis libcryptopp.a
Again, no shared object (libcryptopp.so).

There are some makefile tweaks available at
http://sourceforge.net/tracker/?func=detail&aid=3409518&group_id=6152&atid=356152
and 
http://sourceforge.net/tracker/?func=detail&aid=3409556&group_id=6152&atid=356152.
The tweaks add the static and dynamic objects to the default rule
(all). They also add a leading hyphen to the CP command so it
continues on library copy failure (if you build the shared object, but
not the archive, make will fail before copying the SO during install).

> After this I assumed that it is installed and went about trying the
> samples for RSA given on the wiki.. Even though I had no problem
> compiling it, I am getting segmentation fault when i try to run it.
>

> ////////////////////////////////////////////////
> // Generate keys
> AutoSeededRandomPool rng;
>
> InvertibleRSAFunction params;
> params.GenerateRandomWithKeySize(rng, 3072);
>
> RSA::PrivateKey privateKey(params);
> RSA::PublicKey publicKey(params);
>
> string plain="RSA Encryption", cipher, recovered;
>
> ////////////////////////////////////////////////
> // Encryption
> RSAES_OAEP_SHA_Encryptor e(publicKey);
>
> StringSource(plain, true,
>     new PK_EncryptorFilter(rng, e,
>         new StringSink(cipher)
>    ) // PK_EncryptorFilter
> ); // StringSource
Try:

  StringSource sse(plain, true,
    new PK_EncryptorFilter(rng, e,
      new StringSink(cipher)
    ) // PK_EncryptorFilter
  ); // StringSource

> ////////////////////////////////////////////////
> // Decryption
> RSAES_OAEP_SHA_Decryptor d(privateKey);
>
> StringSource(cipher, true,
>     new PK_DecryptorFilter(rng, d,
>         new StringSink(recovered)
>    ) // PK_DecryptorFilter
> ); // StringSource
Try:

  StringSource ssd(cipher, true,
    new PK_DecryptorFilter(rng, d,
      new StringSink(recovered)
    ) // PK_DecryptorFilter
  ); // StringSource

> cout << "Recovered plain text" << endl;
>
> I think I am getting a segmentation error due to StringSource, but I'm
> not able to figure out why. I'm new to crypto++ and relatively new to c
> ++ too.
I've got to check if that (not using a variable name) is legal C++. I
thought it was when the sample was written. If legal, it might be that
not using a variable does something with sequence points, or GCC is
optimizing too aggressively.

Jeff

-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.

Reply via email to