FIX: Some <= fix for pwpivi 's hardnested suggested on the Pm3 forum.

This commit is contained in:
iceman1001 2016-01-13 21:51:47 +01:00
commit 4b2e63be17

View file

@ -287,8 +287,6 @@ static float sum_probability(uint16_t K, uint16_t n, uint16_t k)
{ {
const uint16_t N = 256; const uint16_t N = 256;
if (k > K || p_K[K] == 0.0) return 0.0; if (k > K || p_K[K] == 0.0) return 0.0;
double p_T_is_k_when_S_is_K = p_hypergeometric(N, K, n, k); double p_T_is_k_when_S_is_K = p_hypergeometric(N, K, n, k);
@ -514,7 +512,7 @@ static void sort_best_first_bytes(void)
// determine how many are above the CONFIDENCE_THRESHOLD // determine how many are above the CONFIDENCE_THRESHOLD
uint16_t num_good_nonces = 0; uint16_t num_good_nonces = 0;
for (uint16_t i = 0; i < 256; i++) { for (uint16_t i = 0; i < 256; i++) {
if (nonces[best_first_bytes[i]].Sum8_prob > CONFIDENCE_THRESHOLD) { if (nonces[best_first_bytes[i]].Sum8_prob >= CONFIDENCE_THRESHOLD) {
++num_good_nonces; ++num_good_nonces;
} }
} }
@ -603,7 +601,7 @@ static uint16_t estimate_second_byte_sum(void)
uint16_t num_good_nonces = 0; uint16_t num_good_nonces = 0;
for (uint16_t i = 0; i < 256; i++) { for (uint16_t i = 0; i < 256; i++) {
if (nonces[best_first_bytes[i]].Sum8_prob > CONFIDENCE_THRESHOLD) { if (nonces[best_first_bytes[i]].Sum8_prob >= CONFIDENCE_THRESHOLD) {
++num_good_nonces; ++num_good_nonces;
} }
} }