mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
Merge pull request #2453 from mwalker33/Indala-26-parity
Indala 26 parity
This commit is contained in:
commit
e0e87566c9
1 changed files with 17 additions and 2 deletions
|
@ -1164,12 +1164,27 @@ int getIndalaBits(uint8_t fc, uint16_t cn, uint8_t *bits) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// add parity
|
// add parity
|
||||||
bits[34] = 1; // p1 64 - 30 = 34
|
// bits[34] = 1; // p1 64 - 30 = 34
|
||||||
bits[38] = 1; // p2 68 - 30 = 38
|
// bits[38] = 1; // p2 68 - 30 = 38
|
||||||
|
|
||||||
// 92 = 62
|
// 92 = 62
|
||||||
// 93 = 63
|
// 93 = 63
|
||||||
|
|
||||||
|
bits[34] = 0; // parity for odd bits
|
||||||
|
bits[38] = 0; // parity for even bits
|
||||||
|
uint8_t p1 = 1;
|
||||||
|
uint8_t p2 = 1;
|
||||||
|
|
||||||
|
for (int i=33; i < 64; i++) {
|
||||||
|
if (i%2)
|
||||||
|
p1 ^= bits[i];
|
||||||
|
else
|
||||||
|
p2 ^= bits[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
bits[34] = p1; // parity for odd bits
|
||||||
|
bits[38] = p2; // parity for even bits
|
||||||
|
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue