chg: iClass crc is byteswap

This commit is contained in:
iceman1001 2018-01-29 16:36:07 +01:00
commit cbe313a569
2 changed files with 1 additions and 6 deletions

View file

@ -181,7 +181,7 @@ uint16_t crc16_a(uint8_t const *d, size_t n) {
// poly 0x1021 reflected 0x8408
// poly=0x1021 init=0x4807 refin=true refout=true xorout=0x0BC3 check=0xF0B8 name="CRC-16/ICLASS"
uint16_t crc16_iclass(uint8_t const *d, size_t n) {
return crc16_fast(d, n, 0x4807, true, true);
return BSWAP_16(crc16_fast(d, n, 0x4807, true, true));
}
// This CRC-16 is used in Legic Advant systems.
@ -200,7 +200,6 @@ uint16_t crc16_dnp(uint8_t const *d, size_t n) {
return crc;
}
// -----------------CHECK functions.
bool check_crc16_ccitt(uint8_t const *d, size_t n) {
if (n < 3) return false;

View file

@ -67,8 +67,4 @@ uint16_t crc16_fast(uint8_t const *d, size_t n, uint16_t initval, bool refin, bo
//checks
bool check_crc16_ccitt(uint8_t const *d, size_t n);
//felica imp
void felica_test();
void init_crcccitt_tab( void );
uint16_t update_crc_ccitt( uint16_t crc,uint8_t c );
#endif