/**
* Epoch length
*/
-static struct GNUNET_TIME_Relative epoch_length;
+static struct GNUNET_TIME_Relative epoch_duration;
/**
* Task used for proof-of-work calculation.
if (GNUNET_YES ==
GNUNET_REVOCATION_check_pow (&proof_of_work,
(unsigned int) matching_bits,
- epoch_length))
+ epoch_duration))
{
fprintf (stderr, "%s", _ ("Revocation certificate ready\n"));
if (perform)
}
if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_time (cfg,
"REVOCATION",
- "EPOCH_LENGTH",
- &epoch_length))
+ "EPOCH_DURATION",
+ &epoch_duration))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
"REVOCATION",
- "EPOCH_LENGTH");
+ "EPOCH_DURATION");
return;
}
if (GNUNET_YES !=
GNUNET_REVOCATION_check_pow (&proof_of_work,
(unsigned int) matching_bits,
- epoch_length))
+ epoch_duration))
{
struct GNUNET_REVOCATION_PowCalculationHandle *ph;
ph = GNUNET_REVOCATION_pow_start (&proof_of_work,
/**
* Length of an expiration expoch
*/
-static struct GNUNET_TIME_Relative epoch_length;
+static struct GNUNET_TIME_Relative epoch_duration;
/**
* Our application ID for set union operations. Must be the
{
if (GNUNET_YES != GNUNET_REVOCATION_check_pow (&rm->proof_of_work,
(unsigned int) revocation_work_required,
- epoch_length))
+ epoch_duration))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Proof of work invalid!\n");
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_time (cfg,
"REVOCATION",
- "EPOCH_LENGTH",
- &epoch_length))
+ "EPOCH_DURATION",
+ &epoch_duration))
{
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
"REVOCATION",
- "EPOCH_LENGTH");
+ "EPOCH_DURATION");
GNUNET_SCHEDULER_shutdown ();
GNUNET_free (fn);
return;
struct InternalContext
{
unsigned int matching_bits;
- struct GNUNET_TIME_Relative epoch_length;
+ struct GNUNET_TIME_Relative epoch_duration;
};
if (0 >=
GNUNET_REVOCATION_check_pow (&rm->proof_of_work,
ic->matching_bits,
- ic->epoch_length))
+ ic->epoch_duration))
{
GNUNET_break_op (0);
return GNUNET_BLOCK_EVALUATION_RESULT_INVALID;
struct GNUNET_BLOCK_PluginFunctions *api;
struct InternalContext *ic;
unsigned long long matching_bits;
- struct GNUNET_TIME_Relative epoch_length;
+ struct GNUNET_TIME_Relative epoch_duration;
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_number (cfg,
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_time (cfg,
"REVOCATION",
- "EPOCH_LENGTH",
- &epoch_length))
+ "EPOCH_DURATION",
+ &epoch_duration))
return NULL;
api = GNUNET_new (struct GNUNET_BLOCK_PluginFunctions);
api->types = types;
ic = GNUNET_new (struct InternalContext);
ic->matching_bits = (unsigned int) matching_bits;
- ic->epoch_length = epoch_length;
+ ic->epoch_duration = epoch_duration;
api->cls = ic;
return api;
}
GNUNET_MQ_handler_end ()
};
unsigned long long matching_bits;
- struct GNUNET_TIME_Relative epoch_length;
+ struct GNUNET_TIME_Relative epoch_duration;
struct RevokeMessage *rm;
struct GNUNET_MQ_Envelope *env;
if ((GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_time (cfg,
"REVOCATION",
- "EPOCH_LENGTH",
- &epoch_length)))
+ "EPOCH_DURATION",
+ &epoch_duration)))
{
GNUNET_break (0);
GNUNET_free (h);
}
if (GNUNET_YES != GNUNET_REVOCATION_check_pow (pow,
(unsigned int) matching_bits,
- epoch_length))
+ epoch_duration))
{
GNUNET_break (0);
GNUNET_free (h);
enum GNUNET_GenericReturnValue
GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_Pow *pow,
unsigned int difficulty,
- struct GNUNET_TIME_Relative epoch_length)
+ struct GNUNET_TIME_Relative epoch_duration)
{
char buf[sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey)
+ sizeof (struct GNUNET_TIME_AbsoluteNBO)
&pow->signature,
&pow->key))
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Proof of work signature invalid!\n");
return GNUNET_NO;
}
* Check expiration
*/
ts = GNUNET_TIME_absolute_ntoh (pow->timestamp);
- ttl = GNUNET_TIME_relative_multiply (epoch_length,
+ ttl = GNUNET_TIME_relative_multiply (epoch_duration,
epochs);
/**
* Extend by 10% for unsynchronized clocks
*/
- buffer = GNUNET_TIME_relative_divide (epoch_length,
+ buffer = GNUNET_TIME_relative_divide (epoch_duration,
10);
exp = GNUNET_TIME_absolute_add (ts, ttl);
exp = GNUNET_TIME_absolute_add (exp,
}
}
+struct GNUNET_REVOCATION_Pow proof_of_work;
+
static void
ego_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego)
{
static int completed = 0;
const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
- struct GNUNET_REVOCATION_Pow proof_of_work;
-
if ((NULL != ego) && (cls == &testpeers[0]))
{
[revocation]
WORKBITS = 3
IMMEDIATE_START = YES
-EPOCH_LENGTH = 365 d
+EPOCH_DURATION = 365 d
[identity]
# Directory where we store information about our egos