aboutsummaryrefslogtreecommitdiff
path: root/src/revocation
diff options
context:
space:
mode:
Diffstat (limited to 'src/revocation')
-rw-r--r--src/revocation/revocation_api.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/revocation/revocation_api.c b/src/revocation/revocation_api.c
index 3789e6799..33c67d005 100644
--- a/src/revocation/revocation_api.c
+++ b/src/revocation/revocation_api.c
@@ -395,7 +395,7 @@ count_leading_zeroes (const struct GNUNET_HashCode *hash)
395{ 395{
396 unsigned int hash_count; 396 unsigned int hash_count;
397 hash_count = 0; 397 hash_count = 0;
398 while ((0 == GNUNET_CRYPTO_hash_get_bit (hash, hash_count))) 398 while ((0 == GNUNET_CRYPTO_hash_get_bit_ltr (hash, hash_count)))
399 hash_count++; 399 hash_count++;
400 return hash_count; 400 return hash_count;
401} 401}
@@ -435,7 +435,6 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_PowP *pow,
435 + sizeof (struct GNUNET_TIME_AbsoluteNBO) 435 + sizeof (struct GNUNET_TIME_AbsoluteNBO)
436 + sizeof (uint64_t)] GNUNET_ALIGN; 436 + sizeof (uint64_t)] GNUNET_ALIGN;
437 struct GNUNET_REVOCATION_SignaturePurposePS spurp; 437 struct GNUNET_REVOCATION_SignaturePurposePS spurp;
438 struct GNUNET_CRYPTO_HashAsciiEncoded h_str;
439 struct GNUNET_HashCode result; 438 struct GNUNET_HashCode result;
440 struct GNUNET_TIME_Absolute ts; 439 struct GNUNET_TIME_Absolute ts;
441 struct GNUNET_TIME_Absolute exp; 440 struct GNUNET_TIME_Absolute exp;
@@ -493,11 +492,6 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_PowP *pow,
493 "Score %u with %" PRIu64 " (#%u)\n", 492 "Score %u with %" PRIu64 " (#%u)\n",
494 tmp_score, pow_val, i); 493 tmp_score, pow_val, i);
495 494
496 GNUNET_CRYPTO_hash_to_enc (&result,
497 &h_str);
498 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
499 "Hash: %s\n", (char*)&h_str);
500
501 score += tmp_score; 495 score += tmp_score;
502 496
503 } 497 }
@@ -583,9 +577,14 @@ GNUNET_REVOCATION_pow_start (struct GNUNET_REVOCATION_PowP *pow,
583 unsigned int difficulty) 577 unsigned int difficulty)
584{ 578{
585 struct GNUNET_REVOCATION_PowCalculationHandle *pc; 579 struct GNUNET_REVOCATION_PowCalculationHandle *pc;
580 struct GNUNET_TIME_Relative ttl;
581
586 582
587 pc = GNUNET_new (struct GNUNET_REVOCATION_PowCalculationHandle); 583 pc = GNUNET_new (struct GNUNET_REVOCATION_PowCalculationHandle);
588 pc->pow = pow; 584 pc->pow = pow;
585 ttl = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_YEARS,
586 epochs);
587 pc->pow->ttl = GNUNET_TIME_relative_hton (ttl);
589 pc->current_pow = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, 588 pc->current_pow = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
590 UINT64_MAX); 589 UINT64_MAX);
591 pc->difficulty = difficulty; 590 pc->difficulty = difficulty;