From 03fd154a69212df740cf3b09567a1bb081b64873 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 4 Feb 2022 19:29:52 +0100 Subject: messing with CS/RSA fixes --- src/util/crypto.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'src/util/crypto.c') diff --git a/src/util/crypto.c b/src/util/crypto.c index fee3f31e..18f809e3 100644 --- a/src/util/crypto.c +++ b/src/util/crypto.c @@ -245,19 +245,23 @@ TALER_planchet_blinding_secret_create (struct TALER_PlanchetSecretsP *ps, } -/** - * @brief setup a random planchet - * In Case of RSA planchet, the bks gets set - * In Case of Clause Schnorr this will be set in future - */ void -TALER_planchet_setup_random (struct TALER_PlanchetSecretsP *ps, - const struct - TALER_ExchangeWithdrawValues *alg_values) +TALER_planchet_setup_coin_priv ( + struct TALER_CoinSpendPrivateKeyP *coin_priv) { GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_STRONG, - &ps->coin_priv, - sizeof (struct TALER_CoinSpendPrivateKeyP)); + coin_priv, + sizeof (*coin_priv)); + // FIXME-jeff/dold: Clamping? +} + + +void +TALER_planchet_setup_random ( + struct TALER_PlanchetSecretsP *ps, + const struct TALER_ExchangeWithdrawValues *alg_values) +{ + TALER_planchet_setup_coin_priv (&ps->coin_priv); switch (alg_values->cipher) { case TALER_DENOMINATION_INVALID: -- cgit v1.2.3