#include "common.h"
#include "crc.h"
#include "override.h"
Defines | |
#define | POLYNOMIAL 0x04c11db7L |
The generator polynomial used for this version of the package is X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 as specified in the Autodin/Ethernet/ADCCP protocol standards. | |
Functions | |
RCSID ("$Id:crc.c, v 1.8 2005/09/10 10:10:36 daichik Exp $") | |
void | crc32_gen_crc_table (void) |
Generates a 256-word table containing all CRC remainders for every possible 8-bit byte. | |
guint32 | crc32_update_crc (guint32 crc_accum, gconstpointer data, size_t len) |
Update the CRC-32 on the data block one byte at a time. | |
void | crc_init (void) |
Initialize the CRC computations. | |
Variables | |
guint32 | crc_table [256] |
|
The generator polynomial used for this version of the package is X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 as specified in the Autodin/Ethernet/ADCCP protocol standards. Other degree 32 polynomials may be substituted by re-defining the symbol POLYNOMIAL below. Lower degree polynomials must first be multiplied by an appropriate power of x. The representation used is that the coefficient of x^0 is stored in the LSB of the 32-bit word and the coefficient of x^31 is stored in the most significant bit. The CRC is to be appended to the data most significant byte first. For those protocols in which bytes are transmitted MSB first and in the same order as they are encountered in the block this convention results in the CRC remainder being transmitted with the coefficient of x^31 first and with that of x^0 last (just as would be done by a hardware shift register mechanization). The table lookup technique was adapted from the algorithm described by Avram Perez, Byte-wise CRC Calculations, IEEE Micro 3, 40 (1983). |
|
Generates a 256-word table containing all CRC remainders for every possible 8-bit byte.
|
|
Update the CRC-32 on the data block one byte at a time.
|
|
Initialize the CRC computations.
|
|
|
|
|