CRC checksum APIs

Header File

Source: include/crypto/crc.h

#include <crypto/crc.h>

Functions

unsigned int crc32(const void *buf, int size)

Calculate CRC32 checksum Polynomial used: 0x04C11DB7

Parameters:
  • buf – [in] Input data buffer

  • size – [in] Size of data

Returns:

CRC32 checksum

unsigned short crc16_ccitt(const unsigned char *buf, int size)

Calculate CRC-16 checksum Polynomial: 0x1021, x^16 + x^12 + x^5 + 1

Parameters:
  • buf – [in] Input data buffer

  • size – [in] Size of data

Returns:

CRC16 Checksum

unsigned short crc16_mcrf4xx(const unsigned char *buf, int size)

Calculate CRC-16 checksum Polynomial: 0x8408, 1 + x^5 + x^12 + x^16 + 1

Parameters:
  • buf – [in] Input data buffer

  • size – [in] Size of data

Returns:

CRC16 Checksum

unsigned char crc8(const unsigned char *buf, int size)

Calculate CRC-8 checksum

Parameters:
  • buf – [in] Input data buffer

  • size – [in] Size of data

Returns:

CRC8 Checksum