Re: Re: Adler-32 Checksum

James Carlson <[email protected]> Fri, 1 Jul 2005 10:32:09 -0400
Newsgroups gmane.ietf.rserpool
Message-ID <[email protected]>
Thomas Dreibholz writes:
> On Thursday 30 June 2005 17:06, Peter Lei wrote:
> > I'm not sure what your concern is here.  The Internet checksum
> > is just the ones's complement of (one's complement sum + carry).
> > That's two additional steps over a simple XOR sum.
> 
> XOR is computationally cheaper than addition. It works bit-wise and does not 
> need a carry.

Was that meant as a serious comment?  I don't think that sort of
consideration applies to _any_ system built in the past 40 years or
so.

I'd think that choosing a commonly-implemented (and thus likely-to-
be-bug-free and well-supported and well-understood) algorithm would
trump any concern about bit twiddling at this level.

I suspect that most people who deal with TCP/IP already have a handy,
well-tested in_cksum() function available.

-- 
James Carlson, KISS Network                    <[email protected]>
Sun Microsystems / 1 Network Drive         71.234W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.497N   Fax +1 781 442 1677