[asterisk-dev] include/asterisk/sha1.h and sha1.c

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Sun Feb 5 10:19:25 MST 2006


On Saturday 04 February 2006 12:10, Luigi Rizzo wrote:
> On Sat, Feb 04, 2006 at 07:51:53PM +0800, Steve Underwood wrote:
> ...
>
> > Whilst the ^Ms are a pain, why is the use of standardised data
> > types like int_least16_t considered bad?
>
> because it is unnecessary  - a plain int would do the job
> perfectly.
>
> A plain uint would be even better here, because the field is used
> as an index into a 64-entry array, so you want an unsigned int
> type, not an int.  And 7 bits suffice, not 16. So uint8_t would be
> ok for the type, or basically any unsigned type.
>
> Using a feature from the most recent standard when there is
> a perfectly valid (actually better in this case, see above)
> alternative in the previous standards is just a poor design
> decision - it only makes the code less portable.

If you really have a problem with this, you might suggest that the
IETF reissue the relevant RFC.  The code in question is a verbatim
copy from the RFC.

-- 
Tilghman



More information about the asterisk-dev mailing list