mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
[Fix] added original comments back; use same bitwise operation for even check
Signed-off-by: Andy Shieh <hsieandy@gmail.com>
This commit is contained in:
parent
9ce9031516
commit
7e7fe1837e
1 changed files with 8 additions and 1 deletions
|
@ -1163,7 +1163,7 @@ int getIndalaBits(uint8_t fc, uint16_t cn, uint8_t *bits) {
|
||||||
chk += ((cn >> 2) & 1); //y14 == 89 - 30 = 59
|
chk += ((cn >> 2) & 1); //y14 == 89 - 30 = 59
|
||||||
chk += (cn & 1); //y16 == 71 - 30 = 41
|
chk += (cn & 1); //y16 == 71 - 30 = 41
|
||||||
|
|
||||||
if ((chk % 2) == 0) { // If the sum is even, checksum is '10' (binary) = 2.
|
if ((chk & 1) == 0) { // If the sum is even, checksum is '10' (binary) = 2.
|
||||||
bits[62] = 1;
|
bits[62] = 1;
|
||||||
bits[63] = 0;
|
bits[63] = 0;
|
||||||
} else { // If the sum is odd, checksum is '01' (binary) = 1.
|
} else { // If the sum is odd, checksum is '01' (binary) = 1.
|
||||||
|
@ -1171,6 +1171,13 @@ int getIndalaBits(uint8_t fc, uint16_t cn, uint8_t *bits) {
|
||||||
bits[63] = 1;
|
bits[63] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add parity
|
||||||
|
// bits[34] = 1; // p1 64 - 30 = 34
|
||||||
|
// bits[38] = 1; // p2 68 - 30 = 38
|
||||||
|
|
||||||
|
// 92 = 62
|
||||||
|
// 93 = 63
|
||||||
|
|
||||||
bits[34] = 0; // parity for odd bits
|
bits[34] = 0; // parity for odd bits
|
||||||
bits[38] = 0; // parity for even bits
|
bits[38] = 0; // parity for even bits
|
||||||
uint8_t p1 = 1;
|
uint8_t p1 = 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue