From 0a9c2aa9dba799b84294e6aa4e7b79a5304f5ede Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Sat, 4 Jun 2022 22:59:48 +0200 Subject: -modify revocation logic to fix lsd0001 --- src/revocation/revocation_api.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/revocation/revocation_api.c') diff --git a/src/revocation/revocation_api.c b/src/revocation/revocation_api.c index 9080ab862..b8c458e4f 100644 --- a/src/revocation/revocation_api.c +++ b/src/revocation/revocation_api.c @@ -460,7 +460,7 @@ check_signature (const struct GNUNET_REVOCATION_PowP *pow) * Check if the given proof-of-work is valid. * * @param pow proof of work - * @param matching_bits how many bits must match (configuration) + * @param difficulty how many bits must match (configuration) LSD0001: D * @param epoch_duration length of single epoch in configuration * @return #GNUNET_YES if the @a pow is acceptable, #GNUNET_NO if not */ @@ -477,6 +477,7 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_PowP *pow, struct GNUNET_TIME_Absolute exp; struct GNUNET_TIME_Relative ttl; struct GNUNET_TIME_Relative buffer; + /* LSD0001: D' */ unsigned int score = 0; unsigned int tmp_score = 0; unsigned int epochs; @@ -535,7 +536,8 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_PowP *pow, score = score / POW_COUNT; if (score < difficulty) return GNUNET_NO; - epochs = score - difficulty; + /* LSD0001: (D'-D+1) */ + epochs = score - difficulty + 1; /** * Check expiration -- cgit v1.2.3