struct GNUNET_CRYPTO_EcdsaPublicKey id_pub;
struct GNUNET_REVOCATION_PowP pow;
struct GNUNET_REVOCATION_PowCalculationHandle *ph;
+ struct GNUNET_TIME_Relative exp;
char* data_enc;
GNUNET_CRYPTO_ecdsa_key_create (&id_priv);
&data_enc);
fprintf(stdout, "Zone public key (zk):\n%s\n\n", data_enc);
GNUNET_free (data_enc);
-
+ memset (&pow, 0, sizeof (pow));
GNUNET_REVOCATION_pow_init (&id_priv,
&pow);
ph = GNUNET_REVOCATION_pow_start (&pow,
{
pow_passes++;
}
+ exp = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_YEARS,
+ TEST_EPOCHS);
+ GNUNET_assert (GNUNET_OK == GNUNET_REVOCATION_check_pow (&pow,
+ TEST_DIFFICULTY,
+ exp));
GNUNET_STRINGS_base64_encode (&pow,
sizeof (struct GNUNET_REVOCATION_PowP),
&data_enc);
count_leading_zeroes (const struct GNUNET_HashCode *hash)
{
unsigned int hash_count;
-
hash_count = 0;
while ((0 == GNUNET_CRYPTO_hash_get_bit (hash, hash_count)))
hash_count++;
+ sizeof (struct GNUNET_TIME_AbsoluteNBO)
+ sizeof (uint64_t)] GNUNET_ALIGN;
struct GNUNET_REVOCATION_SignaturePurposePS spurp;
+ struct GNUNET_CRYPTO_HashAsciiEncoded h_str;
struct GNUNET_HashCode result;
struct GNUNET_TIME_Absolute ts;
struct GNUNET_TIME_Absolute exp;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Score %u with %" PRIu64 " (#%u)\n",
tmp_score, pow_val, i);
+
+ GNUNET_CRYPTO_hash_to_enc (&result,
+ &h_str);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Hash: %s\n", (char*)&h_str);
+
score += tmp_score;
}