ADD: added some time debug statements to be able to measure execution time.

CHG: change the auth_ex method to send usb package faster,
REM: removed some bucketsort changes.
This commit is contained in:
iceman1001 2016-02-17 17:30:37 +01:00
commit 838c15a643
16 changed files with 279 additions and 288 deletions

View file

@ -998,8 +998,6 @@ void MifareChkKeys(uint16_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *datain)
set_tracing(TRUE);
for (i = 0; i < keyCount; ++i) {
if (mifare_classic_halt(pcs, cuid))
if (MF_DBGLEVEL >= 1) Dbprintf("ChkKeys: Halt error");
if (!iso14443a_select_card(uid, NULL, &cuid, true, 0)) {
if (OLD_MF_DBGLEVEL >= 1) Dbprintf("ChkKeys: Can't select card");
@ -1007,19 +1005,23 @@ void MifareChkKeys(uint16_t arg0, uint8_t arg1, uint8_t arg2, uint8_t *datain)
}
ui64Key = bytes_to_num(datain + i * 6, 6);
if (mifare_classic_auth(pcs, cuid, blockNo, keyType, ui64Key, AUTH_FIRST))
if (mifare_classic_auth(pcs, cuid, blockNo, keyType, ui64Key, AUTH_FIRST)) {
if (mifare_classic_halt(pcs, cuid))
if (MF_DBGLEVEL >= 1) Dbprintf("ChkKeys: Halt error");
continue;
}
isOK = 1;
break;
}
crypto1_destroy(pcs);
LED_B_ON();
cmd_send(CMD_ACK,isOK,0,0,datain + i * 6,6);
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
LEDsoff();
set_tracing(FALSE);
crypto1_destroy(pcs);
// restore debug level
MF_DBGLEVEL = OLD_MF_DBGLEVEL;