tools/firmware-utils/src/cyg_crc32.c
/* This is the standard Gary S. Brown's 32 bit CRC algorithm, but
   accumulate the CRC into the result of a previous CRC. */
This is the standard Gary S. Brown's 32 bit CRC algorithm, but
accumulate the CRC into the result of a previous CRC.
This is the standard Gary S . Brown ' s 32 bit CRC algorithm but accumulate the CRC into the result of a previous CRC .
cyg_uint32 
cyg_crc32_accumulate(cyg_uint32 crc32val, unsigned char *s, int len)
{
  int i;
  for (i = 0;  i < len;  i++) {
    crc32val = crc32_tab[(crc32val ^ s[i]) & 0xff] ^ (crc32val >> 8);
  }
  return crc32val;
}
cyg_uint32 cyg_crc32_accumulate ( cyg_uint32 crc32val , unsigned char * s , int len ) { int i ; for ( i = 0 ; i < len ; i ++ ) { crc32val = crc32_tab [ ( crc32val ^ s [ i ] ) & 0xff ] ^ ( crc32val >> 8 ) ; } return crc32val ; }
This is the standard Gary S. Brown's 32 bit CRC algorithm, but
accumulate the CRC into the result of a previous CRC.
This is the standard Gary S . Brown ' s 32 bit CRC algorithm but accumulate the CRC into the result of a previous CRC .