- if (thread_check_started) {
- if (thread_check_done) {
- pthread_join (thread_check, 0);
- thread_check_started = thread_check_done = false;
- }
- } else {
- if (total_added_nonces >= MIN_NONCES_REQUIRED)
- {
- num_good_first_bytes = estimate_second_byte_sum();
- if (total_added_nonces > (NONCES_TRIGGER*idx) || num_good_first_bytes >= GOOD_BYTES_REQUIRED) {
- pthread_create (&thread_check, NULL, check_thread, NULL);
- thread_check_started = true;
- idx++;
- }
+ if (total_added_nonces >= MIN_NONCES_REQUIRED) {
+ num_good_first_bytes = estimate_second_byte_sum();
+ if (total_added_nonces > (NONCES_TRIGGER * idx)) {
+
+ clock_t time1 = clock();
+ bool cracking = generate_candidates(first_byte_Sum, nonces[best_first_bytes[0]].Sum8_guess);
+ time1 = clock() - time1;
+ if (time1 > 0) PrintAndLog("Time for generating key candidates list: %1.0f seconds", ((float)time1)/CLOCKS_PER_SEC);
+
+ if (cracking || known_target_key != -1) {
+ field_off = brute_force(); // switch off field with next SendCommand and then finish
+ }
+
+ idx++;