mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
chg: iClass crc is byteswap
This commit is contained in:
parent
b39332e938
commit
cbe313a569
2 changed files with 1 additions and 6 deletions
|
@ -181,7 +181,7 @@ uint16_t crc16_a(uint8_t const *d, size_t n) {
|
||||||
// poly 0x1021 reflected 0x8408
|
// poly 0x1021 reflected 0x8408
|
||||||
// poly=0x1021 init=0x4807 refin=true refout=true xorout=0x0BC3 check=0xF0B8 name="CRC-16/ICLASS"
|
// 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) {
|
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.
|
// 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;
|
return crc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// -----------------CHECK functions.
|
// -----------------CHECK functions.
|
||||||
bool check_crc16_ccitt(uint8_t const *d, size_t n) {
|
bool check_crc16_ccitt(uint8_t const *d, size_t n) {
|
||||||
if (n < 3) return false;
|
if (n < 3) return false;
|
||||||
|
|
|
@ -67,8 +67,4 @@ uint16_t crc16_fast(uint8_t const *d, size_t n, uint16_t initval, bool refin, bo
|
||||||
//checks
|
//checks
|
||||||
bool check_crc16_ccitt(uint8_t const *d, size_t n);
|
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
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue