Verify the integrity of key state update messages using CRC16-CCITT.
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
#define __CRC16_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define CRC16_HASH_LENGTH 2 // bytes
|
||||
|
||||
typedef struct Crc16Data {
|
||||
uint16_t currentCrc;
|
||||
@@ -22,4 +25,7 @@ void crc16_update(crc16_data_t *crc16Config, const uint8_t *src, uint32_t length
|
||||
//! @param hash Pointer to the value returned for the final calculated crc value.
|
||||
void crc16_finalize(crc16_data_t *crc16Config, uint16_t *hash);
|
||||
|
||||
void CRC16_AppendToMessage(uint8_t *message, uint32_t lengthInBytes);
|
||||
bool CRC16_IsMessageValid(uint8_t *message, uint32_t lengthInBytes);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user