Merge pull request #2453 from mwalker33/Indala-26-parity

Indala 26 parity
This commit is contained in:
Iceman 2024-08-18 06:03:21 +02:00 committed by GitHub
commit e0e87566c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1164,11 +1164,26 @@ int getIndalaBits(uint8_t fc, uint16_t cn, uint8_t *bits) {
}
// add parity
bits[34] = 1; // p1 64 - 30 = 34
bits[38] = 1; // p2 68 - 30 = 38
// 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[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;
}