From 37bb51d9fc99c8d5dd99343adf0feb7e351e6394 Mon Sep 17 00:00:00 2001 From: "Schanzenbach, Martin" Date: Sun, 19 Apr 2020 20:28:39 +0200 Subject: [PATCH] some comments --- src/revocation/revocation_api.c | 39 ++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/src/revocation/revocation_api.c b/src/revocation/revocation_api.c index c817e612a..bd0202b67 100644 --- a/src/revocation/revocation_api.c +++ b/src/revocation/revocation_api.c @@ -50,20 +50,57 @@ struct GNUNET_REVOCATION_Query void *func_cls; }; + +/** + * Helper struct that holds a found pow nonce + * and the corresponding number of leading zeroes. + */ struct BestPow { + /** + * PoW nonce + */ uint64_t pow; + + /** + * Corresponding zero bits in hash + */ unsigned int bits; }; + +/** + * The handle to a PoW calculation. + * Used in iterative PoW rounds. + */ struct GNUNET_REVOCATION_PowCalculationHandle { + /** + * Current set of found PoWs + */ struct BestPow best[POW_COUNT]; + + /** + * The final PoW result data structure. + */ struct GNUNET_REVOCATION_Pow pow; + + /** + * The current nonce to try + */ uint64_t current_pow; + + /** + * Epochs how long the PoW should be valid. + * This is added on top of the difficulty in the PoW. + */ unsigned int epochs; + + /** + * The difficulty (leading zeros) to achieve. + */ unsigned int difficulty; - int valid; + }; /** -- 2.25.1