aboutsummaryrefslogtreecommitdiff
path: root/src/revocation/gnunet-revocation-tvg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/revocation/gnunet-revocation-tvg.c')
-rw-r--r--src/revocation/gnunet-revocation-tvg.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/revocation/gnunet-revocation-tvg.c b/src/revocation/gnunet-revocation-tvg.c
index 805b7c39c..2b850e436 100644
--- a/src/revocation/gnunet-revocation-tvg.c
+++ b/src/revocation/gnunet-revocation-tvg.c
@@ -52,6 +52,7 @@ run (void *cls,
52 struct GNUNET_CRYPTO_EcdsaPublicKey id_pub; 52 struct GNUNET_CRYPTO_EcdsaPublicKey id_pub;
53 struct GNUNET_REVOCATION_PowP pow; 53 struct GNUNET_REVOCATION_PowP pow;
54 struct GNUNET_REVOCATION_PowCalculationHandle *ph; 54 struct GNUNET_REVOCATION_PowCalculationHandle *ph;
55 struct GNUNET_TIME_Relative exp;
55 char* data_enc; 56 char* data_enc;
56 57
57 GNUNET_CRYPTO_ecdsa_key_create (&id_priv); 58 GNUNET_CRYPTO_ecdsa_key_create (&id_priv);
@@ -67,7 +68,7 @@ run (void *cls,
67 &data_enc); 68 &data_enc);
68 fprintf(stdout, "Zone public key (zk):\n%s\n\n", data_enc); 69 fprintf(stdout, "Zone public key (zk):\n%s\n\n", data_enc);
69 GNUNET_free (data_enc); 70 GNUNET_free (data_enc);
70 71 memset (&pow, 0, sizeof (pow));
71 GNUNET_REVOCATION_pow_init (&id_priv, 72 GNUNET_REVOCATION_pow_init (&id_priv,
72 &pow); 73 &pow);
73 ph = GNUNET_REVOCATION_pow_start (&pow, 74 ph = GNUNET_REVOCATION_pow_start (&pow,
@@ -82,6 +83,11 @@ run (void *cls,
82 { 83 {
83 pow_passes++; 84 pow_passes++;
84 } 85 }
86 exp = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_YEARS,
87 TEST_EPOCHS);
88 GNUNET_assert (GNUNET_OK == GNUNET_REVOCATION_check_pow (&pow,
89 TEST_DIFFICULTY,
90 exp));
85 GNUNET_STRINGS_base64_encode (&pow, 91 GNUNET_STRINGS_base64_encode (&pow,
86 sizeof (struct GNUNET_REVOCATION_PowP), 92 sizeof (struct GNUNET_REVOCATION_PowP),
87 &data_enc); 93 &data_enc);