- dcmd[1] = data[0];\r
- dcmd[2] = data[1];\r
- dcmd[3] = data[2];\r
- dcmd[4] = data[3];\r
- dcmd[5] = data[4];\r
- AppendCrc14443a(dcmd, 6);\r
- ReaderTransmit(dcmd, sizeof(dcmd), NULL);\r
- int len = ReaderReceive(answer, answer_parity);\r
- if(!len) {\r
- if (MF_DBGLEVEL >= 1) Dbprintf("Authentication failed. Card timeout.");\r
- return 2;\r
- }\r
- return len;\r
-}\r
-\r
-int mifare_sendcmd_short_mfucauth(struct Crypto1State *pcs, uint8_t crypted, uint8_t cmd, uint8_t *data, uint8_t *answer, uint8_t *answer_parity, uint32_t *timing)\r
-{\r
- uint8_t dcmd[19];\r
- int len; \r
- dcmd[0] = cmd;\r
- memcpy(dcmd+1,data,16);\r
- AppendCrc14443a(dcmd, 17);\r
- \r
- ReaderTransmit(dcmd, sizeof(dcmd), timing);\r
- len = ReaderReceive(answer, answer_parity);\r
- if(!len) {\r
- if (MF_DBGLEVEL >= MF_DBG_ERROR) Dbprintf("Authentication failed. Card timeout.");\r
- len = ReaderReceive(answer,answer_parity);\r
- }\r
- if(len==1) {\r
- if (MF_DBGLEVEL >= MF_DBG_ERROR) Dbprintf("NAK - Authentication failed.");\r
- return 1;\r
- }\r
- return len;\r
-}\r
-\r
-int mifare_sendcmd_short_mfuev1auth(struct Crypto1State *pcs, uint8_t crypted, uint8_t cmd, uint8_t *data, uint8_t *answer, uint8_t *answer_parity, uint32_t *timing)\r
-{\r
- uint8_t dcmd[7];\r
- int len; \r
- dcmd[0] = cmd;\r
- memcpy(dcmd+1,data,4);\r
- AppendCrc14443a(dcmd, 5);\r
- \r