gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: -clean up crypto


From: gnunet
Subject: [taler-exchange] branch master updated: -clean up crypto
Date: Wed, 09 Feb 2022 10:49:12 +0100

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

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 12290af8 -clean up crypto
12290af8 is described below

commit 12290af8450497ea2ec82e71d566e792132c21ef
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Feb 9 10:49:10 2022 +0100

    -clean up crypto
---
 src/include/taler_crypto_lib.h |  6 +++++-
 src/util/crypto.c              |  2 ++
 src/util/denom.c               | 14 ++++++++++++++
 src/util/test_helper_rsa.c     |  2 ++
 4 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index 89aa6ba8..24433373 100644
--- a/src/include/taler_crypto_lib.h
+++ b/src/include/taler_crypto_lib.h
@@ -1146,10 +1146,12 @@ TALER_denom_sign_blinded (struct 
TALER_BlindedDenominationSignature *denom_sig,
  * Unblind blinded signature.
  *
  * @param[out] denom_sig where to write the unblinded signature
+ * @param dk denomination public key
  * @param bdenom_sig the blinded signature
  * @param bks blinding secret to use
- * @param denom_pub public key used for signing
+ * @param c_hash hash of the coin's public key for verification of the 
signature
  * @param alg_values algorithm specific values
+ * @param denom_pub public key used for signing
  * @return #GNUNET_OK on success
  */
 enum GNUNET_GenericReturnValue
@@ -1157,6 +1159,8 @@ TALER_denom_sig_unblind (
   struct TALER_DenominationSignature *denom_sig,
   const struct TALER_BlindedDenominationSignature *bdenom_sig,
   const union TALER_DenominationBlindingKeyP *bks,
+  const struct TALER_CoinPubHash *c_hash,
+  const struct TALER_ExchangeWithdrawValues *alg_values,
   const struct TALER_DenominationPublicKey *denom_pub);
 
 
diff --git a/src/util/crypto.c b/src/util/crypto.c
index b80cb53c..5a7dbfee 100644
--- a/src/util/crypto.c
+++ b/src/util/crypto.c
@@ -398,6 +398,8 @@ TALER_planchet_to_coin (
       TALER_denom_sig_unblind (&coin->sig,
                                blind_sig,
                                bks,
+                               c_hash,
+                               alg_values,
                                dk))
   {
     GNUNET_break_op (0);
diff --git a/src/util/denom.c b/src/util/denom.c
index 4382a9df..b0982c00 100644
--- a/src/util/denom.c
+++ b/src/util/denom.c
@@ -170,6 +170,8 @@ TALER_denom_sig_unblind (
   struct TALER_DenominationSignature *denom_sig,
   const struct TALER_BlindedDenominationSignature *bdenom_sig,
   const union TALER_DenominationBlindingKeyP *bks,
+  const struct TALER_CoinPubHash *c_hash,
+  const struct TALER_ExchangeWithdrawValues *alg_values,
   const struct TALER_DenominationPublicKey *denom_pub)
 {
   if (bdenom_sig->cipher != denom_pub->cipher)
@@ -198,9 +200,21 @@ TALER_denom_sig_unblind (
   case TALER_DENOMINATION_CS:
     {
       struct GNUNET_CRYPTO_CsBlindingSecret bs[2];
+      struct GNUNET_CRYPTO_CsC c[2];
+      struct TALER_DenominationCSPublicRPairP r_pub_blind;
 
       GNUNET_CRYPTO_cs_blinding_secrets_derive (&bks->nonce,
                                                 bs);
+      GNUNET_CRYPTO_cs_calc_blinded_c (
+        bs,
+        alg_values->details.cs_values.r_pub_pair.r_pub,
+        &denom_pub->details.cs_public_key,
+        &c_hash->hash,
+        sizeof(struct GNUNET_HashCode),
+        c,
+        r_pub_blind.r_pub);
+      denom_sig->details.cs_signature.r_point
+        = r_pub_blind.r_pub[bdenom_sig->details.blinded_cs_answer.b];
       GNUNET_CRYPTO_cs_unblind 
(&bdenom_sig->details.blinded_cs_answer.s_scalar,
                                 &bs[bdenom_sig->details.blinded_cs_answer.b],
                                 &denom_sig->details.cs_signature.s_scalar);
diff --git a/src/util/test_helper_rsa.c b/src/util/test_helper_rsa.c
index f51861d4..f3a52576 100644
--- a/src/util/test_helper_rsa.c
+++ b/src/util/test_helper_rsa.c
@@ -341,6 +341,8 @@ test_signing (struct TALER_CRYPTO_RsaDenominationHelper *dh)
             TALER_denom_sig_unblind (&rs,
                                      &ds,
                                      &bks,
+                                     &c_hash,
+                                     &alg_values,
                                      &keys[i].denom_pub))
         {
           GNUNET_break (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]