X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/ee4e2816753bbc28ca10c20cbfbbc7eff404cab9..6a18e46fa6ab446f719111b54267d50956bcf0b0:/common/crc.c diff --git a/common/crc.c b/common/crc.c index 21019da9..8e9f3996 100644 --- a/common/crc.c +++ b/common/crc.c @@ -7,7 +7,6 @@ //----------------------------------------------------------------------------- #include "crc.h" #include "util.h" -#include #include #include @@ -44,8 +43,7 @@ uint32_t crc_finish(crc_t *crc) } //credits to iceman -uint32_t CRC8Maxim(uint8_t *buff, size_t size) -{ +uint32_t CRC8Maxim(uint8_t *buff, size_t size) { crc_t crc; crc_init(&crc, 9, 0x8c, 0x00, 0x00); crc_clear(&crc); @@ -68,10 +66,4 @@ uint32_t CRC8Legic(uint8_t *buff, size_t size) { return SwapBits(crc_finish(&crc), 8); } -uint32_t SwapBits(uint32_t value, int nrbits) { - uint32_t newvalue = 0; - for(int i = 0; i < nrbits; i++) { - newvalue ^= ((value >> i) & 1) << (nrbits - 1 - i); - } - return newvalue; -} +