diff options
author | t3sserakt <t3ss@posteo.de> | 2020-10-16 17:31:21 +0200 |
---|---|---|
committer | t3sserakt <t3ss@posteo.de> | 2020-10-16 17:40:12 +0200 |
commit | cde9403a6cc6bc03e571c872cdee205bbd838c31 (patch) | |
tree | 431929de91b2da817816370f9caf98b646d2745e /src/revocation/gnunet-revocation-tvg.c | |
parent | 4b69b0866d7f29efeb92176e518ddbb6a9052033 (diff) | |
parent | e8b0bc481b8a30c325faf55a964cac2cd151f999 (diff) | |
download | gnunet-cde9403a6cc6bc03e571c872cdee205bbd838c31.tar.gz gnunet-cde9403a6cc6bc03e571c872cdee205bbd838c31.zip |
Merge branch 'master' of ssh://gnunet.org/gnunet
Diffstat (limited to 'src/revocation/gnunet-revocation-tvg.c')
-rw-r--r-- | src/revocation/gnunet-revocation-tvg.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/revocation/gnunet-revocation-tvg.c b/src/revocation/gnunet-revocation-tvg.c index 29df1bb4d..1692472bb 100644 --- a/src/revocation/gnunet-revocation-tvg.c +++ b/src/revocation/gnunet-revocation-tvg.c | |||
@@ -65,25 +65,26 @@ run (void *cls, | |||
65 | const char *cfgfile, | 65 | const char *cfgfile, |
66 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 66 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
67 | { | 67 | { |
68 | struct GNUNET_CRYPTO_EcdsaPrivateKey id_priv; | 68 | struct GNUNET_IDENTITY_PrivateKey id_priv; |
69 | struct GNUNET_CRYPTO_EcdsaPublicKey id_pub; | 69 | struct GNUNET_IDENTITY_PublicKey id_pub; |
70 | struct GNUNET_REVOCATION_PowP pow; | 70 | struct GNUNET_REVOCATION_PowP *pow; |
71 | struct GNUNET_REVOCATION_PowCalculationHandle *ph; | 71 | struct GNUNET_REVOCATION_PowCalculationHandle *ph; |
72 | struct GNUNET_TIME_Relative exp; | 72 | struct GNUNET_TIME_Relative exp; |
73 | 73 | ||
74 | GNUNET_CRYPTO_ecdsa_key_create (&id_priv); | 74 | id_priv.type = htonl (GNUNET_IDENTITY_TYPE_ECDSA); |
75 | GNUNET_CRYPTO_ecdsa_key_get_public (&id_priv, | 75 | GNUNET_CRYPTO_ecdsa_key_create (&id_priv.ecdsa_key); |
76 | &id_pub); | 76 | GNUNET_IDENTITY_key_get_public (&id_priv, |
77 | &id_pub); | ||
77 | fprintf (stdout, "Zone private key (d, little-endian scalar):\n"); | 78 | fprintf (stdout, "Zone private key (d, little-endian scalar):\n"); |
78 | print_bytes (&id_priv, sizeof(id_priv), 0); | 79 | print_bytes (&id_priv, sizeof(id_priv), 0); |
79 | fprintf (stdout, "\n"); | 80 | fprintf (stdout, "\n"); |
80 | fprintf (stdout, "Zone public key (zk):\n"); | 81 | fprintf (stdout, "Zone public key (zk):\n"); |
81 | print_bytes (&id_pub, sizeof(id_pub), 0); | 82 | print_bytes (&id_pub, sizeof(id_pub), 0); |
82 | fprintf (stdout, "\n"); | 83 | fprintf (stdout, "\n"); |
83 | memset (&pow, 0, sizeof (pow)); | 84 | pow = GNUNET_malloc (GNUNET_REVOCATION_MAX_PROOF_SIZE); |
84 | GNUNET_REVOCATION_pow_init (&id_priv, | 85 | GNUNET_REVOCATION_pow_init (&id_priv, |
85 | &pow); | 86 | pow); |
86 | ph = GNUNET_REVOCATION_pow_start (&pow, | 87 | ph = GNUNET_REVOCATION_pow_start (pow, |
87 | TEST_EPOCHS, | 88 | TEST_EPOCHS, |
88 | TEST_DIFFICULTY); | 89 | TEST_DIFFICULTY); |
89 | fprintf (stdout, "Difficulty (%d base difficulty + %d epochs): %d\n\n", | 90 | fprintf (stdout, "Difficulty (%d base difficulty + %d epochs): %d\n\n", |
@@ -97,12 +98,12 @@ run (void *cls, | |||
97 | } | 98 | } |
98 | exp = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_YEARS, | 99 | exp = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_YEARS, |
99 | TEST_EPOCHS); | 100 | TEST_EPOCHS); |
100 | GNUNET_assert (GNUNET_OK == GNUNET_REVOCATION_check_pow (&pow, | 101 | GNUNET_assert (GNUNET_OK == GNUNET_REVOCATION_check_pow (pow, |
101 | TEST_DIFFICULTY, | 102 | TEST_DIFFICULTY, |
102 | exp)); | 103 | exp)); |
103 | fprintf (stdout, "Proof:\n"); | 104 | fprintf (stdout, "Proof:\n"); |
104 | print_bytes (&pow, | 105 | print_bytes (pow, |
105 | sizeof (pow), | 106 | GNUNET_REVOCATION_proof_get_size (pow), |
106 | 8); | 107 | 8); |
107 | } | 108 | } |
108 | 109 | ||