Hi -

> From: "Hallam-Baker, Phillip" <[EMAIL PROTECTED]>
> To: "Harald Tveit Alvestrand" <[EMAIL PROTECTED]>; "Fred Baker" <[EMAIL 
> PROTECTED]>
> Cc: <[email protected]>
> Sent: Tuesday, February 27, 2007 6:45 AM
> Subject: RE: Protest: Complexity running rampant
...
> DER would not have been so bad if they had chosen to use
> indefinite length encoding for lists rather than definite length,
> thus requiring implementations to chose between unnecessary
> recursion and unnecessary memory copies.
...

There's a third approach that can be simpler to implement and
faster to execute - do the encoding *backwards*, starting at the
end of your buffer.  Then you don't need to encode the length
(and length-of-length) fields before you know their values.  That
way one can do the encoding without recursion or unnecessary
copies, and ensure that all lengths are minimal.

Randy


_______________________________________________
Ietf mailing list
[email protected]
https://www1.ietf.org/mailman/listinfo/ietf

Reply via email to