Hi,
I'm working on a simple project on KDevelop (linux Slackware virtual 
machine, on a Windows 7 host). I have to write a C++ code that : 1) creates 
a folder; 2) creates a number of text files in that folder; 3) Calculates a 
hash of each file with RIPEMD128; 4) Signs each hash with RSA ; 5)performs 
an integrity check if requested.
I'm using Cryptopp 5.6.1 for RIPEMD128 and RSA functions.
I realized and tested points 1) 2) and 3). I realized and tested point 4) 
following CryptoPP Signature Scheme Wiki: 
http://www.cryptopp.com/wiki/RSA_Signature_Schemes, and it works fine. Now 
i'm trying to integrate point 4) with the project and i realized the 
following "signing function":

CrypoPP::AutoSeededRandomPool RNG;

CryptoPP::RSA::PrivateKey RSAprivate;
CryptoPP::RSA::PublicKey RSApublic ( RSAprivate);

void Signature::SignHash(string Hash)
{
    string Digest = Hash;
    string Signature = "";

    CryptoPP::RSASS<Cryptopp::PSS,CryptoPP::SHA1>::Signer 
signer(RSAprivate);
    cout << "cotrol point 1";

    CryptoPP::StringSource( Digest,true , new CryptoPP::SignerFilter ( RNG 
, signer, new CryptoPP::StringSink ( Signature ) ) );
    cout << "control point 2";
}

If i launch the program it prints control point 1 and then it crashes in a 
Segmentation fault (bin/sh: line 1 3216 Segmentation fault           
 /root/<directory>/debug/. /src/<project>) !!
I'm a new user of C++ and Slackware and i don't know how to solve this 
problem ( I think that segmentation fault derives from a memory and/or a 
C++ contructor/destructor problem....... )

Anyone can help me to solve this fault?

-- 
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