gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: GNS: Add derived keys to TV output.


From: gnunet
Subject: [gnunet] branch master updated: GNS: Add derived keys to TV output.
Date: Mon, 03 Jul 2023 09:14:54 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new f81e2d7b8 GNS: Add derived keys to TV output.
f81e2d7b8 is described below

commit f81e2d7b8f97ac90d87540857ce1e6f1da728489
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Mon Jul 3 09:14:39 2023 +0200

    GNS: Add derived keys to TV output.
---
 src/gnsrecord/gnunet-gnsrecord-tvg.c | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/src/gnsrecord/gnunet-gnsrecord-tvg.c 
b/src/gnsrecord/gnunet-gnsrecord-tvg.c
index d472fdcf6..dacf970e7 100644
--- a/src/gnsrecord/gnunet-gnsrecord-tvg.c
+++ b/src/gnsrecord/gnunet-gnsrecord-tvg.c
@@ -235,9 +235,26 @@ run_pkey (struct GNUNET_GNSRECORD_Data *rd, int rd_count, 
const char *label)
                                                              rd,
                                                              rd_count,
                                                              &rrblock));
+  struct GNUNET_CRYPTO_EcdsaPublicKey derived_key;
+  struct GNUNET_CRYPTO_EcdsaPrivateKey *derived_privkey;
+  GNUNET_CRYPTO_ecdsa_public_key_derive (&id_pub.ecdsa_key,
+                                         label,
+                                         "gns",
+                                         &derived_key);
+  derived_privkey = GNUNET_CRYPTO_ecdsa_private_key_derive (&id_priv.ecdsa_key,
+                                                            label,
+                                                            "gns");
+  printf ("ZKDF(zkey):\n");
+  print_bytes (&derived_key, sizeof (derived_key), 8);
+  printf ("\n");
+  printf ("Derived private key (d'):\n");
+  print_bytes (derived_privkey, sizeof (*derived_privkey), 8);
+  printf ("\n");
   size_t bdata_size = ntohl (rrblock->size) - sizeof (struct
                                                       GNUNET_GNSRECORD_Block);
 
+  GNUNET_free (derived_privkey);
+
   bdata = (char*) &(&rrblock->ecdsa_block)[1];
   printf ("BDATA:\n");
   print_bytes (bdata, bdata_size, 8);
@@ -365,9 +382,26 @@ run_edkey (struct GNUNET_GNSRECORD_Data *rd, int rd_count, 
const char*label)
                                                               rd,
                                                               rd_count,
                                                               &rrblock));
+
+  struct GNUNET_CRYPTO_EddsaPublicKey derived_key;
+  struct GNUNET_CRYPTO_EddsaPrivateScalar derived_privkey;
+  GNUNET_CRYPTO_eddsa_public_key_derive (&id_pub.eddsa_key,
+                                         label,
+                                         "gns",
+                                         &derived_key);
+  GNUNET_CRYPTO_eddsa_private_key_derive (&id_priv.eddsa_key,
+                                          label,
+                                          "gns", &derived_privkey);
+  printf ("ZKDF(zkey):\n");
+  print_bytes (&derived_key, sizeof (derived_key), 8);
+  printf ("\n");
+  printf ("Derived private key (nonce|d'):\n");
+  print_bytes (&derived_privkey, sizeof (&derived_privkey), 8);
+  printf ("\n");
   size_t bdata_size = ntohl (rrblock->size) - sizeof (struct
                                                       GNUNET_GNSRECORD_Block);
 
+
   bdata = (char*) &(&rrblock->eddsa_block)[1];
   printf ("BDATA:\n");
   print_bytes (bdata, bdata_size, 8);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]