X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/5279085ae711148fe1e7318e5b8572da7d8616d6..00848e096b408a43786ea283d4e77d32189994b9:/common/crc.h diff --git a/common/crc.h b/common/crc.h index adbfb237..e2ccd34b 100644 --- a/common/crc.h +++ b/common/crc.h @@ -11,6 +11,7 @@ #include #include +#include typedef struct crc { uint32_t state; @@ -26,7 +27,7 @@ typedef struct crc { * final_xor is XORed onto the state before returning it from crc_result(). */ extern void crc_init(crc_t *crc, int order, uint32_t polynom, uint32_t initial_value, uint32_t final_xor); -/* Update the crc state. data is the data of length data_width bits (only the the +/* Update the crc state. data is the data of length data_width bits (only the * data_width lower-most bits are used). */ extern void crc_update(crc_t *crc, uint32_t data, int data_width); @@ -39,6 +40,10 @@ extern uint32_t crc_finish(crc_t *crc); // Calculate CRC-8/Maxim checksum uint32_t CRC8Maxim(uint8_t *buff, size_t size ); + +// Calculate CRC-8 Mifare MAD checksum +uint32_t CRC8Mad(uint8_t *buff, size_t size); + /* Static initialization of a crc structure */ #define CRC_INITIALIZER(_order, _polynom, _initial_value, _final_xor) { \ .state = ((_initial_value) & ((1L<<(_order))-1)), \