X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/be09ea86035044f67e0419b067ac54ee055ad9ee..01aa068b6ff34d86dd5d9d9e962aba20cd490050:/common/iso15693tools.c?ds=sidebyside diff --git a/common/iso15693tools.c b/common/iso15693tools.c index 2da6c7f9..56b2fdb0 100644 --- a/common/iso15693tools.c +++ b/common/iso15693tools.c @@ -9,9 +9,8 @@ #include "iso15693tools.h" -#include "proxmark3.h" +#include #include -#include #ifdef ON_DEVICE #include "printf.h" #else @@ -71,7 +70,7 @@ char* Iso15693sprintUID(char *target, uint8_t *uid) { } -uint16_t iclass_crc16(char *data_p, unsigned short length) { +uint16_t iclass_crc16(uint8_t *data_p, unsigned short length) { unsigned char i; unsigned int data; uint16_t crc = ISO15693_CRC_PRESET; @@ -80,7 +79,7 @@ uint16_t iclass_crc16(char *data_p, unsigned short length) { return (~crc); do { - for (i = 0, data = (unsigned int)0xff & *data_p++; i < 8; i++, data >>= 1) { + for (i = 0, data = 0xff & *data_p++; i < 8; i++, data >>= 1) { if ((crc & 0x0001) ^ (data & 0x0001)) crc = (crc >> 1) ^ ISO15693_CRC_POLY; else crc >>= 1; @@ -90,7 +89,7 @@ uint16_t iclass_crc16(char *data_p, unsigned short length) { crc = ~crc; data = crc; crc = (crc << 8) | (data >> 8 & 0xff); - crc = crc ^ 0xBC3; + crc = crc ^ 0x0BC3; return (crc); }