39 # define CRCHIGHBIT 0x80
43 # define CRCBYTE0 crc[0]
44 # define CRCBYTE1 crc[1]
45 # define CRCBYTE2 crc[2]
46 # define CRCBYTE3 crc[3]
47 # define CRCBYTE4 crc[4]
48 # define CRCBYTE5 crc[5]
51 # define CRCHIGHBIT 0x8000
52 static CRC48_t
initializer = {{0xa533, 0xdf57, 0xecf1}};
53 static CRC48_t
generator = {{0x3528, 0x7109, 0xeadb}};
54 static CRC48_t
complement = {{0x5acc, 0xdf57, 0x130e}};
55 # define CRCBYTE0 crc[0]
56 # define CRCBYTE1 crc[0] >> 8
57 # define CRCBYTE2 crc[1]
58 # define CRCBYTE3 crc[1] >> 8
59 # define CRCBYTE4 crc[2]
60 # define CRCBYTE5 crc[2] >> 8
63 # define CRCHIGHBIT 0x80000000L
64 static CRC48_t
initializer = {{0xdf57a533L, 0xecf1L}};
65 static CRC48_t
generator = {{0x71093528L, 0xeadbL}};
66 static CRC48_t
complement = {{0xdf575accL, 0x130eL}};
67 # define CRCBYTE0 crc[0]
68 # define CRCBYTE1 crc[0] >> 8
69 # define CRCBYTE2 crc[0] >> 16
70 # define CRCBYTE3 crc[0] >> 24
71 # define CRCBYTE4 crc[1]
72 # define CRCBYTE5 crc[1] >> 8
75 # define CRCHIGHBIT 0x800000000000L
77 static CRC48_t
generator = {{0xeadb71093528L}};
78 static CRC48_t
complement = {{0x130edf575accL}};
79 # define CRCBYTE0 crc[0]
80 # define CRCBYTE1 crc[0] >> 8
81 # define CRCBYTE2 crc[0] >> 16
82 # define CRCBYTE3 crc[0] >> 24
83 # define CRCBYTE4 crc[0] >> 32
84 # define CRCBYTE5 crc[0] >> 40
97 for (
unsigned char *
p = (
unsigned char *)dataPtr;
count;
count--)
105 acc.
crc[0] ^= *(
p++);
108 for(
int bits=0; bits<8; bits++)
111 int bit = acc.
crc[0] & 0x01;
137 if (
count < 1)
return;
145 unsigned char *
p = (
unsigned char*)dataPtr;
151 p[0] = xmit.CRCBYTE0;
153 p[1] = xmit.CRCBYTE1;
155 p[2] = xmit.CRCBYTE2;
157 p[3] = xmit.CRCBYTE3;
159 p[4] = xmit.CRCBYTE4;
161 p[5] = xmit.CRCBYTE5;
void getCRC48(const CRC48_t &acc, void *dataPtr, int count)
void initCRC48(CRC48_t &acc)
static CRC48_t complement
static CRC48_t initializer
void calcCRC48(CRC48_t &acc, const void *dataPtr, int count)
CRCBASETYPE crc[CRCARRAYSIZE]