Commit 441d4cf1 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Switch checksums from NOP to CRC32.

parent 92e73872
#include <inttypes.h>
#include <stdlib.h>
#include "cdi_cksum.h"
#include "cksum.h"
#include "error.h"
#include "serialize.h"
uint32_t cdiCheckSum(int type, int count, void * buffer)
uint32_t cdiCheckSum(int type, int count, void *buffer)
{
return 0U;
uint32_t s = 0U;
xassert(count >= 0);
size_t elemSize = (size_t)serializeGetSizeInCore(1, type, NULL);
memcrc_r_eswap(&s, buffer, count, elemSize);
s = memcrc_finish(&s, elemSize * (size_t)count);
return s;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment