aboutsummaryrefslogtreecommitdiff
path: root/src/revocation/revocation_api.c
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2020-04-19 20:28:39 +0200
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2020-04-19 20:28:39 +0200
commit37bb51d9fc99c8d5dd99343adf0feb7e351e6394 (patch)
tree49cb37e19b0da01869bc9f50d97888d6aaab1ea5 /src/revocation/revocation_api.c
parent814b19c0b7621e7fb32446fa2996f838f56e45f8 (diff)
downloadgnunet-37bb51d9fc99c8d5dd99343adf0feb7e351e6394.tar.gz
gnunet-37bb51d9fc99c8d5dd99343adf0feb7e351e6394.zip
some comments
Diffstat (limited to 'src/revocation/revocation_api.c')
-rw-r--r--src/revocation/revocation_api.c39
1 files changed, 38 insertions, 1 deletions
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
50 void *func_cls; 50 void *func_cls;
51}; 51};
52 52
53
54/**
55 * Helper struct that holds a found pow nonce
56 * and the corresponding number of leading zeroes.
57 */
53struct BestPow 58struct BestPow
54{ 59{
60 /**
61 * PoW nonce
62 */
55 uint64_t pow; 63 uint64_t pow;
64
65 /**
66 * Corresponding zero bits in hash
67 */
56 unsigned int bits; 68 unsigned int bits;
57}; 69};
58 70
71
72/**
73 * The handle to a PoW calculation.
74 * Used in iterative PoW rounds.
75 */
59struct GNUNET_REVOCATION_PowCalculationHandle 76struct GNUNET_REVOCATION_PowCalculationHandle
60{ 77{
78 /**
79 * Current set of found PoWs
80 */
61 struct BestPow best[POW_COUNT]; 81 struct BestPow best[POW_COUNT];
82
83 /**
84 * The final PoW result data structure.
85 */
62 struct GNUNET_REVOCATION_Pow pow; 86 struct GNUNET_REVOCATION_Pow pow;
87
88 /**
89 * The current nonce to try
90 */
63 uint64_t current_pow; 91 uint64_t current_pow;
92
93 /**
94 * Epochs how long the PoW should be valid.
95 * This is added on top of the difficulty in the PoW.
96 */
64 unsigned int epochs; 97 unsigned int epochs;
98
99 /**
100 * The difficulty (leading zeros) to achieve.
101 */
65 unsigned int difficulty; 102 unsigned int difficulty;
66 int valid; 103
67}; 104};
68 105
69/** 106/**