Subject: Re: [TICTOC] The Need for Checksum Extension

From: Hal Murray <[email-masked]>
Date: Fri, 29 Jul 2011 12:17:07 -0700

> CRC can not be readily updated, and so needs to iterate over the entire
> payload, but is still calculated on the fly. So the UDP checksum, which CAN
> be readily updated, can certainly be. 

The CRC can be updated rather than recalculating the CRC of the whole message.

I'm rusty on this stuff and it probably doesn't matter since it takes about 
as much hardware/cycles as recomputing the CRC of the whole packet.  It might 
be interesting if you are concerned about corruption while a packet is in 
memory.

The key idea is linearity:
  CRC(A+B) = CRC(A)+CRC(B) where + is XOR.
In this context, A is the original message and B is the XOR of the old and 
new messages.  That's the XOR of the old/new words you are changing padded 
with enough 0s to line up correctly.  You end up computing the CRC of a 
pseudo message rather than the real message.  (Don't forget to include the 
UDP checksum as well as the slot you are changing.)

-- 
These are my opinions, not necessarily my employer's.  I hate spam.