gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] 76/130: -brks


From: gnunet
Subject: [taler-exchange] 76/130: -brks
Date: Wed, 17 Nov 2021 12:25:24 +0100

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

grothoff pushed a commit to branch master
in repository exchange.

commit ebbc250f8b86de14a5684addade285cb5d1ad9ac
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Fri Nov 5 21:37:46 2021 +0100

    -brks
---
 src/include/taler_crypto_lib.h |  2 ++
 src/util/test_helper_rsa.c     | 41 +++++++++++++++--------------------------
 2 files changed, 17 insertions(+), 26 deletions(-)

diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index 06247689..a948d98e 100644
--- a/src/include/taler_crypto_lib.h
+++ b/src/include/taler_crypto_lib.h
@@ -326,6 +326,7 @@ struct TALER_CoinSpendSignatureP
  */
 struct TALER_DenominationBlindingKeyP
 {
+  // FIXME: RSA migration!
   /**
    * Taler uses RSA for blind signatures.
    */
@@ -986,6 +987,7 @@ struct TALER_PlanchetSecretsP
    * The blinding key.
    */
   struct TALER_DenominationBlindingKeyP blinding_key;
+  // FIXME: RSA migration on generation!
 
 };
 
diff --git a/src/util/test_helper_rsa.c b/src/util/test_helper_rsa.c
index 5dedf8f7..87e58bd3 100644
--- a/src/util/test_helper_rsa.c
+++ b/src/util/test_helper_rsa.c
@@ -238,39 +238,32 @@ test_signing (struct TALER_CRYPTO_DenominationHelper *dh)
   struct TALER_BlindedDenominationSignature ds;
   enum TALER_ErrorCode ec;
   bool success = false;
-  struct TALER_CoinPubHash m_hash;
-  struct TALER_BlindingSecret bks;
-
-  GNUNET_assert (GNUNET_OK ==
-                 TALER_blinding_secret_create (&bks,
-                                               TALER_DENOMINATION_RSA));
-  GNUNET_CRYPTO_hash ("Hello",
-                      strlen ("Hello"),
-                      &m_hash.hash);
+  struct TALER_PlanchetSecretsP ps;
+  struct TALER_CoinPubHash c_hash;
+
+  TALER_planchet_setup_random (&ps);
   for (unsigned int i = 0; i<MAX_KEYS; i++)
   {
     if (! keys[i].valid)
       continue;
     {
-      void *buf;
-      size_t buf_size;
+      struct TALER_PlanchetDetail pd;
 
       GNUNET_assert (GNUNET_YES ==
-                     TALER_rsa_blind (&m_hash,
-                                      &bks.details.rsa_bks,
-                                      keys[i].denom_pub.details.rsa_public_key,
-                                      &buf,
-                                      &buf_size));
+                     TALER_planchet_prepare (&keys[i].denom_pub,
+                                             &ps,
+                                             &c_hash,
+                                             &pd));
       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                   "Requesting signature over %u bytes with key %s\n",
-                  (unsigned int) buf_size,
+                  (unsigned int) pd.coin_ev_size,
                   GNUNET_h2s (&keys[i].h_denom_pub.hash));
       ds = TALER_CRYPTO_helper_denom_sign (dh,
                                            &keys[i].h_denom_pub,
-                                           buf,
-                                           buf_size,
+                                           pd.coin_ev,
+                                           pd.coin_ev_size,
                                            &ec);
-      GNUNET_free (buf);
+      GNUNET_free (pd.coin_ev);
     }
     switch (ec)
     {
@@ -295,7 +288,7 @@ test_signing (struct TALER_CRYPTO_DenominationHelper *dh)
         if (GNUNET_OK !=
             TALER_denom_sig_unblind (&rs,
                                      &ds,
-                                     &bks,
+                                     &ps.blinding_key.bks,
                                      &keys[i].denom_pub))
         {
           GNUNET_break (0);
@@ -305,7 +298,7 @@ test_signing (struct TALER_CRYPTO_DenominationHelper *dh)
         if (GNUNET_OK !=
             TALER_denom_pub_verify (&keys[i].denom_pub,
                                     &rs,
-                                    &m_hash))
+                                    &c_hash))
         {
           /* signature invalid */
           GNUNET_break (0);
@@ -385,14 +378,10 @@ perf_signing (struct TALER_CRYPTO_DenominationHelper *dh)
 {
   struct TALER_BlindedDenominationSignature ds;
   enum TALER_ErrorCode ec;
-  struct TALER_CoinPubHash m_hash;
   struct GNUNET_TIME_Relative duration;
   struct TALER_PlanchetSecretsP ps;
 
   TALER_planchet_setup_random (&ps);
-  GNUNET_CRYPTO_hash ("Hello",
-                      strlen ("Hello"),
-                      &m_hash.hash);
   duration = GNUNET_TIME_UNIT_ZERO;
   for (unsigned int j = 0; j<NUM_SIGN_TESTS;)
   {

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