gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: crypto worker: eddsa signing


From: gnunet
Subject: [taler-exchange] branch master updated: crypto worker: eddsa signing
Date: Thu, 09 Dec 2021 10:38:15 +0100

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

dold pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new dcb73693 crypto worker: eddsa signing
dcb73693 is described below

commit dcb73693dd69767828b975dc603e6b0dd2d5408d
Author: Florian Dold <florian@dold.me>
AuthorDate: Thu Dec 9 10:38:02 2021 +0100

    crypto worker: eddsa signing
---
 src/exchange-tools/taler-crypto-worker.c | 74 ++++++++++++++++----------------
 1 file changed, 37 insertions(+), 37 deletions(-)

diff --git a/src/exchange-tools/taler-crypto-worker.c 
b/src/exchange-tools/taler-crypto-worker.c
index 674724ed..6690b912 100644
--- a/src/exchange-tools/taler-crypto-worker.c
+++ b/src/exchange-tools/taler-crypto-worker.c
@@ -137,42 +137,39 @@ run (void *cls,
                   "sent response\n");
       continue;
     }
-    if (0 == strcmp ("setup_refresh_planchet", op))
+    if (0 == strcmp ("eddsa_sign",
+                     op))
     {
-      struct TALER_TransferSecretP transfer_secret;
-      uint32_t coin_index;
+      struct GNUNET_CRYPTO_EddsaSignature sig;
+      struct GNUNET_CRYPTO_EccSignaturePurpose *msg;
+      struct GNUNET_CRYPTO_EddsaPrivateKey priv;
+      size_t msg_size;
       json_t *resp;
-      struct GNUNET_JSON_Specification eddsa_verify_spec[] = {
-        GNUNET_JSON_spec_uint32 ("coin_index",
-                                 &coin_index),
-        GNUNET_JSON_spec_fixed_auto ("transfer_secret",
-                                     &transfer_secret),
+      struct GNUNET_JSON_Specification eddsa_sign_spec[] = {
+        GNUNET_JSON_spec_fixed_auto ("priv",
+                                     &priv),
+        GNUNET_JSON_spec_varsize ("msg",
+                                  (void **) &msg,
+                                  &msg_size),
         GNUNET_JSON_spec_end ()
       };
-      struct TALER_CoinSpendPublicKeyP coin_pub;
-      struct TALER_PlanchetSecretsP ps;
-
-      if (GNUNET_OK !=
-          GNUNET_JSON_parse (args,
-                             eddsa_verify_spec,
-                             NULL,
-                             NULL))
+      if (GNUNET_OK != GNUNET_JSON_parse (args,
+                                          eddsa_sign_spec,
+                                          NULL,
+                                          NULL))
       {
         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                     "malformed op args\n");
         global_ret = 1;
         return;
       }
-      TALER_planchet_setup_refresh (&transfer_secret,
-                                    coin_index,
-                                    &ps);
-      GNUNET_CRYPTO_eddsa_key_get_public (&ps.coin_priv.eddsa_priv,
-                                          &coin_pub.eddsa_pub);
-
+      GNUNET_CRYPTO_eddsa_sign_ (
+        &priv,
+        msg,
+        &sig
+        );
       resp = GNUNET_JSON_PACK (
-        GNUNET_JSON_pack_data_auto ("coin_priv", &ps.coin_priv),
-        GNUNET_JSON_pack_data_auto ("coin_pub", &coin_pub),
-        GNUNET_JSON_pack_data_auto ("blinding_key", &ps.blinding_key)
+        GNUNET_JSON_pack_data_auto ("sig", &sig)
         );
       json_dumpf (resp, stdout, JSON_COMPACT);
       printf ("\n");
@@ -181,24 +178,26 @@ run (void *cls,
                   "sent response\n");
       continue;
     }
-    if (0 == strcmp (op, "create_planchet"))
+    if (0 == strcmp ("setup_refresh_planchet", op))
     {
       struct TALER_TransferSecretP transfer_secret;
-      uint32_t coin_num_salt;
-      struct TALER_PlanchetSecretsP ps;
-      struct TALER_CoinSpendPublicKeyP coin_pub;
+      uint32_t coin_index;
       json_t *resp;
-      struct GNUNET_JSON_Specification eddsa_verify_spec[] = {
+      struct GNUNET_JSON_Specification setup_refresh_planchet_spec[] = {
+        GNUNET_JSON_spec_uint32 ("coin_index",
+                                 &coin_index),
         GNUNET_JSON_spec_fixed_auto ("transfer_secret",
                                      &transfer_secret),
-        GNUNET_JSON_spec_uint32 ("coin_index",
-                                 &coin_num_salt),
         GNUNET_JSON_spec_end ()
       };
-      if (GNUNET_OK != GNUNET_JSON_parse (args,
-                                          eddsa_verify_spec,
-                                          NULL,
-                                          NULL))
+      struct TALER_CoinSpendPublicKeyP coin_pub;
+      struct TALER_PlanchetSecretsP ps;
+
+      if (GNUNET_OK !=
+          GNUNET_JSON_parse (args,
+                             setup_refresh_planchet_spec,
+                             NULL,
+                             NULL))
       {
         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                     "malformed op args\n");
@@ -206,7 +205,8 @@ run (void *cls,
         return;
       }
       TALER_planchet_setup_refresh (&transfer_secret,
-                                    coin_num_salt, &ps);
+                                    coin_index,
+                                    &ps);
       GNUNET_CRYPTO_eddsa_key_get_public (&ps.coin_priv.eddsa_priv,
                                           &coin_pub.eddsa_pub);
 

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