Hi Alex, Yes, the method taking a buffer uses it to process the data in chunks, and the buffer can be much smaller than the actual full data.
The buffer doesn't have to be sized as a power-of-2, but only a power-of-2 amount of it will be used (the highest that fits), so the rest is unused in this context. There are small overheads per chunk in the resulting output, so you don't want tiny chunks, but 1MB may be excessive. Be mindful that the choice of chunk size is likely to dictate the memory requirements for any parser that eventually reads the output. Regards, Pete Dettman On 25/05/2016 9:59 PM, Alex Malmyguine wrote: > Good time of the day everyone, > > Is my understanding correct that when calling the method in subject, buffer > size can be any reasonable number which is a power of 2 and it does not > necessarily need to be equal to the size of data to be encryted? > For example, if data is 1 GB, then would using a 1 MB buffer be sufficient? > I am just trying to avoid a potential problem when there may not be a large > single contiguous block of memory available to encrypt data. > > Thank you! > Alex > >
