// wrapper function for multi-threaded lfsr_recovery32\r
void* nested_worker_thread(void *arg)\r
{\r
- clock_t t1 = clock();\r
struct Crypto1State *p1;\r
StateList_t *statelist = arg;\r
-\r
statelist->head.slhead = lfsr_recovery32(statelist->ks1, statelist->nt ^ statelist->uid); \r
\r
for (p1 = statelist->head.slhead; *(uint64_t *)p1 != 0; p1++);\r
statelist->len = p1 - statelist->head.slhead;\r
statelist->tail.sltail = --p1;\r
qsort(statelist->head.slhead, statelist->len, sizeof(uint64_t), Compare16Bits);\r
- \r
- \r
- t1 = clock() - t1;\r
- printf("lfsr_recovery32 takes %.0f ticks \n", (float)t1);\r
return statelist->head.slhead;\r
}\r
\r
// uint32_t max_keys = keycnt > (USB_CMD_DATA_SIZE/6) ? (USB_CMD_DATA_SIZE/6) : keycnt;\r
uint8_t keyBlock[USB_CMD_DATA_SIZE] = {0x00};\r
\r
- clock_t t1 = clock();\r
for (i = 0; i < numOfCandidates; ++i){\r
crypto1_get_lfsr(statelists[0].head.slhead + i, &key64);\r
num_to_bytes(key64, 6, keyBlock + i * 6);\r
free(statelists[1].head.slhead);\r
num_to_bytes(key64, 6, resultKey);\r
\r
- t1 = clock() - t1;\r
- printf("Check candidates takes %.0f ticks \n", (float)t1); \r
- \r
PrintAndLog("UID: %08x target block:%3u key type: %c -- Found key [%012"llx"]",\r
uid,\r
(uint16_t)resp.arg[2] & 0xff,\r
clearCommandBuffer();\r
SendCommand(&c);\r
UsbCommand resp;\r
- if (!WaitForResponseTimeout(CMD_ACK,&resp, 3000)) return 1;\r
+ if (!WaitForResponseTimeout(CMD_ACK,&resp, 2500)) return 1;\r
if ((resp.arg[0] & 0xff) != 0x01) return 2;\r
*key = bytes_to_num(resp.d.asBytes, 6);\r
return 0;\r