Hello,

I am trying to run a very simple stream cipher example, taken from the
FAQ, but I am getting a segmentation fault.

Here is the code:

#include <sosemanuk.h>
using CryptoPP::Sosemanuk;

int main()
{
    byte plaintext[100], ciphertext[100],
key[Sosemanuk::DEFAULT_KEYLENGTH], iv[Sosemanuk::IV_LENGTH];
    // put data into key, iv, and plaintext here
    // encrypt
    Sosemanuk::Encryption enc(key, Sosemanuk::DEFAULT_KEYLENGTH, iv);
    enc.ProcessData(ciphertext, plaintext, 100);
    // now decrypt
    Sosemanuk::Decryption dec(key, Sosemanuk::DEFAULT_KEYLENGTH, iv);
    dec.ProcessData(plaintext, ciphertext, 100);
}

My compiler in MinGW g++ 4.5.0, OS is Windows XP 64-bit edition
Service Pack 2.
CryptoPP version is 5.6.0.

gdb gives this strack trace:

Program received signal SIGSEGV, Segmentation fault.
#0 0x00409da8 in CryptoPP::SosemanukPolicy::OperateKeystream
(this=0x46a190, operation=2293488,output=0x77bbcbb5 "ï≡ï╞ΦA╣",
input=0x3f0000 "╚", iterationCount=0) at sosemanuk.cpp:605
#1 0x003f23e0 in ?? ()
Cannot access memory at address 0x50000065

What am I doing wrong?

Thanks,

Nate.

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