- if (debug_info_nr == -1) {
-
- sync_time = (sync_time & 0xfffffff8) + sync_cycles + catch_up_cycles;
- catch_up_cycles = 0;
-
- // if we missed the sync time already, advance to the next nonce repeat
- WDT_HIT();
- while(GetCountSspClk() > sync_time) {
- ++elapsed_prng_sequences;
- sync_time = (sync_time & 0xfffffff8) + sync_cycles;
- //sync_time += sync_cycles;
- //sync_time &= 0xfffffff8;
- }
- WDT_HIT();
- // Transmit MIFARE_CLASSIC_AUTH at synctime. Should result in returning the same tag nonce (== nt_attacked)
- ReaderTransmit(mf_auth, sizeof(mf_auth), &sync_time);
- if (MF_DBGLEVEL == 2) Dbprintf("sync_time %d \n", sync_time);
-
- } else {
- // collect some information on tag nonces for debugging:
- #define DEBUG_FIXED_SYNC_CYCLES PRNG_SEQUENCE_LENGTH
- if (strategy == 0) {
- // nonce distances at fixed time after card select:
- sync_time = select_time + DEBUG_FIXED_SYNC_CYCLES;
- } else if (strategy == 1) {
- // nonce distances at fixed time between authentications:
- sync_time = sync_time + DEBUG_FIXED_SYNC_CYCLES;
- } else if (strategy == 2) {
- // nonce distances at fixed time after halt:
- sync_time = halt_time + DEBUG_FIXED_SYNC_CYCLES;
- } else {
- // nonce_distances at fixed time after power on
- sync_time = DEBUG_FIXED_SYNC_CYCLES;
- }
- ReaderTransmit(mf_auth, sizeof(mf_auth), &sync_time);
- }
+ sync_time = (sync_time & 0xfffffff8) + sync_cycles + catch_up_cycles;
+ catch_up_cycles = 0;
+
+ //catch_up_cycles = 0;
+
+ // if we missed the sync time already, advance to the next nonce repeat
+ while(GetCountSspClk() > sync_time) {
+ ++elapsed_prng_sequences;
+ sync_time = (sync_time & 0xfffffff8) + sync_cycles;
+ }
+ // Transmit MIFARE_CLASSIC_AUTH at synctime. Should result in returning the same tag nonce (== nt_attacked)
+ ReaderTransmit(mf_auth, sizeof(mf_auth), &sync_time);