Subject: Partial chunking question

From: "Hasnain Mujtaba" <[email-masked]>
Date: Thu, 5 Aug 2004 13:53:40 -0400

Hi all,

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.

Regards,
Hasnain

----
The information contained in this electronic mail and any attached
document is the confidential and proprietary business information of
Forum Systems, Inc. It is intended solely for the addressed recipient
listed above. It may not be distributed in any manner without the
express written consent of Forum Systems, Inc.

---

From: David Shaw <[email-masked]>
Date: Thu, 5 Aug 2004 14:20:27 -0400

> all in one final non-partial chunk. I hope I have not overlooked some

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