CRC32
CRC

32-bit CRC More...

Collaboration diagram for CRC32:

## Data Structures

struct | crc32_data_t
| State information for the CRC32 algorithm. More...

## CRC32

void | crc32_init (crc32_data_t *crc32Config)
| Initializes the parameters of the crc function, must be called first. More...
void | crc32_update (crc32_data_t *crc32Config, const uint8_t *src, uint32_t lengthInBytes)
| A "running" crc calculator that updates the crc value after each call. More...
void | crc32_finalize (crc32_data_t *crc32Config, uint32_t *hash)
| Calculates the final crc value, padding with zeros if necessary, must be called last. More...

## Usage Information

32-bit CRC

## Data Structure Documentation

struct crc32_data_t

State information for the CRC32 algorithm.

Data Fields
uint32_t | byteCountCrc | Number of bytes processed.
uint32_t | currentCrc | Current CRC value.

## Function Documentation

void crc32_finalize | ( | crc32_data_t * | crc32Config,
|  | uint32_t * | hash
| ) |  |

Calculates the final crc value, padding with zeros if necessary, must be called last.

Parameters

  crc32Config | Instantiation of the data structure of type crc32_data_t
  hash | Pointer to the value returned for the final calculated crc value

Return values

  kStatus_Success |

void crc32_init | ( | crc32_data_t * | crc32Config | ) |

Initializes the parameters of the crc function, must be called first.

Parameters

  crc32Config | Instantiation of the data structure of type crc32_data_t

Return values

  kStatus_Success |

void crc32_update | ( | crc32_data_t * | crc32Config,
|  | const uint8_t * | src,
|  | uint32_t | lengthInBytes
| ) |  |

A "running" crc calculator that updates the crc value after each call.

Parameters

  crc32Config | Instantiation of the data structure of type crc32_data_t
  src | Pointer to the source buffer of data
  lengthInBytes | The length, given in bytes (not words or long-words)

Return values

  kStatus_Success |

Note: We must init CRC module here, As we may seperate one crc calculation into several times Note: It is better to use lock to ensure the integrity of current updating operation of crc calculation