GNUnet 0.28.0-dev.2-5-gff43856e1
 
Loading...
Searching...
No Matches
gnunet-gnsrecord-tvg.c
Go to the documentation of this file.
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2020 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 SPDX-License-Identifier: AGPL3.0-or-later
19 */
20
26#include "platform.h"
27#include "gnunet_util_lib.h"
29#include "gnsrecord_crypto.h"
30#include <inttypes.h>
31
32#pragma GCC diagnostic push
33#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
34
35static const char *d_pkey =
36 "50d7b652a4efeadff37396909785e5952171a02178c8e7d450fa907925fafd98";
37
38static const char *d_edkey =
39 "5af7020ee19160328832352bbc6a68a8d71a7cbe1b929969a7c66d415a0d8f65";
40
41
42static int
43parsehex (const char *src, char *dst, size_t dstlen, int invert)
44{
45 const char *line = src;
46 const char *data = line;
47 int off;
48 int read_byte;
49 int data_len = 0;
50
51 while (sscanf (data, " %02x%n", &read_byte, &off) == 1)
52 {
53 if (invert)
54 dst[dstlen - 1 - data_len++] = read_byte;
55 else
56 dst[data_len++] = read_byte;
57 data += off;
58 }
59 return data_len;
60}
61
62
63static void
64print_bytes_ (void *buf,
65 size_t buf_len,
66 int fold,
67 int in_be)
68{
69 int i;
70
71 for (i = 0; i < buf_len; i++)
72 {
73 if (0 != i)
74 {
75 if ((0 != fold) && (i % fold == 0))
76 printf ("\n ");
77 else
78 printf (" ");
79 }
80 else
81 {
82 printf (" ");
83 }
84 if (in_be)
85 printf ("%02x", ((unsigned char*) buf)[buf_len - 1 - i]);
86 else
87 printf ("%02x", ((unsigned char*) buf)[i]);
88 }
89 printf ("\n");
90}
91
92
93static void
94print_bytes (void *buf,
95 size_t buf_len,
96 int fold)
97{
98 print_bytes_ (buf, buf_len, fold, 0);
99}
100
101
102static void
104{
105 struct GNUNET_TIME_Relative rt;
106 struct GNUNET_TIME_Absolute at;
107 uint16_t flags = htons (rd->flags);
108 uint64_t abs_nbo = GNUNET_htonll (rd->expiration_time);
109 uint16_t size_nbo = htons (rd->data_size);
110 uint32_t type_nbo = htonl (rd->record_type);
111 at.abs_value_us = GNUNET_ntohll (abs_nbo);
113 {
116 abs_nbo = GNUNET_htonll (at.abs_value_us);
117 }
118 printf (" EXPIRATION: %" PRIu64 " us\n", rd->expiration_time);
119 print_bytes (&abs_nbo, sizeof (abs_nbo), 8);
120 printf ("\n DATA_SIZE:\n");
121 print_bytes (&size_nbo, sizeof (size_nbo), 8);
122 printf ("\n TYPE:\n");
123 print_bytes (&type_nbo, sizeof (type_nbo), 8);
124 printf ("\n FLAGS: ");
125 print_bytes ((void*) &flags, sizeof (flags), 8);
126 printf ("\n");
127 fprintf (stdout,
128 " DATA:\n");
129 print_bytes ((char*) rd->data, rd->data_size, 8);
130 printf ("\n");
131}
132
133
142static void
143run_pkey (struct GNUNET_GNSRECORD_Data *rd, int rd_count, const char *label)
144{
146 struct GNUNET_GNSRECORD_Block *rrblock;
147 char *bdata;
150 struct GNUNET_CRYPTO_BlindablePrivateKey pkey_data_p;
151 struct GNUNET_CRYPTO_BlindablePublicKey pkey_data;
153 struct GNUNET_HashCode query;
154 char *rdata;
155 char *conv_lbl;
156 size_t rdata_size;
157 char ztld[128];
158 unsigned char ctr[GNUNET_CRYPTO_AES_KEY_LENGTH / 2];
159 unsigned char skey[GNUNET_CRYPTO_AES_KEY_LENGTH];
160
161 id_priv.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY);
164 (char*) &id_priv.ecdsa_key,
165 sizeof (id_priv.ecdsa_key), 1);
166
169 &id_pub);
170 printf ("Zone private key (d, big-endian):\n");
171 print_bytes_ (&id_priv.ecdsa_key,
172 sizeof (struct GNUNET_CRYPTO_EcdsaPrivateKey), 8, 1);
173 printf ("\n");
174 printf ("Zone identifier (ztype|zkey):\n");
179 &id_pub),
180 ztld,
181 sizeof (ztld));
182 printf ("\n");
183 printf ("zTLD:\n");
184 printf ("%s\n", ztld);
185 printf ("\n");
186
187 pkey_data_p.type = htonl (GNUNET_GNSRECORD_TYPE_PKEY);
190 &pkey_data);
191 conv_lbl = GNUNET_GNSRECORD_string_normalize (label);
192 printf ("Label:\n");
193 print_bytes (conv_lbl, strlen (conv_lbl), 8);
194 GNUNET_free (conv_lbl);
195 printf ("\nNumber of records (integer): %d\n\n", rd_count);
196
197 for (int i = 0; i < rd_count; i++)
198 {
199 printf ("Record #%d := (\n", i);
200 print_record (&rd[i]);
201 printf (")\n\n");
202 }
203
205 rd);
206 rdata = GNUNET_malloc (rdata_size);
208 rd,
209 (size_t) rdata_size,
210 rdata);
211 printf ("RDATA:\n");
212 print_bytes (rdata,
213 (size_t) rdata_size,
214 8);
215 printf ("\n");
219 skey,
220 label,
222 expire).abs_value_us__,
223 &id_pub.ecdsa_key);
224
225 printf ("Encryption NONCE|EXPIRATION|BLOCK COUNTER:\n");
226 print_bytes (ctr, sizeof (ctr), 8);
227 printf ("\n");
228 printf ("Encryption key (K):\n");
229 print_bytes (skey, sizeof (skey), 8);
230 printf ("\n");
232 label,
233 &query);
234 printf ("Storage key (q):\n");
235 print_bytes (&query, sizeof (query), 8);
236 printf ("\n");
237 GNUNET_assert (GNUNET_OK == ec->seal (ec->cls,
238 label,
239 expire,
240 (unsigned char*) rdata,
241 rdata_size,
242 &rrblock));
243 {
244 struct GNUNET_CRYPTO_EcdsaPublicKey derived_key;
245 struct GNUNET_CRYPTO_EcdsaPrivateKey *derived_privkey;
246 size_t bdata_size;
247
249 label,
250 "gns",
251 &derived_key);
252 derived_privkey = GNUNET_CRYPTO_ecdsa_private_key_derive (&id_priv.ecdsa_key
253 ,
254 label,
255 "gns");
256 printf ("ZKDF(zkey):\n");
257 print_bytes (&derived_key, sizeof (derived_key), 8);
258 printf ("\n");
259 printf ("Derived private key (d', big-endian):\n");
260 print_bytes_ (derived_privkey, sizeof (*derived_privkey), 8, 1);
261 printf ("\n");
262 bdata_size = ntohl (rrblock->size) - sizeof (struct
264
265 GNUNET_free (derived_privkey);
266
267 bdata = (char*) &(&rrblock->ecdsa_block)[1];
268 printf ("BDATA:\n");
269 print_bytes (bdata, bdata_size, 8);
270 printf ("\n");
271 printf ("RRBLOCK:\n");
272 print_bytes (rrblock, ntohl (rrblock->size), 8);
273 printf ("\n");
274 GNUNET_free (rdata);
275 }
277}
278
279
288static void
289run_edkey (struct GNUNET_GNSRECORD_Data *rd, int rd_count, const char*label)
290{
292 struct GNUNET_GNSRECORD_Block *rrblock;
293 char *bdata;
296 struct GNUNET_CRYPTO_BlindablePrivateKey pkey_data_p;
297 struct GNUNET_CRYPTO_BlindablePublicKey pkey_data;
299 struct GNUNET_HashCode query;
300 char *rdata;
301 char *conv_lbl;
302 size_t rdata_size;
303
304 char ztld[128];
307
309 (char*) &id_priv.eddsa_key,
310 sizeof (id_priv.eddsa_key), 0);
311 id_priv.type = htonl (GNUNET_PUBLIC_KEY_TYPE_EDDSA);
314 &id_pub);
315 fprintf (stdout,
316 "Zone private key (d):\n");
317 print_bytes (&id_priv.eddsa_key, sizeof (struct
319 printf ("\n");
320 printf ("Zone identifier (ztype|zkey):\n");
325 &id_pub),
326 ztld,
327 sizeof (ztld));
328 printf ("\n");
329 printf ("zTLD:\n");
330 printf ("%s\n", ztld);
331 printf ("\n");
332
333 pkey_data_p.type = htonl (GNUNET_GNSRECORD_TYPE_EDKEY);
336 &pkey_data);
337 conv_lbl = GNUNET_GNSRECORD_string_normalize (label);
338 printf ("Label:\n");
339 print_bytes (conv_lbl, strlen (conv_lbl), 8);
340 fprintf (stdout,
341 "\nNumber of records (integer): %d\n\n", rd_count);
342
343 for (int i = 0; i < rd_count; i++)
344 {
345 printf ("Record #%d := (\n", i);
346 print_record (&rd[i]);
347 printf (")\n\n");
348 }
349
351 rd);
353 rd,
355 GNUNET_assert (0 < rdata_size);
356 rdata = GNUNET_malloc ((size_t) rdata_size);
358 rd,
359 (size_t) rdata_size,
360 rdata);
361 printf ("RDATA:\n");
362 print_bytes (rdata,
363 (size_t) rdata_size,
364 8);
365 printf ("\n");
367 &skey,
368 conv_lbl,
370 expire).abs_value_us__,
371 &id_pub.eddsa_key);
372 printf ("Encryption NONCE|EXPIRATION:\n");
373 print_bytes (&nonce, sizeof (nonce), 8);
374 printf ("\n");
375 printf ("Encryption key (K):\n");
376 print_bytes (&skey, sizeof (skey), 8);
377 printf ("\n");
379 conv_lbl,
380 &query);
381 printf ("Storage key (q):\n");
382 print_bytes (&query, sizeof (query), 8);
383 printf ("\n");
384
385 GNUNET_assert (GNUNET_OK == ec->seal (ec->cls,
386 conv_lbl,
387 expire,
388 (unsigned char*) rdata,
389 rdata_size,
390 &rrblock));
391 {
392 struct GNUNET_CRYPTO_EddsaPublicKey derived_key;
393 struct GNUNET_CRYPTO_EddsaPrivateScalar derived_privkey;
394 char derived_privkeyNBO[32];
395 size_t bdata_size;
397 conv_lbl,
398 "gns",
399 &derived_key);
401 conv_lbl,
402 "gns", &derived_privkey);
403 printf ("ZKDF(zkey):\n");
404 print_bytes (&derived_key, sizeof (derived_key), 8);
405 printf ("\n");
406 printf ("nonce := SHA-256 (dh[32..63] || h):\n");
407 print_bytes (derived_privkey.s + 32, 32, 8);
408 printf ("\n");
409 /* Convert from little endian */
410 for (size_t i = 0; i < 32; i++)
411 derived_privkeyNBO[i] = derived_privkey.s[31 - i];
412 printf ("Derived private key (d', big-endian):\n");
413 print_bytes (derived_privkeyNBO, 32, 8);
414 printf ("\n");
415 bdata_size = ntohl (rrblock->size) - sizeof (struct
417
418
419 bdata = (char*) &(&rrblock->eddsa_block)[1];
420 printf ("BDATA:\n");
421 print_bytes (bdata, bdata_size, 8);
422 printf ("\n");
423 printf ("RRBLOCK:\n");
424 print_bytes (rrblock, ntohl (rrblock->size), 8);
425 printf ("\n");
426 GNUNET_free (rdata);
427 }
428 GNUNET_free (conv_lbl);
430}
431
432
441static void
442run (void *cls,
443 char *const *args,
444 const char *cfgfile,
445 const struct GNUNET_CONFIGURATION_Handle *cfg)
446{
447 struct GNUNET_GNSRECORD_Data rd_pkey;
448 struct GNUNET_GNSRECORD_Data rd[3];
449 struct GNUNET_TIME_Absolute exp1;
450 struct GNUNET_TIME_Absolute exp2;
451 struct GNUNET_TIME_Absolute exp3;
452 struct GNUNET_TIME_AbsoluteNBO exp1nbo;
453 struct GNUNET_TIME_AbsoluteNBO exp2nbo;
454 struct GNUNET_TIME_AbsoluteNBO exp3nbo;
455 size_t pkey_data_size;
456 size_t ip_data_size;
457 char *pkey_data;
458 char *ip_data;
459
460 /*
461 * Make different expiration times
462 */
463 parsehex ("001cee8c10e25980", (char*) &exp1nbo, sizeof (exp1nbo), 0);
464 parsehex ("003ff2aa5408db40", (char*) &exp2nbo, sizeof (exp2nbo), 0);
465 parsehex ("0028bb13ff371940", (char*) &exp3nbo, sizeof (exp3nbo), 0);
466 exp1 = GNUNET_TIME_absolute_ntoh (exp1nbo);
467 exp2 = GNUNET_TIME_absolute_ntoh (exp2nbo);
468 exp3 = GNUNET_TIME_absolute_ntoh (exp3nbo);
469
470 memset (&rd_pkey, 0, sizeof (struct GNUNET_GNSRECORD_Data));
473 "000G0011WESGZY9VRV9NNJ66W3GKNZFZF56BFD2BQF3MHMJST2G2GKDYGG",
474 (void**) &pkey_data,
475 &pkey_data_size));
476 rd_pkey.data = pkey_data;
477 rd_pkey.data_size = pkey_data_size;
478 rd_pkey.expiration_time = exp1.abs_value_us;
483 "::dead:beef",
484 (void**) &ip_data,
485 &ip_data_size));
486
487 rd[0].data = ip_data;
488 rd[0].data_size = ip_data_size;
492
493 rd[1].data = "\u611b\u79f0";
494 rd[1].data_size = strlen (rd[1].data);
498
499 rd[2].data = "Hello World";
500 rd[2].data_size = strlen (rd[2].data);
504
505 run_pkey (&rd_pkey, 1, "testdelegation");
506 run_pkey (rd, 3, "\u5929\u4e0b\u7121\u6575");
507 run_edkey (&rd_pkey, 1, "testdelegation");
508 run_edkey (rd, 3, "\u5929\u4e0b\u7121\u6575");
509}
510
511
519int
520main (int argc,
521 char *const *argv)
522{
525 };
526
528 GNUNET_log_setup ("gnunet-gns-tvg",
529 "INFO",
530 NULL));
531 // gcry_control (GCRYCTL_SET_DEBUG_FLAGS, 1u, 0);
532 // gcry_control (GCRYCTL_SET_VERBOSITY, 99);
533 if (GNUNET_OK !=
535 argc, argv,
536 "gnunet-gns-tvg",
537 "Generate test vectors for GNS",
538 options,
539 &run, NULL))
540 return 1;
541 return 0;
542}
543
544
545#pragma GCC diagnostic pop
546
547/* end of gnunet-gns-tvg.c */
struct GNUNET_GETOPT_CommandLineOption options[]
Definition 002.c:5
int main()
Program to simulate results from GCP_get_desirability_of_path() for various plausible inputs.
void GNR_derive_block_aes_key(unsigned char *ctr, unsigned char *key, const char *label, uint64_t exp, const struct GNUNET_CRYPTO_EcdsaPublicKey *pub)
Derive session key and iv from label and public key.
void GNR_derive_block_xsalsa_key(struct GNUNET_CRYPTO_XSalsa20Nonce *nonce, struct GNUNET_CRYPTO_XSalsa20SecretKey *key, const char *label, uint64_t exp, const struct GNUNET_CRYPTO_EddsaPublicKey *pub)
Derive session key and iv from label and public key.
API for GNS record-related crypto.
#define GNUNET_GNSRECORD_TYPE_NICK
GNS zone nickname.
#define GNUNET_GNSRECORD_TYPE_PKEY
WARNING: This header is generated! In order to add GNS record types, you must register them in GANA,...
#define GNUNET_GNSRECORD_TYPE_EDKEY
GNS zone delegation (EDKEY)
static struct GNUNET_CONFIGURATION_Handle * cfg
Our configuration.
Definition gnunet-arm.c:108
static char * line
Desired phone line (string to be converted to a hash).
static char * data
The data to insert into the dht.
static char * expire
DID Document expiration Date Attribute String.
Definition gnunet-did.c:98
static void print_bytes_(void *buf, size_t buf_len, int fold, int in_be)
static int parsehex(const char *src, char *dst, size_t dstlen, int invert)
static const char * d_edkey
static void print_bytes(void *buf, size_t buf_len, int fold)
static void print_record(const struct GNUNET_GNSRECORD_Data *rd)
static void run(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
Main function that will be run.
static const char * d_pkey
static void run_pkey(struct GNUNET_GNSRECORD_Data *rd, int rd_count, const char *label)
Main function that will be run.
static void run_edkey(struct GNUNET_GNSRECORD_Data *rd, int rd_count, const char *label)
Main function that will be run.
static unsigned int rd_count
Number of records for currently parsed set.
static struct GNUNET_GNSRECORD_Data rd[50]
The record data under a single label.
API that can be used to manipulate GNS record data.
void GNUNET_CRYPTO_ecdsa_public_key_derive(const struct GNUNET_CRYPTO_EcdsaPublicKey *pub, const char *label, const char *context, struct GNUNET_CRYPTO_EcdsaPublicKey *result)
Derive a public key from a given public key and a label.
struct GNUNET_CRYPTO_EcdsaPrivateKey * GNUNET_CRYPTO_ecdsa_private_key_derive(const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv, const char *label, const char *context)
Derive a private key from a given private key and a label.
void GNUNET_CRYPTO_eddsa_private_key_derive(const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, const char *label, const char *context, struct GNUNET_CRYPTO_EddsaPrivateScalar *result)
Derive a private scalar from a given private key and a label.
void GNUNET_CRYPTO_eddsa_key_create(struct GNUNET_CRYPTO_EddsaPrivateKey *pk)
Create a new private key.
Definition crypto_ecc.c:480
void GNUNET_CRYPTO_ecdsa_key_create(struct GNUNET_CRYPTO_EcdsaPrivateKey *pk)
Create a new private key.
Definition crypto_ecc.c:465
void GNUNET_CRYPTO_eddsa_public_key_derive(const struct GNUNET_CRYPTO_EddsaPublicKey *pub, const char *label, const char *context, struct GNUNET_CRYPTO_EddsaPublicKey *result)
Derive a public key from a given public key and a label.
#define GNUNET_DNSPARSER_TYPE_AAAA
#define GNUNET_DNSPARSER_TYPE_TXT
#define GNUNET_GETOPT_OPTION_END
Marker for the end of the list of options.
ssize_t GNUNET_GNSRECORD_records_serialize(unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd, size_t dest_size, char *dest)
Serialize the given records to the given destination buffer.
void GNUNET_GNSRECORD_encryption_context_destroy(struct GNUNET_GNSRECORD_EncryptionContext *ec)
Cleanup and free the encryption context.
int GNUNET_GNSRECORD_string_to_value(uint32_t type, const char *s, void **data, size_t *data_size)
Convert human-readable version of the value s of a record of type type to the respective binary repre...
Definition gnsrecord.c:169
struct GNUNET_TIME_Absolute GNUNET_GNSRECORD_record_get_expiration_time(unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd, struct GNUNET_TIME_Absolute min)
Returns the expiration time of the given block of records.
ssize_t GNUNET_GNSRECORD_records_get_size(unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd)
Calculate how many bytes we will need to serialize the given records.
void GNUNET_GNSRECORD_query_from_public_key(const struct GNUNET_CRYPTO_BlindablePublicKey *pub, const char *label, struct GNUNET_HashCode *query)
Calculate the DHT query for a given label in a given zone.
struct GNUNET_GNSRECORD_EncryptionContext * GNUNET_GNSRECORD_encryption_context_setup_owner(const struct GNUNET_CRYPTO_BlindablePrivateKey *sk)
Create a new encryption context for the zone owner.
char * GNUNET_GNSRECORD_string_normalize(const char *src)
Normalize a UTF-8 string to a GNS name.
@ GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION
This expiration time of the record is a relative time (not an absolute time).
@ GNUNET_GNSRECORD_RF_CRITICAL
This record is critical.
@ GNUNET_GNSRECORD_RF_SUPPLEMENTAL
This is a supplemental record.
@ GNUNET_GNSRECORD_RF_NONE
Entry for no flags / cleared flags.
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_blindable_key_get_public(const struct GNUNET_CRYPTO_BlindablePrivateKey *privkey, struct GNUNET_CRYPTO_BlindablePublicKey *key)
Retrieves the public key representation of a private key.
uint64_t GNUNET_ntohll(uint64_t n)
Convert unsigned 64-bit integer to host byte order.
#define GNUNET_CRYPTO_AES_KEY_LENGTH
length of the sessionkey in bytes
uint64_t GNUNET_htonll(uint64_t n)
Convert unsigned 64-bit integer to network byte order.
ssize_t GNUNET_CRYPTO_blindable_pk_get_length(const struct GNUNET_CRYPTO_BlindablePublicKey *key)
Get the compacted length of a GNUNET_CRYPTO_BlindablePublicKey.
Definition crypto_pkey.c:87
@ GNUNET_PUBLIC_KEY_TYPE_EDDSA
EDDSA identity.
@ GNUNET_OK
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
enum GNUNET_GenericReturnValue GNUNET_log_setup(const char *comp, const char *loglevel, const char *logfile)
Setup logging.
#define GNUNET_malloc(size)
Wrapper around malloc.
#define GNUNET_free(ptr)
Wrapper around free.
const struct GNUNET_OS_ProjectData * GNUNET_OS_project_data_gnunet(void)
Return default project data used by 'libgnunetutil' for GNUnet.
enum GNUNET_GenericReturnValue GNUNET_PROGRAM_run(const struct GNUNET_OS_ProjectData *pd, int argc, char *const *argv, const char *binaryName, const char *binaryHelp, const struct GNUNET_GETOPT_CommandLineOption *options, GNUNET_PROGRAM_Main task, void *task_cls)
Run a standard GNUnet command startup sequence (initialize loggers and configuration,...
Definition program.c:406
char * GNUNET_STRINGS_data_to_string(const void *data, size_t size, char *out, size_t out_size)
Convert binary data to ASCII encoding using CrockfordBase32.
Definition strings.c:763
struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh(struct GNUNET_TIME_AbsoluteNBO a)
Convert absolute time from network byte order.
Definition time.c:737
struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute(struct GNUNET_TIME_Relative rel)
Convert relative time to an absolute time in the future.
Definition time.c:316
#define GNUNET_TIME_UNIT_ZERO_ABS
Absolute time zero.
struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton(struct GNUNET_TIME_Absolute a)
Convert absolute time to network byte order.
Definition time.c:636
A private key for an identity as per LSD0001.
struct GNUNET_CRYPTO_EcdsaPrivateKey ecdsa_key
An ECDSA identity key.
uint32_t type
Type of public key.
struct GNUNET_CRYPTO_EddsaPrivateKey eddsa_key
AN EdDSA identtiy key.
An identity key as per LSD0001.
struct GNUNET_CRYPTO_EcdsaPublicKey ecdsa_key
An ECDSA identity key.
struct GNUNET_CRYPTO_EddsaPublicKey eddsa_key
AN EdDSA identtiy key.
Private ECC key encoded for transmission.
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and ECDS...
Private ECC key encoded for transmission.
Private ECC scalar encoded for transmission.
unsigned char s[512/8]
s is the expandedprivate 512-bit scalar of a private key.
Public ECC key (always for curve Ed25519) encoded in a format suitable for network transmission and E...
unsigned char nonce[24]
Initialization vector.
Definition of a command line option.
struct GNUNET_GNSRECORD_EcdsaBlock ecdsa_block
struct GNUNET_GNSRECORD_EddsaBlock eddsa_block
uint32_t size
Size of the block.
uint32_t record_type
Type of the GNS/DNS record.
const void * data
Binary value stored in the DNS record.
size_t data_size
Number of bytes in data.
enum GNUNET_GNSRECORD_Flags flags
Flags for the record.
uint64_t expiration_time
Expiration time for the DNS record.
The GNSRECORD encryption context.
void * cls
Private data of the context.
enum GNUNET_GenericReturnValue(* seal)(void *cls, const char *label, struct GNUNET_TIME_Absolute expire, unsigned char *rdata, size_t rdata_len, struct GNUNET_GNSRECORD_Block **result)
Seal a record set.
A 512-bit hashcode.
Time for absolute time used by GNUnet, in microseconds and in network byte order.
Time for absolute times used by GNUnet, in microseconds.
uint64_t abs_value_us
The actual value.
Time for relative time used by GNUnet, in microseconds.
uint64_t rel_value_us
The actual value.