On Monday, December 7, 2015 at 3:57:43 PM UTC-5, [email protected] wrote:
>
> I see that most of the examples use new.
> I wrote my code to not use new:
>
> AES::Encryption aesEncryption((const byte *)encKey.constData(), 
> AES::DEFAULT_KEYLENGTH);
>
> CFB_Mode<AES>::Encryption e;
>
> e.SetKeyWithIV((const byte *)encKey.constData(), 16, (const 
> byte*)iv.constData());
>
>
> FileSink   sink((const char *)outFilename.toLocal8Bit().constData());
>
> StreamTransformationFilter aes_enc(e, &sink);
>
> FileSource src((const char *)inFilename.toLocal8Bit().constData(), true, 
> &aes_enc);
>
>
>
> ...
> What do I need to learn about cryptopp's memory management?
>

That is detailed in the README, but its easy to miss.

In the above, FileSource owns the aes_enc object. FileSource will delete 
it, and then it will be deleted (again) when the frame is exited. You can 
make it work with:

    FileSource src((const char *)inFilename.toLocal8Bit().constData(), true, 
new 
Redirector(aes_enc));

Here's a page with a little more information: 
https://www.cryptopp.com/wiki/Pipelining 

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.
--- 
You received this message because you are subscribed to the Google Groups 
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to