The order of counting tested states does not really matter

This commit is contained in:
Aram
2017-03-30 00:13:01 +02:00
parent 738e324d7e
commit 90a93f616f

View File

@ -136,11 +136,11 @@ inline uint64_t crack_states_bitsliced(uint32_t **task){
#ifdef EXACT_COUNT #ifdef EXACT_COUNT
bucket_states_tested += bucket_size[block_idx]; bucket_states_tested += bucket_size[block_idx];
#ifdef ONLINE_COUNT #ifdef ONLINE_COUNT
__atomic_fetch_add(&total_states_tested, bucket_size[block_idx], __ATOMIC_SEQ_CST); __atomic_fetch_add(&total_states_tested, bucket_size[block_idx], __ATOMIC_RELAXED);
#endif #endif
#else #else
#ifdef ONLINE_COUNT #ifdef ONLINE_COUNT
__atomic_fetch_add(&total_states_tested, MAX_BITSLICES, __ATOMIC_SEQ_CST); __atomic_fetch_add(&total_states_tested, MAX_BITSLICES, __ATOMIC_RELAXED);
#endif #endif
#endif #endif
// pre-compute first keystream and feedback bit vectors // pre-compute first keystream and feedback bit vectors
@ -221,7 +221,7 @@ inline uint64_t crack_states_bitsliced(uint32_t **task){
for(size_t results_idx = 0; results_idx < MAX_BITSLICES; ++results_idx){ for(size_t results_idx = 0; results_idx < MAX_BITSLICES; ++results_idx){
if(get_vector_bit(results_idx, results)){ if(get_vector_bit(results_idx, results)){
key = keys[results_idx].value; key = keys[results_idx].value;
__atomic_fetch_add(&keys_found, 1, __ATOMIC_SEQ_CST); __atomic_fetch_add(&keys_found, 1, __ATOMIC_RELAXED);
goto out; goto out;
} }
} }
@ -236,7 +236,7 @@ out:
free(bitsliced_even_states[block_idx]-ROLLBACK_SIZE); free(bitsliced_even_states[block_idx]-ROLLBACK_SIZE);
} }
#ifndef ONLINE_COUNT #ifndef ONLINE_COUNT
__atomic_fetch_add(&total_states_tested, bucket_states_tested, __ATOMIC_SEQ_CST); __atomic_fetch_add(&total_states_tested, bucket_states_tested, __ATOMIC_RELAXED);
#endif #endif
return key; return key;
} }