mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
Further additions to tidemod to differentiate between ro and rw tags and check crc validity.
This commit is contained in:
parent
1569d97730
commit
0c2ed92d87
3 changed files with 98 additions and 23 deletions
11
common/crc16.c
Normal file
11
common/crc16.c
Normal file
|
@ -0,0 +1,11 @@
|
|||
unsigned short update_crc16( WORD crc, BYTE c ) {
|
||||
WORD 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue