GNUnet  0.19.5
gnunet-ecc.c File Reference

tool to manipulate EDDSA key files More...

#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_testing_lib.h"
#include <gcrypt.h>
Include dependency graph for gnunet-ecc.c:

Go to the source code of this file.

Macros

#define KEY_STR_LEN   sizeof(struct GNUNET_CRYPTO_EddsaPublicKey) * 8 / 5 + 1
 Number of characters a Base32-encoded public key requires. More...
 

Functions

static void create_keys (const char *fn, const char *prefix)
 Create a flat file with a large number of key pairs for testing. More...
 
static void print_hex (const char *msg, const void *buf, size_t size)
 
static void print_examples_ecdh (void)
 
static void print_examples (void)
 Print some random example operations to stdout. More...
 
static void print_key (const char *filename)
 
static void run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
 Main function that will be run by the scheduler. More...
 
int main (int argc, char *const *argv)
 Program to manipulate ECC key files. More...
 

Variables

static int list_keys
 Flag for listing public key. More...
 
static unsigned int list_keys_count
 Flag for listing public key. More...
 
static int print_public_key
 Flag for printing public key. More...
 
static int print_private_key
 Flag for printing private key. More...
 
static int print_public_key_hex
 Flag for printing public key in hex. More...
 
static int print_examples_flag
 Flag for printing the output of random example operations. More...
 
static unsigned int make_keys
 Option set to create a bunch of keys at once. More...
 

Detailed Description

tool to manipulate EDDSA key files

Author
Christian Grothoff

Definition in file gnunet-ecc.c.

Macro Definition Documentation

◆ KEY_STR_LEN

#define KEY_STR_LEN   sizeof(struct GNUNET_CRYPTO_EddsaPublicKey) * 8 / 5 + 1

Number of characters a Base32-encoded public key requires.

Definition at line 35 of file gnunet-ecc.c.

Function Documentation

◆ create_keys()

static void create_keys ( const char *  fn,
const char *  prefix 
)
static

Create a flat file with a large number of key pairs for testing.

Parameters
fnFile name to store the keys.
prefixDesired prefix for the public keys, NULL if any key is OK.

Documentation by example: vanity = "A" len = 1 n = 5/8 = 0 (bytes) rest = 5%8 = 5 (bits) mask = ~(2**(8 - 5) - 1) = ~(2**3 - 1) = ~(8 - 1) = ~b111 = b11111000

Definition at line 80 of file gnunet-ecc.c.

81 {
82  FILE *f;
84  struct GNUNET_CRYPTO_EddsaPublicKey target_pub;
85  static char vanity[KEY_STR_LEN + 1];
86  size_t len;
87  size_t n;
88  size_t rest;
89  unsigned char mask;
90  unsigned target_byte;
91  char *s;
92 
93  if (NULL == (f = fopen (fn, "w+")))
94  {
95  fprintf (stderr, _ ("Failed to open `%s': %s\n"), fn, strerror (errno));
96  return;
97  }
98  if (NULL != prefix)
99  {
100  len = GNUNET_strlcpy (vanity, prefix, sizeof(vanity));
101  n = len * 5 / 8;
102  rest = len * 5 % 8;
103 
104  memset (&vanity[len], '0', KEY_STR_LEN - len);
105  vanity[KEY_STR_LEN] = '\0';
108  KEY_STR_LEN,
109  &target_pub));
110  if (0 != rest)
111  {mask = ~((int) pow (2, 8 - rest) - 1);
120  target_byte = ((unsigned char *) &target_pub)[n] & mask;
121  }
122  else
123  {
124  /* Just so old (debian) versions of GCC calm down with the warnings. */
125  mask = target_byte = 0;
126  }
128  fprintf (stderr,
129  _ ("Generating %u keys like %s, please wait"),
130  make_keys,
131  s);
132  GNUNET_free (s);
133  fprintf (stderr, "\nattempt %s [%u, %X]\n", vanity, (unsigned int) n, mask);
134  }
135  else
136  {
137  fprintf (stderr, _ ("Generating %u keys, please wait"), make_keys);
138  /* Just so old (debian) versions of GCC calm down with the warnings. */
139  n = rest = target_byte = mask = 0;
140  }
141 
142  while (0 < make_keys--)
143  {
144  fprintf (stderr, ".");
146  if (NULL != prefix)
147  {
148  struct GNUNET_CRYPTO_EddsaPublicKey newkey;
149 
151  &newkey);
152  if (0 != memcmp (&target_pub,
153  &newkey,
154  n))
155  {
156  make_keys++;
157  continue;
158  }
159  if (0 != rest)
160  {
161  unsigned char new_byte;
162 
163  new_byte = ((unsigned char *) &newkey)[n] & mask;
164  if (target_byte != new_byte)
165  {
166  make_keys++;
167  continue;
168  }
169  }
170  }
172  fwrite (&pk,
173  1,
175  f))
176  {
177  fprintf (stderr,
178  _ ("\nFailed to write to `%s': %s\n"),
179  fn,
180  strerror (errno));
181  break;
182  }
183  }
184  if (UINT_MAX == make_keys)
185  fprintf (stderr, _ ("\nFinished!\n"));
186  else
187  fprintf (stderr, _ ("\nError, %u keys not generated\n"), make_keys);
188  fclose (f);
189 }
static int prefix
If printing the value of PREFIX has been requested.
Definition: gnunet-config.c:59
#define KEY_STR_LEN
Number of characters a Base32-encoded public key requires.
Definition: gnunet-ecc.c:35
static unsigned int make_keys
Option set to create a bunch of keys at once.
Definition: gnunet-ecc.c:70
uint16_t len
length of data (which is always a uint32_t, but presumably this can be used to specify that fewer byt...
struct GNUNET_IDENTITY_PrivateKey pk
Private key from command line option, or NULL.
void GNUNET_CRYPTO_eddsa_key_get_public(const struct GNUNET_CRYPTO_EddsaPrivateKey *priv, struct GNUNET_CRYPTO_EddsaPublicKey *pub)
Extract the public key for the given private key.
Definition: crypto_ecc.c:198
void GNUNET_CRYPTO_eddsa_key_create(struct GNUNET_CRYPTO_EddsaPrivateKey *pk)
Create a new private key.
Definition: crypto_ecc.c:462
char * GNUNET_CRYPTO_eddsa_public_key_to_string(const struct GNUNET_CRYPTO_EddsaPublicKey *pub)
Convert a public key to a string.
Definition: crypto_ecc.c:252
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_eddsa_public_key_from_string(const char *enc, size_t enclen, struct GNUNET_CRYPTO_EddsaPublicKey *pub)
Convert a string representing a public key to a public key.
Definition: crypto_ecc.c:358
@ GNUNET_OK
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
#define GNUNET_free(ptr)
Wrapper around free.
size_t GNUNET_strlcpy(char *dst, const char *src, size_t n)
Like strlcpy but portable.
Definition: strings.c:138
#define GNUNET_TESTING_HOSTKEYFILESIZE
Size of each hostkey in the hostkey file (in BYTES).
#define _(String)
GNU gettext support macro.
Definition: platform.h:178
Private ECC key encoded for transmission.
Public ECC key (always for curve Ed25519) encoded in a format suitable for network transmission and E...

References _, removetrailingwhitespace::f, GNUNET_assert, GNUNET_CRYPTO_eddsa_key_create(), GNUNET_CRYPTO_eddsa_key_get_public(), GNUNET_CRYPTO_eddsa_public_key_from_string(), GNUNET_CRYPTO_eddsa_public_key_to_string(), GNUNET_free, GNUNET_OK, GNUNET_strlcpy(), GNUNET_TESTING_HOSTKEYFILESIZE, consensus-simulation::int, KEY_STR_LEN, len, make_keys, pk, and prefix.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_hex()

static void print_hex ( const char *  msg,
const void *  buf,
size_t  size 
)
static

Definition at line 193 of file gnunet-ecc.c.

194 {
195  printf ("%s: ", msg);
196  for (size_t i = 0; i < size; i++)
197  {
198  printf ("%02hhx", ((const uint8_t *) buf)[i]);
199  }
200  printf ("\n");
201 }
struct GNUNET_MessageHeader * msg
Definition: 005.c:2
static char buf[2048]
static unsigned int size
Size of the "table".
Definition: peer.c:68

References buf, msg, and size.

Referenced by print_examples_ecdh(), and run().

Here is the caller graph for this function:

◆ print_examples_ecdh()

static void print_examples_ecdh ( void  )
static

Definition at line 205 of file gnunet-ecc.c.

206 {
207  struct GNUNET_CRYPTO_EcdhePrivateKey dh_priv1;
208  struct GNUNET_CRYPTO_EcdhePublicKey dh_pub1;
209  struct GNUNET_CRYPTO_EcdhePrivateKey dh_priv2;
210  struct GNUNET_CRYPTO_EcdhePublicKey dh_pub2;
211  struct GNUNET_HashCode hash;
212  char buf[128];
213 
214  GNUNET_CRYPTO_ecdhe_key_create (&dh_priv1);
215  GNUNET_CRYPTO_ecdhe_key_create (&dh_priv2);
217  &dh_pub1);
219  &dh_pub2);
220 
221  GNUNET_assert (NULL !=
223  sizeof (dh_priv1),
224  buf,
225  sizeof (buf)));
226  printf ("ECDHE key 1:\n");
227  printf ("private: %s\n",
228  buf);
229  print_hex ("private(hex)",
230  &dh_priv1, sizeof (dh_priv1));
231  GNUNET_assert (NULL !=
233  sizeof (dh_pub1),
234  buf,
235  sizeof (buf)));
236  printf ("public: %s\n",
237  buf);
238  print_hex ("public(hex)",
239  &dh_pub1,
240  sizeof (dh_pub1));
241 
242  GNUNET_assert (NULL !=
244  sizeof (dh_priv2),
245  buf,
246  sizeof (buf)));
247  printf ("ECDHE key 2:\n");
248  printf ("private: %s\n", buf);
249  print_hex ("private(hex)",
250  &dh_priv2,
251  sizeof (dh_priv2));
252  GNUNET_assert (NULL !=
254  sizeof (dh_pub2),
255  buf,
256  sizeof (buf)));
257  printf ("public: %s\n", buf);
258  print_hex ("public(hex)",
259  &dh_pub2,
260  sizeof (dh_pub2));
261 
263  GNUNET_CRYPTO_ecc_ecdh (&dh_priv1,
264  &dh_pub2,
265  &hash));
266  GNUNET_assert (NULL !=
268  sizeof (hash),
269  buf,
270  sizeof (buf)));
271  printf ("ECDH shared secret: %s\n",
272  buf);
273 
274 }
static void print_hex(const char *msg, const void *buf, size_t size)
Definition: gnunet-ecc.c:193
enum GNUNET_GenericReturnValue GNUNET_CRYPTO_ecc_ecdh(const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, const struct GNUNET_CRYPTO_EcdhePublicKey *pub, struct GNUNET_HashCode *key_material)
Derive key material from a public and a private ECC key.
Definition: crypto_ecc.c:714
void GNUNET_CRYPTO_ecdhe_key_create(struct GNUNET_CRYPTO_EcdhePrivateKey *pk)
Create a new private key.
Definition: crypto_ecc.c:436
void GNUNET_CRYPTO_ecdhe_key_get_public(const struct GNUNET_CRYPTO_EcdhePrivateKey *priv, struct GNUNET_CRYPTO_EcdhePublicKey *pub)
Extract the public key for the given private key.
Definition: crypto_ecc.c:214
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:708
Private ECC key encoded for transmission.
Public ECC key (always for Curve25519) encoded in a format suitable for network transmission and encr...
A 512-bit hashcode.

References buf, GNUNET_assert, GNUNET_CRYPTO_ecc_ecdh(), GNUNET_CRYPTO_ecdhe_key_create(), GNUNET_CRYPTO_ecdhe_key_get_public(), GNUNET_OK, GNUNET_STRINGS_data_to_string(), and print_hex().

Referenced by print_examples().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_examples()

static void print_examples ( void  )
static

Print some random example operations to stdout.

Definition at line 281 of file gnunet-ecc.c.

282 {
284  // print_examples_ecdsa ();
285  // print_examples_eddsa ();
286 }
static void print_examples_ecdh(void)
Definition: gnunet-ecc.c:205

References print_examples_ecdh().

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_key()

static void print_key ( const char *  filename)
static

Definition at line 290 of file gnunet-ecc.c.

291 {
292  struct GNUNET_DISK_FileHandle *fd;
293  struct GNUNET_CRYPTO_EddsaPrivateKey private_key;
294  struct GNUNET_CRYPTO_EddsaPublicKey public_key;
295  char *hostkeys_data;
296  char *hostkey_str;
297  uint64_t fs;
298  unsigned int total_hostkeys;
299  unsigned int c;
300  ssize_t sret;
301 
303  {
304  fprintf (stderr, _ ("Hostkeys file `%s' not found\n"), filename);
305  return;
306  }
307 
308  /* Check hostkey file size, read entire thing into memory */
309  if (GNUNET_OK !=
311  fs = 0;
312  if (0 == fs)
313  {
314  fprintf (stderr, _ ("Hostkeys file `%s' is empty\n"), filename);
315  return; /* File is empty */
316  }
317  if (0 != (fs % GNUNET_TESTING_HOSTKEYFILESIZE))
318  {
319  fprintf (stderr, _ ("Incorrect hostkey file format: %s\n"), filename);
320  return;
321  }
325  if (NULL == fd)
326  {
328  return;
329  }
331  sret = GNUNET_DISK_file_read (fd, hostkeys_data, fs);
332  if ((sret < 0) || (fs != (size_t) sret))
333  {
334  fprintf (stderr, _ ("Could not read hostkey file: %s\n"), filename);
337  return;
338  }
340 
341  if (NULL == hostkeys_data)
342  return;
343  total_hostkeys = fs / GNUNET_TESTING_HOSTKEYFILESIZE;
344  for (c = 0; (c < total_hostkeys) && (c < list_keys_count); c++)
345  {
346  GNUNET_memcpy (&private_key,
349  GNUNET_CRYPTO_eddsa_key_get_public (&private_key, &public_key);
350  hostkey_str = GNUNET_CRYPTO_eddsa_public_key_to_string (&public_key);
351  if (NULL != hostkey_str)
352  {
353  fprintf (stderr, "%4u: %s\n", c, hostkey_str);
354  GNUNET_free (hostkey_str);
355  }
356  else
357  fprintf (stderr, "%4u: %s\n", c, "invalid");
358  }
360 }
static void * hostkeys_data
The hostkeys data.
static char * filename
static unsigned int list_keys_count
Flag for listing public key.
Definition: gnunet-ecc.c:45
static struct GNUNET_FS_Handle * fs
Handle to FS service.
Definition: gnunet-fs.c:37
struct GNUNET_DISK_FileHandle * GNUNET_DISK_file_open(const char *fn, enum GNUNET_DISK_OpenFlags flags, enum GNUNET_DISK_AccessPermissions perm)
Open a file.
Definition: disk.c:1237
enum GNUNET_GenericReturnValue GNUNET_DISK_file_test(const char *fil)
Check that fil corresponds to a filename (of a file that exists and that is not a directory).
Definition: disk.c:482
enum GNUNET_GenericReturnValue GNUNET_DISK_file_size(const char *filename, uint64_t *size, int include_symbolic_links, int single_file_mode)
Get the size of the file (or directory) of the given file (in bytes).
Definition: disk.c:221
enum GNUNET_GenericReturnValue GNUNET_DISK_file_close(struct GNUNET_DISK_FileHandle *h)
Close an open file.
Definition: disk.c:1308
ssize_t GNUNET_DISK_file_read(const struct GNUNET_DISK_FileHandle *h, void *result, size_t len)
Read the contents of a binary file into a buffer.
Definition: disk.c:622
@ GNUNET_DISK_OPEN_READ
Open the file for reading.
@ GNUNET_DISK_PERM_NONE
Nobody is allowed to do anything to the file.
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
@ GNUNET_YES
#define GNUNET_log_strerror_file(level, cmd, filename)
Log an error message at log-level 'level' that indicates a failure of the command 'cmd' with the mess...
@ GNUNET_ERROR_TYPE_ERROR
#define GNUNET_malloc(size)
Wrapper around malloc.
Handle used to access files (and pipes).
int fd
File handle on Unix-like systems.

References _, GNUNET_DISK_FileHandle::fd, filename, fs, GNUNET_CRYPTO_eddsa_key_get_public(), GNUNET_CRYPTO_eddsa_public_key_to_string(), GNUNET_DISK_file_close(), GNUNET_DISK_file_open(), GNUNET_DISK_file_read(), GNUNET_DISK_file_size(), GNUNET_DISK_file_test(), GNUNET_DISK_OPEN_READ, GNUNET_DISK_PERM_NONE, GNUNET_ERROR_TYPE_ERROR, GNUNET_free, GNUNET_log_strerror_file, GNUNET_malloc, GNUNET_memcpy, GNUNET_OK, GNUNET_TESTING_HOSTKEYFILESIZE, GNUNET_YES, hostkeys_data, and list_keys_count.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run()

static void run ( void *  cls,
char *const *  args,
const char *  cfgfile,
const struct GNUNET_CONFIGURATION_Handle cfg 
)
static

Main function that will be run by the scheduler.

Parameters
clsclosure, NULL
argsremaining command-line arguments
cfgfilename of the configuration file used (for saving, can be NULL!)
cfgconfiguration

Definition at line 372 of file gnunet-ecc.c.

376 {
377  (void) cls;
378  (void) cfgfile;
379  (void) cfg;
380 
382  {
383  print_examples ();
384  return;
385  }
386  if (NULL == args[0])
387  {
388  fprintf (stderr, "%s", _ ("No hostkey file specified on command line\n"));
389  return;
390  }
391  if (list_keys)
392  {
393  print_key (args[0]);
394  return;
395  }
396  if (make_keys > 0)
397  {
398  create_keys (args[0], args[1]);
399  return;
400  }
402  {
403  char *str;
404  struct GNUNET_DISK_FileHandle *keyfile;
407 
408  keyfile = GNUNET_DISK_file_open (args[0],
411  if (NULL == keyfile)
412  return;
413  while (sizeof(pk) == GNUNET_DISK_file_read (keyfile, &pk, sizeof(pk)))
414  {
417  {
418  print_hex ("HEX:", &pub, sizeof(pub));
419  }
420  else if (print_public_key)
421  {
423  fprintf (stdout, "%s\n", str);
424  GNUNET_free (str);
425  }
426  else if (print_private_key)
427  {
429  fprintf (stdout, "%s\n", str);
430  GNUNET_free (str);
431  }
432  }
433  GNUNET_DISK_file_close (keyfile);
434  }
435 }
static const struct GNUNET_CONFIGURATION_Handle * cfg
Configuration we are using.
Definition: gnunet-abd.c:36
static void print_examples(void)
Print some random example operations to stdout.
Definition: gnunet-ecc.c:281
static int list_keys
Flag for listing public key.
Definition: gnunet-ecc.c:40
static int print_public_key_hex
Flag for printing public key in hex.
Definition: gnunet-ecc.c:60
static void print_key(const char *filename)
Definition: gnunet-ecc.c:290
static int print_private_key
Flag for printing private key.
Definition: gnunet-ecc.c:55
static int print_public_key
Flag for printing public key.
Definition: gnunet-ecc.c:50
static void create_keys(const char *fn, const char *prefix)
Create a flat file with a large number of key pairs for testing.
Definition: gnunet-ecc.c:80
static int print_examples_flag
Flag for printing the output of random example operations.
Definition: gnunet-ecc.c:65
static struct GNUNET_CRYPTO_EddsaPublicKey pub
Definition: gnunet-scrypt.c:47
char * GNUNET_CRYPTO_eddsa_private_key_to_string(const struct GNUNET_CRYPTO_EddsaPrivateKey *priv)
Convert a private key to a string.
Definition: crypto_ecc.c:279

References _, consensus-simulation::args, cfg, create_keys(), GNUNET_CRYPTO_eddsa_key_get_public(), GNUNET_CRYPTO_eddsa_private_key_to_string(), GNUNET_CRYPTO_eddsa_public_key_to_string(), GNUNET_DISK_file_close(), GNUNET_DISK_file_open(), GNUNET_DISK_file_read(), GNUNET_DISK_OPEN_READ, GNUNET_DISK_PERM_NONE, GNUNET_free, list_keys, make_keys, pk, print_examples(), print_examples_flag, print_hex(), print_key(), print_private_key, print_public_key, print_public_key_hex, and pub.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char *const *  argv 
)

Program to manipulate ECC key files.

Parameters
argcnumber of arguments from the command line
argvcommand line arguments
Returns
0 ok, 1 on error

Definition at line 446 of file gnunet-ecc.c.

447 {
450  "iterate",
451  gettext_noop (
452  "list keys included in a file (for testing)"),
453  &list_keys),
455  'e',
456  "end=",
457  "COUNT",
458  gettext_noop ("number of keys to list included in a file (for testing)"),
459  &list_keys_count),
461  'g',
462  "generate-keys",
463  "COUNT",
464  gettext_noop ("create COUNT public-private key pairs (for testing)"),
465  &make_keys),
467  "print-public-key",
468  gettext_noop (
469  "print the public key in ASCII format"),
472  "print-private-key",
473  gettext_noop (
474  "print the private key in ASCII format"),
477  "print-hex",
478  gettext_noop (
479  "print the public key in HEX format"),
482  'E',
483  "examples",
484  gettext_noop (
485  "print examples of ECC operations (used for compatibility testing)"),
488  int ret;
489 
490  list_keys_count = UINT32_MAX;
491  if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
492  return 2;
493 
494  ret = (GNUNET_OK ==
495  GNUNET_PROGRAM_run (argc,
496  argv,
497  "gnunet-ecc [OPTIONS] keyfile [VANITY_PREFIX]",
498  gettext_noop (
499  "Manipulate GNUnet private ECC key files"),
500  options,
501  &run,
502  NULL))
503  ? 0
504  : 1;
505  GNUNET_free_nz ((void *) argv);
506  return ret;
507 }
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_OPTION_END
Definition: 002.c:13
struct GNUNET_GETOPT_CommandLineOption options[]
Definition: 002.c:5
#define gettext_noop(String)
Definition: gettext.h:70
static int ret
Return value of the commandline.
Definition: gnunet-abd.c:81
static void run(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
Main function that will be run by the scheduler.
Definition: gnunet-ecc.c:372
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_uint(char shortName, const char *name, const char *argumentHelp, const char *description, unsigned int *val)
Allow user to specify an unsigned int.
struct GNUNET_GETOPT_CommandLineOption GNUNET_GETOPT_option_flag(char shortName, const char *name, const char *description, int *val)
Allow user to specify a flag (which internally means setting an integer to 1/GNUNET_YES/GNUNET_OK.
#define GNUNET_free_nz(ptr)
Wrapper around free.
enum GNUNET_GenericReturnValue GNUNET_PROGRAM_run(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:400
enum GNUNET_GenericReturnValue GNUNET_STRINGS_get_utf8_args(int argc, char *const *argv, int *u8argc, char *const **u8argv)
Returns utf-8 encoded arguments.
Definition: strings.c:1222
Definition of a command line option.

References gettext_noop, GNUNET_free_nz, GNUNET_GETOPT_OPTION_END, GNUNET_GETOPT_option_flag(), GNUNET_GETOPT_option_uint(), GNUNET_OK, GNUNET_PROGRAM_run(), GNUNET_STRINGS_get_utf8_args(), list_keys, list_keys_count, make_keys, options, print_examples_flag, print_private_key, print_public_key, print_public_key_hex, ret, and run().

Here is the call graph for this function:

Variable Documentation

◆ list_keys

int list_keys
static

Flag for listing public key.

Definition at line 40 of file gnunet-ecc.c.

Referenced by main(), and run().

◆ list_keys_count

unsigned int list_keys_count
static

Flag for listing public key.

Definition at line 45 of file gnunet-ecc.c.

Referenced by main(), and print_key().

◆ print_public_key

int print_public_key
static

Flag for printing public key.

Definition at line 50 of file gnunet-ecc.c.

Referenced by main(), and run().

◆ print_private_key

int print_private_key
static

Flag for printing private key.

Definition at line 55 of file gnunet-ecc.c.

Referenced by main(), and run().

◆ print_public_key_hex

int print_public_key_hex
static

Flag for printing public key in hex.

Definition at line 60 of file gnunet-ecc.c.

Referenced by main(), and run().

◆ print_examples_flag

int print_examples_flag
static

Flag for printing the output of random example operations.

Definition at line 65 of file gnunet-ecc.c.

Referenced by main(), and run().

◆ make_keys

unsigned int make_keys
static

Option set to create a bunch of keys at once.

Definition at line 70 of file gnunet-ecc.c.

Referenced by create_keys(), main(), and run().