diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2022-01-31 16:53:49 +0100 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2022-01-31 16:53:49 +0100 |
commit | 8b456153847db2e4cf51c4f924021af40bbbe68b (patch) | |
tree | 83be9205489e5b5567a349cdf772dd8a5af42ab2 | |
parent | 5714237a181997af7ad432e3f4f46e28b7ab3610 (diff) | |
download | gnunet-8b456153847db2e4cf51c4f924021af40bbbe68b.tar.gz gnunet-8b456153847db2e4cf51c4f924021af40bbbe68b.zip |
-update revocation test vector
-rw-r--r-- | src/revocation/gnunet-revocation-tvg.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/revocation/gnunet-revocation-tvg.c b/src/revocation/gnunet-revocation-tvg.c index cb5e31fcd..71d74ea5e 100644 --- a/src/revocation/gnunet-revocation-tvg.c +++ b/src/revocation/gnunet-revocation-tvg.c | |||
@@ -35,9 +35,10 @@ | |||
35 | #define TEST_DIFFICULTY 5 | 35 | #define TEST_DIFFICULTY 5 |
36 | 36 | ||
37 | static void | 37 | static void |
38 | print_bytes (void *buf, | 38 | print_bytes_ (void *buf, |
39 | size_t buf_len, | 39 | size_t buf_len, |
40 | int fold) | 40 | int fold, |
41 | int in_be) | ||
41 | { | 42 | { |
42 | int i; | 43 | int i; |
43 | 44 | ||
@@ -45,11 +46,23 @@ print_bytes (void *buf, | |||
45 | { | 46 | { |
46 | if ((0 != i) && (0 != fold) && (i % fold == 0)) | 47 | if ((0 != i) && (0 != fold) && (i % fold == 0)) |
47 | printf ("\n"); | 48 | printf ("\n"); |
48 | printf ("%02x", ((unsigned char*) buf)[i]); | 49 | if (in_be) |
50 | printf ("%02x", ((unsigned char*) buf)[buf_len - 1 - i]); | ||
51 | else | ||
52 | printf ("%02x", ((unsigned char*) buf)[i]); | ||
49 | } | 53 | } |
50 | printf ("\n"); | 54 | printf ("\n"); |
51 | } | 55 | } |
52 | 56 | ||
57 | static void | ||
58 | print_bytes (void *buf, | ||
59 | size_t buf_len, | ||
60 | int fold) | ||
61 | { | ||
62 | print_bytes_ (buf, buf_len, fold, 0); | ||
63 | } | ||
64 | |||
65 | |||
53 | 66 | ||
54 | /** | 67 | /** |
55 | * Main function that will be run. | 68 | * Main function that will be run. |
@@ -80,8 +93,8 @@ run (void *cls, | |||
80 | GNUNET_IDENTITY_key_get_length (&id_pub), | 93 | GNUNET_IDENTITY_key_get_length (&id_pub), |
81 | ztld, | 94 | ztld, |
82 | sizeof (ztld)); | 95 | sizeof (ztld)); |
83 | fprintf (stdout, "Zone private key (d, little-endian scalar, with ztype prepended):\n"); | 96 | fprintf (stdout, "Zone private key (d, big-endian scalar, with ztype prepended):\n"); |
84 | print_bytes (&id_priv, sizeof(id_priv), 8); | 97 | print_bytes_ (&id_priv.ecdsa_key, sizeof(id_priv.ecdsa_key), 8, 1); |
85 | fprintf (stdout, "\n"); | 98 | fprintf (stdout, "\n"); |
86 | fprintf (stdout, "Zone identifier (zid):\n"); | 99 | fprintf (stdout, "Zone identifier (zid):\n"); |
87 | print_bytes (&id_pub, GNUNET_IDENTITY_key_get_length (&id_pub), 8); | 100 | print_bytes (&id_pub, GNUNET_IDENTITY_key_get_length (&id_pub), 8); |