I have a program that compresses and encrypts thousands of individual chunks of data. Each chunk must be compressed and encrypted separately. Everything works, but there must be a more optimal way to go about it than I am currently. Here is the code I execute for each chunk to compress it.
// Create the compressor and load it up CryptoPP::ZlibCompressor compressor; compressor.Put( buffer, sizeB ); compressor.MessageEnd(); // Get the new size newSizeB = compressor.MaxRetrievable(); // Get the data compressor.Get( newBuffer, newSizeB); As you can see, I allocate a new compressor for each chunk. This is done in a big loop, so I figured that I could "new" a compressor before the loop to save on the cost of creating the compressor for each chunk. But, this does not work. The first chunk that passes through the compressor works fine, but I always get a MaxRetrievable of 0 for all later chunks. I have tried putting Flush(true) in all over the place but nothing seems to work yet. The same issue holds for the encryption pass. Any ideas? One other thing. I am working on OS X 10.6 with XCode 3.2.2. I compiled Crypto++ as a static lib and everything went well. When I compile my app I get two warnings from the included Crypto++ header files: ../../Include/cryptopp/algparam.h:26:0 ../../Include/cryptopp/algparam.h:26: warning: unused variable 'cryptopp_assert_26' from line 26 of algparam.h ../../Include/cryptopp/algparam.h:322:0 ../../Include/cryptopp/algparam.h:322: warning: unused variable 'p' from line 322 of algparam.h I have seen some other posts along these lines. What should I change to get rid of these? Thanks, Graham -- 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.
