From 21d359f68fcaae74f383aaef49c15357389d4a9d Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sat, 23 Apr 2016 19:09:07 +0200 Subject: [PATCH 1/1] CHG: we don't want to assert inside the pm3 client. CHG: better message when failed to find the key. CHG: revert nonces check, 12 -> 100 --- client/cmdhfmfhard.c | 12 +++++------- client/nonce2key/crypto1_bs.h | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/client/cmdhfmfhard.c b/client/cmdhfmfhard.c index 15bdd566..015da045 100644 --- a/client/cmdhfmfhard.c +++ b/client/cmdhfmfhard.c @@ -33,9 +33,6 @@ #include #include -// uint32_t test_state_odd = 0; -// uint32_t test_state_even = 0; - #define CONFIDENCE_THRESHOLD 0.95 // Collect nonces until we are certain enough that the following brute force is successfull #define GOOD_BYTES_REQUIRED 28 @@ -1679,10 +1676,11 @@ static void brute_force(void) time(&end); unsigned long elapsed_time = difftime(end, start); - PrintAndLog("Tested %"PRIu32" states, found %u keys after %u seconds", total_states_tested, keys_found, elapsed_time); - if(!keys_found){ - assert(total_states_tested == maximum_states); - } + if(keys_found){ + PrintAndLog("Success! Tested %"PRIu32" states, found %u keys after %u seconds", total_states_tested, keys_found, elapsed_time); + } else { + PrintAndLog("Fail! Tested %"PRIu32" states, in %u seconds", total_states_tested, elapsed_time); + } // reset this counter for the next call nonces_to_bruteforce = 0; } diff --git a/client/nonce2key/crypto1_bs.h b/client/nonce2key/crypto1_bs.h index bef5c5e9..8f332749 100644 --- a/client/nonce2key/crypto1_bs.h +++ b/client/nonce2key/crypto1_bs.h @@ -58,7 +58,7 @@ bitslice_t bs_zeroes; #define ROLLBACK_SIZE 8 // number of nonces required to test to cover entire 48-bit state // I would have said it's 12... but bla goes with 100, so I do too -#define NONCE_TESTS 12 +#define NONCE_TESTS 100 // state pointer management extern __thread bitslice_t states[KEYSTREAM_SIZE+STATE_SIZE]; -- 2.39.2