aboutsummaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_link.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-12-25 15:39:01 +0100
committerChristian Grothoff <christian@grothoff.org>2021-12-25 15:39:01 +0100
commitf6ecb6c895879ee4b5db3061593feaad3456d1c8 (patch)
tree81be844db2e275015592ca70994e90be013c9c87 /src/lib/exchange_api_link.c
parent84c9adf5a6a243bd583f2144176f80708fa6a884 (diff)
-eliminate redundant hash operation on link signatures
Diffstat (limited to 'src/lib/exchange_api_link.c')
-rw-r--r--src/lib/exchange_api_link.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/exchange_api_link.c b/src/lib/exchange_api_link.c
index 55d3bdb66..ec085b533 100644
--- a/src/lib/exchange_api_link.c
+++ b/src/lib/exchange_api_link.c
@@ -138,6 +138,7 @@ parse_link_coin (const struct TALER_EXCHANGE_LinkHandle *lh,
struct TALER_PlanchetDetail pd;
struct TALER_CoinPubHash c_hash;
struct TALER_CoinSpendPublicKeyP old_coin_pub;
+ struct TALER_BlindedCoinHash coin_envelope_hash;
GNUNET_CRYPTO_eddsa_key_get_public (&lh->coin_priv.eddsa_priv,
&old_coin_pub.eddsa_pub);
@@ -151,11 +152,14 @@ parse_link_coin (const struct TALER_EXCHANGE_LinkHandle *lh,
GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
+ GNUNET_CRYPTO_hash (pd.coin_ev,
+ pd.coin_ev_size,
+ &coin_envelope_hash.hash);
+
if (GNUNET_OK !=
TALER_wallet_link_verify (&pd.denom_pub_hash,
trans_pub,
- pd.coin_ev,
- pd.coin_ev_size,
+ &coin_envelope_hash,
&old_coin_pub,
&link_sig))
{