gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] 06/20: -implement TVG


From: gnunet
Subject: [gnunet] 06/20: -implement TVG
Date: Sat, 19 Feb 2022 16:20:46 +0100

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

grothoff pushed a commit to branch master
in repository gnunet.

commit 3a71153405e8fc26712807b4bdb5987fb3bf2b9e
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Thu Jan 13 20:26:33 2022 +0100

    -implement TVG
---
 src/hello/Makefile.am      |  3 ++-
 src/hello/test_hello-uri.c | 40 ++++++++++++++++++++++++++++++++++++++--
 2 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/src/hello/Makefile.am b/src/hello/Makefile.am
index 08d976260..c04b85106 100644
--- a/src/hello/Makefile.am
+++ b/src/hello/Makefile.am
@@ -50,7 +50,8 @@ test_hello_uri_SOURCES = \
  test_hello-uri.c
 test_hello_uri_LDADD = \
  libgnunethello.la \
- $(top_builddir)/src/util/libgnunetutil.la
+ $(top_builddir)/src/util/libgnunetutil.la \
+ -lgcrypt
 
 
 test_friend_hello_SOURCES = \
diff --git a/src/hello/test_hello-uri.c b/src/hello/test_hello-uri.c
index 295c08ea3..7e70d6763 100644
--- a/src/hello/test_hello-uri.c
+++ b/src/hello/test_hello-uri.c
@@ -44,7 +44,7 @@ check_uris (void *cls,
                    "test://address"))
     *found |= 1;
   else if (0 == strcmp (uri,
-                   "test://more"))
+                        "test://more"))
     *found |= 2;
   else
     *found = (unsigned int) -1;
@@ -170,7 +170,43 @@ main (int argc,
     GNUNET_HELLO_builder_free (b2);
   }
 
-
   GNUNET_HELLO_builder_free (b);
+
+  GNUNET_CRYPTO_mpi_print_unsigned (priv.d,
+                                    sizeof (priv.d),
+                                    GCRYMPI_CONST_ONE);
+  priv.d[0] &= 248;
+  priv.d[31] &= 127;
+  priv.d[31] |= 64;
+  {
+    char *buf;
+
+    buf = GNUNET_STRINGS_data_to_string_alloc (&priv,
+                                               sizeof (priv));
+    fprintf (stderr,
+             "PK: %s\n",
+             buf);
+    GNUNET_free (buf);
+  }
+  GNUNET_CRYPTO_eddsa_key_get_public (&priv,
+                                      &pid.public_key);
+  b = GNUNET_HELLO_builder_new (&pid);
+  GNUNET_assert (GNUNET_OK ==
+                 GNUNET_HELLO_builder_add_address (b,
+                                                   "a://first"));
+  GNUNET_assert (GNUNET_OK ==
+                 GNUNET_HELLO_builder_add_address (b,
+                                                   "b://second"));
+  {
+    char *url;
+
+    url = GNUNET_HELLO_builder_to_url (b,
+                                       &priv);
+    fprintf (stderr,
+             "TV: %s\n",
+             url);
+    GNUNET_free (url);
+  }
+
   return 0;
 }

-- 
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]