aboutsummaryrefslogtreecommitdiff
path: root/src/util/gnunet-ecc.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-07-06 14:22:51 +0000
committerChristian Grothoff <christian@grothoff.org>2015-07-06 14:22:51 +0000
commit0f9e6bcd1e511abae16ecc4c86056b0c26d73936 (patch)
tree4ba3af76391ee6c67563316de29b6ad8830cd7f2 /src/util/gnunet-ecc.c
parentf1e619572751f7652db025f66f119d6a0308114b (diff)
downloadgnunet-0f9e6bcd1e511abae16ecc4c86056b0c26d73936.tar.gz
gnunet-0f9e6bcd1e511abae16ecc4c86056b0c26d73936.zip
-fix non-deterministic peerstore sync failure
Diffstat (limited to 'src/util/gnunet-ecc.c')
-rw-r--r--src/util/gnunet-ecc.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/util/gnunet-ecc.c b/src/util/gnunet-ecc.c
index 5585ae85c..081cd0525 100644
--- a/src/util/gnunet-ecc.c
+++ b/src/util/gnunet-ecc.c
@@ -28,6 +28,9 @@
28#include "gnunet_testing_lib.h" 28#include "gnunet_testing_lib.h"
29#include <gcrypt.h> 29#include <gcrypt.h>
30 30
31/**
32 * Number of characters a Base32-encoded public key requires.
33 */
31#define KEY_STR_LEN sizeof(struct GNUNET_CRYPTO_EddsaPublicKey)*8/5+1 34#define KEY_STR_LEN sizeof(struct GNUNET_CRYPTO_EddsaPublicKey)*8/5+1
32 35
33/** 36/**
@@ -69,9 +72,9 @@ create_keys (const char *fn, const char *prefix)
69 struct GNUNET_CRYPTO_EddsaPrivateKey *pk; 72 struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
70 struct GNUNET_CRYPTO_EddsaPublicKey target_pub; 73 struct GNUNET_CRYPTO_EddsaPublicKey target_pub;
71 static char vanity[KEY_STR_LEN + 1]; 74 static char vanity[KEY_STR_LEN + 1];
72 int len; 75 size_t len;
73 int n; 76 size_t n;
74 int rest; 77 size_t rest;
75 unsigned char mask; 78 unsigned char mask;
76 unsigned target_byte; 79 unsigned target_byte;
77 char *s; 80 char *s;
@@ -119,9 +122,9 @@ create_keys (const char *fn, const char *prefix)
119 s); 122 s);
120 GNUNET_free (s); 123 GNUNET_free (s);
121 fprintf (stderr, 124 fprintf (stderr,
122 "\nattempt %s [%d, %X]\n", 125 "\nattempt %s [%u, %X]\n",
123 vanity, 126 vanity,
124 n, 127 (unsigned int) n,
125 mask); 128 mask);
126 } 129 }
127 else 130 else