Thanks Jeff, but the more I dig into this the more lost I am, and I'm
getting frustrated. I've done similar attachment-style cascading IO before.
My issues are:
1. [As discussed before] For some reason FileSource with the pump
argument=true attempts to allocate the entire size of the file? This is a
terrible idea. Why doesn't it pump() manageable chunks in a loop internally?
2. In order to not lock the GUI, I had to split the calls into a stateful
class, where I have Configure, Open and Pump. Then I realized there is no
Close(). I was going to cleanup in the Close().
3. Also with 2, everything is set to automatically delete the attachments
automatically. This is a bad idea and confuses ownership. Then I tried
using Ref() but that doesn't work with pointers.
4. I'm targeting many platforms, so XCode specifics should not apply.
5. In my function
void Hash::aesEncryptFilePump() {
qlonglong readLength = qMin(_blockSize, totalBytesToEncrypt -
bytesEncrypted);
qlonglong remainder = _fileSource->Pump(readLength);
bytesEncrypted += readLength - remainder;
//_fileSource->Pump(readLength);
emit bytesEncryptedChanged(bytesEncrypted);
if (_fileSource->SourceExhausted())
{
aesEncryptFileClose();
emit aesEncryptFileComplete(inFilename);
}
}
Pump() returns 65535, so nothing got encrypted.
Per
https://www.cryptopp.com/docs/ref/class_source.html#af8796ef5929f8461e80a5176d5a95a4b,
it return the number remaining, not the number read. Correct?
> You should probably call MessageEnd() on the StreamTransformationFilter.
Where?
How do I Close()? the Source and Sink as to not leak handles and make sure
it's all flushed?
--
--
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.