Subject: Re: Parser abilities, and MDCs (Re: pointers to openpgp-interopknowledge base?)

From: [email-masked] (Peter Gutmann)
Date: Fri, 9 Nov 2001 08:25:52 +1300 (NZDT)

Derek Atkins <[email-masked]> writes:
>>If only it were that easy.  Consider what happens when someone says "You have a
>>900K transfer buffer, stream data through it".
>
>Do you mean you have 900K to transfer, or you have a buffer of 900K that you
>can use to buffer something larger?  In either case, I'd use the largest
>buffer-size that fits (i.e. 512K in this case) and just eat the rest of the
>buffer.

I don't control it, I'm told "Here's an xK buffer, employ it optimally" (as a
generalisation of that, any encoding method which forces a certain
implementation style to the exclusion of others is a bad idea.  In this
instance it makes it extremely painful to use arbitrary-sized buffers).

>it's what we came up with at the time.

There's a simple solution, which is to avoid it where possible (it's not
actually needed anywhere except maybe a few special-case situations, so you can
use definite-length encoding and 0xA3 in most cases).

Peter.

---

From: Derek Atkins <[email-masked]>
Date: 08 Nov 2001 14:35:33 -0500

Well, the whole point of indefinite-length encoding was to encode
something when you didn't know how long it was.  For example:

run-some-command | pgp | some-other-command

In this case, you don't know how long the input is going to be,
therefore you want to use indefinite-length encoding.  On the
other hand, if you can 'stat()' the source file ahead of time,
you should DEFINITELY use definite-length encoding.

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       [email-masked]                        PGP key available