mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-05-12 11:18:11 -07:00
More CRLF -> LF cleanup
This commit is contained in:
+14
-14
@@ -1,14 +1,14 @@
|
||||
#include "crc16.h"
|
||||
|
||||
unsigned short update_crc16( unsigned short crc, unsigned char c )
|
||||
{
|
||||
unsigned short i, v, tcrc = 0;
|
||||
|
||||
v = (crc ^ c) & 0xff;
|
||||
for (i = 0; i < 8; i++) {
|
||||
tcrc = ( (tcrc ^ v) & 1 ) ? ( tcrc >> 1 ) ^ 0x8408 : tcrc >> 1;
|
||||
v >>= 1;
|
||||
}
|
||||
|
||||
return ((crc >> 8) ^ tcrc)&0xffff;
|
||||
}
|
||||
#include "crc16.h"
|
||||
|
||||
unsigned short update_crc16( unsigned short crc, unsigned char c )
|
||||
{
|
||||
unsigned short i, v, tcrc = 0;
|
||||
|
||||
v = (crc ^ c) & 0xff;
|
||||
for (i = 0; i < 8; i++) {
|
||||
tcrc = ( (tcrc ^ v) & 1 ) ? ( tcrc >> 1 ) ^ 0x8408 : tcrc >> 1;
|
||||
v >>= 1;
|
||||
}
|
||||
|
||||
return ((crc >> 8) ^ tcrc)&0xffff;
|
||||
}
|
||||
|
||||
+31
-31
@@ -1,31 +1,31 @@
|
||||
#include "iso14443crc.h"
|
||||
|
||||
static unsigned short UpdateCrc14443(unsigned char ch, unsigned short *lpwCrc)
|
||||
{
|
||||
ch = (ch ^ (unsigned char) ((*lpwCrc) & 0x00FF));
|
||||
ch = (ch ^ (ch << 4));
|
||||
*lpwCrc = (*lpwCrc >> 8) ^ ((unsigned short) ch << 8) ^
|
||||
((unsigned short) ch << 3) ^ ((unsigned short) ch >> 4);
|
||||
return (*lpwCrc);
|
||||
}
|
||||
|
||||
void ComputeCrc14443(int CrcType,
|
||||
unsigned char *Data, int Length,
|
||||
unsigned char *TransmitFirst,
|
||||
unsigned char *TransmitSecond)
|
||||
{
|
||||
unsigned char chBlock;
|
||||
unsigned short wCrc=CrcType;
|
||||
|
||||
do {
|
||||
chBlock = *Data++;
|
||||
UpdateCrc14443(chBlock, &wCrc);
|
||||
} while (--Length);
|
||||
|
||||
if (CrcType == CRC_14443_B)
|
||||
wCrc = ~wCrc; /* ISO/IEC 13239 (formerly ISO/IEC 3309) */
|
||||
|
||||
*TransmitFirst = (unsigned char) (wCrc & 0xFF);
|
||||
*TransmitSecond = (unsigned char) ((wCrc >> 8) & 0xFF);
|
||||
return;
|
||||
}
|
||||
#include "iso14443crc.h"
|
||||
|
||||
static unsigned short UpdateCrc14443(unsigned char ch, unsigned short *lpwCrc)
|
||||
{
|
||||
ch = (ch ^ (unsigned char) ((*lpwCrc) & 0x00FF));
|
||||
ch = (ch ^ (ch << 4));
|
||||
*lpwCrc = (*lpwCrc >> 8) ^ ((unsigned short) ch << 8) ^
|
||||
((unsigned short) ch << 3) ^ ((unsigned short) ch >> 4);
|
||||
return (*lpwCrc);
|
||||
}
|
||||
|
||||
void ComputeCrc14443(int CrcType,
|
||||
unsigned char *Data, int Length,
|
||||
unsigned char *TransmitFirst,
|
||||
unsigned char *TransmitSecond)
|
||||
{
|
||||
unsigned char chBlock;
|
||||
unsigned short wCrc=CrcType;
|
||||
|
||||
do {
|
||||
chBlock = *Data++;
|
||||
UpdateCrc14443(chBlock, &wCrc);
|
||||
} while (--Length);
|
||||
|
||||
if (CrcType == CRC_14443_B)
|
||||
wCrc = ~wCrc; /* ISO/IEC 13239 (formerly ISO/IEC 3309) */
|
||||
|
||||
*TransmitFirst = (unsigned char) (wCrc & 0xFF);
|
||||
*TransmitSecond = (unsigned char) ((wCrc >> 8) & 0xFF);
|
||||
return;
|
||||
}
|
||||
|
||||
+495
-495
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user