gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated (19cd0e6d0 -> 3be8295f2)


From: gnunet
Subject: [gnunet] branch master updated (19cd0e6d0 -> 3be8295f2)
Date: Mon, 25 May 2020 22:24:20 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a change to branch master
in repository gnunet.

    from 19cd0e6d0 add some more debug output
     new 19e3bd32a fix bit check in hash
     new 3be8295f2 actually add ttl

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/revocation/revocation_api.c | 9 +++++++++
 src/util/crypto_hash.c          | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/revocation/revocation_api.c b/src/revocation/revocation_api.c
index 3789e6799..24e9766ad 100644
--- a/src/revocation/revocation_api.c
+++ b/src/revocation/revocation_api.c
@@ -492,6 +492,10 @@ GNUNET_REVOCATION_check_pow (const struct 
GNUNET_REVOCATION_PowP *pow,
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Score %u with %" PRIu64 " (#%u)\n",
                 tmp_score, pow_val, i);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "First byte: %x\n",
+                ((char*)&result)[0] & 0xff);
+
 
     GNUNET_CRYPTO_hash_to_enc (&result,
                                &h_str);
@@ -583,9 +587,14 @@ GNUNET_REVOCATION_pow_start (struct GNUNET_REVOCATION_PowP 
*pow,
                              unsigned int difficulty)
 {
   struct GNUNET_REVOCATION_PowCalculationHandle *pc;
+  struct GNUNET_TIME_Relative ttl;
+
 
   pc = GNUNET_new (struct GNUNET_REVOCATION_PowCalculationHandle);
   pc->pow = pow;
+  ttl = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_YEARS,
+                                       epochs);
+  pc->pow->ttl = GNUNET_TIME_relative_hton (ttl);
   pc->current_pow = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
                                               UINT64_MAX);
   pc->difficulty = difficulty;
diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c
index c41c419ff..4982ba404 100644
--- a/src/util/crypto_hash.c
+++ b/src/util/crypto_hash.c
@@ -252,7 +252,7 @@ GNUNET_CRYPTO_hash_get_bit (const struct GNUNET_HashCode 
*code, unsigned int
                             bit)
 {
   GNUNET_assert (bit < 8 * sizeof(struct GNUNET_HashCode));
-  return (((unsigned char *) code)[bit >> 3] & (1 << (bit & 7))) > 0;
+  return (((unsigned char *) code)[bit >> 3] & (128 >> (bit & 7))) > 0;
 }
 
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]