|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] RE: iSCSI Data Integrity - DigestsSean, <snip> > I am certainly no expert in checksums, but I believe the adler32 checksum > used in zip (rfc1950) and SCTP (rfc2960) is claimed to be as good > as a 32 bit > CRC and it is more friendly to software implementation on a 32 bit > machine, though given that it uses the mod operator it is more difficult > than CRC to implement in hardware. Secure hashes such as md5 are also > fairly reasonable in software with the added bonus that they can resist > tampering - these are also probably difficult to do in hardware. I am not sure I understand the difficulty imposed by adler32 with respect to hardware. Optimal assembly code looks different with about three instructions per byte. Here is the example implementation of adler32 from Randall Stewarts reference code (edited): /* SCTP reference Implementation Copyright (C) 1999 Cisco And Motorola */ ui32 update_adler32 (ui32 adler, ui8 *buf, ui32 len) { ui32 s1 = adler & 0xffff; ui32 s2 = (adler >> 16) & 0xffff; i32 n; for (n = 0; n < len; n++, buf++) { s1 = (s1 + *buf); if (s1 >= BASE) s1 -= BASE; s2 = (s2 + s1); if (s2 >= BASE) s2 -= BASE; } return (s2 << 16) + s1; } Compliments to Mark Adler (mailto:madler@alumni.caltech.edu). Doug
Home Last updated: Tue Sep 04 01:05:37 2001 6315 messages in chronological order |