Does Adler32 + adler messages go to zero (e.g. CRC32)

CRC-32 has this remarkable property that adding CRC to the end of the message allows you to check the message by calculating the CRC of the whole thing, and if the checksum passes, the final result will be zero.

Is this property valid for sibling CRC-32, Adler32?

The short answer seems “No,” but I just wanted to make sure I was missing something.

Using the sample post here http://en.wikipedia.org/wiki/Adler-32 , I wrote a test program below using the zlib implementation

#include <zlib.h> #include <stdio.h> #include <string.h> void print_sum( const char * str ) { uLong asum = 0; asum = adler32( 0, Z_NULL, 0 ); asum = adler32( asum, str, strlen(str) ); printf( "%x\n", asum); } int main (int argc, char** argv) { const char * msg1 = "Wikipedia"; const char * msg2 = "Wikipedia\x98\x03\xe6\x11"; const char * msg3 = "Wikipedia\x11\xe6\x03\x98"; print_sum( msg1 ); print_sum( msg2 ); print_sum( msg3 ); } 

And here are the results:

 11e60398 248c052a 23da052a 
+4
source share
1 answer

As you have found, the answer is no. This property is not required for the validation value. In fact, most CRC verification implementations do not start CRC at the end. They simply check if the calculated CRC matches the stored CRC.

+3
source

All Articles