On Thu, Aug 05, 2004 at 01:53:40PM -0400, Hasnain Mujtaba wrote:
I had a question on breaking data into partial chunks. If someone can
clarify this, I'd appreciate it:
Suppose the chunk size you are using is 8192 bytes and the final data
chunk is less than 8192, say it is 6480. My chunking implementation puts
these final 6480 bytes into one non-partial length chunk so that the
chunk sequence looks like this: 8192, 8192, ... , 8192, 6480.
GPG and PGP, however, break this final data into power of two lengths,
i.e 8192, 8192, ... , 8192, 4096, 2048, 336.
My approach interoperates with both GPG and PGP. But I am curious as to
why GPG and PGP break the final data this way, rather than putting it
all in one final non-partial chunk. I hope I have not overlooked some
RFC requirements.
It's not an RFC requirement. When writing a stream, GnuPG picks the
largest possible power of 2 for the amount of data it is ready to
write at that point. I suspect PGP does something similar for similar
reasons.
What you are doing is also perfectly legal.
David