diff options
Diffstat (limited to 'src/revocation/gnunet-revocation-tvg.c')
-rw-r--r-- | src/revocation/gnunet-revocation-tvg.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/revocation/gnunet-revocation-tvg.c b/src/revocation/gnunet-revocation-tvg.c index b8f462b28..29df1bb4d 100644 --- a/src/revocation/gnunet-revocation-tvg.c +++ b/src/revocation/gnunet-revocation-tvg.c | |||
@@ -43,13 +43,14 @@ print_bytes (void *buf, | |||
43 | 43 | ||
44 | for (i = 0; i < buf_len; i++) | 44 | for (i = 0; i < buf_len; i++) |
45 | { | 45 | { |
46 | if ((0 != i) && (0 != fold) && (i%fold == 0)) | 46 | if ((0 != i) && (0 != fold) && (i % fold == 0)) |
47 | printf("\n"); | 47 | printf ("\n"); |
48 | printf("%02x", ((unsigned char*)buf)[i]); | 48 | printf ("%02x", ((unsigned char*) buf)[i]); |
49 | } | 49 | } |
50 | printf("\n"); | 50 | printf ("\n"); |
51 | } | 51 | } |
52 | 52 | ||
53 | |||
53 | /** | 54 | /** |
54 | * Main function that will be run. | 55 | * Main function that will be run. |
55 | * | 56 | * |
@@ -73,12 +74,12 @@ run (void *cls, | |||
73 | GNUNET_CRYPTO_ecdsa_key_create (&id_priv); | 74 | GNUNET_CRYPTO_ecdsa_key_create (&id_priv); |
74 | GNUNET_CRYPTO_ecdsa_key_get_public (&id_priv, | 75 | GNUNET_CRYPTO_ecdsa_key_get_public (&id_priv, |
75 | &id_pub); | 76 | &id_pub); |
76 | fprintf(stdout, "Zone private key (d, little-endian scalar):\n"); | 77 | fprintf (stdout, "Zone private key (d, little-endian scalar):\n"); |
77 | print_bytes (&id_priv, sizeof(id_priv), 0); | 78 | print_bytes (&id_priv, sizeof(id_priv), 0); |
78 | fprintf(stdout, "\n"); | 79 | fprintf (stdout, "\n"); |
79 | fprintf(stdout, "Zone public key (zk):\n"); | 80 | fprintf (stdout, "Zone public key (zk):\n"); |
80 | print_bytes (&id_pub, sizeof(id_pub), 0); | 81 | print_bytes (&id_pub, sizeof(id_pub), 0); |
81 | fprintf(stdout, "\n"); | 82 | fprintf (stdout, "\n"); |
82 | memset (&pow, 0, sizeof (pow)); | 83 | memset (&pow, 0, sizeof (pow)); |
83 | GNUNET_REVOCATION_pow_init (&id_priv, | 84 | GNUNET_REVOCATION_pow_init (&id_priv, |
84 | &pow); | 85 | &pow); |
@@ -99,7 +100,7 @@ run (void *cls, | |||
99 | GNUNET_assert (GNUNET_OK == GNUNET_REVOCATION_check_pow (&pow, | 100 | GNUNET_assert (GNUNET_OK == GNUNET_REVOCATION_check_pow (&pow, |
100 | TEST_DIFFICULTY, | 101 | TEST_DIFFICULTY, |
101 | exp)); | 102 | exp)); |
102 | fprintf(stdout, "Proof:\n"); | 103 | fprintf (stdout, "Proof:\n"); |
103 | print_bytes (&pow, | 104 | print_bytes (&pow, |
104 | sizeof (pow), | 105 | sizeof (pow), |
105 | 8); | 106 | 8); |