mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
picopass uses a different CRC algo
This commit is contained in:
parent
2981dd94f7
commit
acaaeea450
2 changed files with 12 additions and 1 deletions
|
@ -2643,7 +2643,14 @@ void SendRawCommand14443B(iso14b_raw_cmd_t *p) {
|
||||||
if ((p->flags & ISO14B_RAW) == ISO14B_RAW) {
|
if ((p->flags & ISO14B_RAW) == ISO14B_RAW) {
|
||||||
|
|
||||||
if (((p->flags & ISO14B_APPEND_CRC) == ISO14B_APPEND_CRC) && (p->rawlen)) {
|
if (((p->flags & ISO14B_APPEND_CRC) == ISO14B_APPEND_CRC) && (p->rawlen)) {
|
||||||
AddCrc14B(p->raw, p->rawlen);
|
|
||||||
|
// Picopass uses different CRC algo
|
||||||
|
// it also excludes the first instruction byte
|
||||||
|
if ((p->flags & ISO14B_SELECT_PICOPASS) == ISO14B_SELECT_PICOPASS) {
|
||||||
|
AddCrc15(p->raw + 1, p->rawlen - 1);
|
||||||
|
} else {
|
||||||
|
AddCrc14B(p->raw, p->rawlen);
|
||||||
|
}
|
||||||
p->rawlen += 2;
|
p->rawlen += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,10 @@
|
||||||
# define AddCrc14B(data, len) compute_crc(CRC_14443_B, (data), (len), (data)+(len), (data)+(len)+1)
|
# define AddCrc14B(data, len) compute_crc(CRC_14443_B, (data), (len), (data)+(len), (data)+(len)+1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef AddCrc15
|
||||||
|
#define AddCrc15(data, len) compute_crc(CRC_ICLASS, (data), (len), (data)+(len), (data)+(len)+1)
|
||||||
|
#endif
|
||||||
|
|
||||||
void iso14443b_setup(void);
|
void iso14443b_setup(void);
|
||||||
int iso14443b_apdu(uint8_t const *msg, size_t msg_len, bool send_chaining, void *rxdata, uint16_t rxmaxlen, uint8_t *res, uint16_t *responselen);
|
int iso14443b_apdu(uint8_t const *msg, size_t msg_len, bool send_chaining, void *rxdata, uint16_t rxmaxlen, uint8_t *res, uint16_t *responselen);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue