ietf
[Top] [All Lists]

Re: Protest: Complexity running rampant

2007-02-28 00:52:57
Hi -

From: "Hallam-Baker, Phillip" <pbaker(_at_)verisign(_dot_)com>
To: "Harald Tveit Alvestrand" <harald(_at_)alvestrand(_dot_)no>; "Fred Baker" 
<fred(_at_)cisco(_dot_)com>
Cc: <ietf(_at_)ietf(_dot_)org>
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
Ietf(_at_)ietf(_dot_)org
https://www1.ietf.org/mailman/listinfo/ietf

<Prev in Thread] Current Thread [Next in Thread>