summaryrefslogtreecommitdiff
path: root/src/util/crypto.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-02-06 19:53:23 +0100
committerChristian Grothoff <christian@grothoff.org>2022-02-06 19:53:23 +0100
commit62d8368b1b89d8b2259dee4abd1b1970ac385d4a (patch)
treeb6dad774cd5884cfc3ad89bc965989a43ef7e842 /src/util/crypto.c
parent66abbcac3f9431862ec68cf8f85781b51f2633be (diff)
downloadexchange-62d8368b1b89d8b2259dee4abd1b1970ac385d4a.tar.gz
exchange-62d8368b1b89d8b2259dee4abd1b1970ac385d4a.tar.bz2
exchange-62d8368b1b89d8b2259dee4abd1b1970ac385d4a.zip
-fix more FTBFS issues
Diffstat (limited to 'src/util/crypto.c')
-rw-r--r--src/util/crypto.c40
1 files changed, 30 insertions, 10 deletions
diff --git a/src/util/crypto.c b/src/util/crypto.c
index 37810d40d..b315cd31a 100644
--- a/src/util/crypto.c
+++ b/src/util/crypto.c
@@ -195,16 +195,36 @@ TALER_cs_withdraw_nonce_derive (const struct
struct TALER_CsNonce *nonce)
{
GNUNET_assert (GNUNET_YES ==
- GNUNET_CRYPTO_hkdf (nonce,
- sizeof (*nonce),
- GCRY_MD_SHA512,
- GCRY_MD_SHA256,
- "n",
- strlen ("n"),
- ps,
- sizeof(*ps),
- NULL,
- 0));
+ GNUNET_CRYPTO_kdf (nonce,
+ sizeof (*nonce),
+ "n",
+ strlen ("n"),
+ ps,
+ sizeof(*ps),
+ NULL,
+ 0));
+}
+
+
+void
+TALER_cs_refresh_nonce_derive (
+ const struct TALER_PlanchetSecretsP *ps,
+ uint32_t coin_num_salt,
+ struct TALER_CsNonce *nonce)
+{
+ uint32_t be_salt = htonl (coin_num_salt);
+
+ GNUNET_assert (GNUNET_YES ==
+ GNUNET_CRYPTO_kdf (nonce,
+ sizeof (*nonce),
+ &be_salt,
+ sizeof (be_salt),
+ "refresh-n", // FIXME: value used in spec?
+ strlen ("refresh-n"),
+ ps,
+ sizeof(*ps),
+ NULL,
+ 0));
}