aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_helper_rsa.c
diff options
context:
space:
mode:
authorGian Demarmels <gian@demarmels.org>2022-02-05 23:12:21 +0100
committerGian Demarmels <gian@demarmels.org>2022-02-05 23:12:21 +0100
commitb280b1db0456e883c9976579ea929ed47cbbb7f5 (patch)
tree93d50e7d2f9da275acb549d799b70a9a07a42cff /src/util/test_helper_rsa.c
parent718ad3996f00a9aee3302c5920f6ea7d0b3a36a6 (diff)
downloadexchange-b280b1db0456e883c9976579ea929ed47cbbb7f5.tar.xz
fix src/util
Diffstat (limited to 'src/util/test_helper_rsa.c')
-rw-r--r--src/util/test_helper_rsa.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/util/test_helper_rsa.c b/src/util/test_helper_rsa.c
index f9f1a860d..f51861d41 100644
--- a/src/util/test_helper_rsa.c
+++ b/src/util/test_helper_rsa.c
@@ -270,10 +270,17 @@ test_signing (struct TALER_CRYPTO_RsaDenominationHelper *dh)
struct TALER_PlanchetSecretsP ps;
struct TALER_ExchangeWithdrawValues alg_values;
struct TALER_CoinPubHash c_hash;
+ struct TALER_CoinSpendPrivateKeyP coin_priv;
+ union TALER_DenominationBlindingKeyP bks;
+
+ GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_STRONG,
+ &ps,
+ sizeof (ps));
alg_values.cipher = TALER_DENOMINATION_RSA;
- TALER_planchet_setup_random (&ps,
- &alg_values);
+ TALER_planchet_setup_coin_priv (&ps, &alg_values, &coin_priv);
+ TALER_planchet_blinding_secret_create (&ps, &alg_values, &bks);
+
for (unsigned int i = 0; i<MAX_KEYS; i++)
{
if (! keys[i].valid)
@@ -287,7 +294,8 @@ test_signing (struct TALER_CRYPTO_RsaDenominationHelper *dh)
GNUNET_assert (GNUNET_YES ==
TALER_planchet_prepare (&keys[i].denom_pub,
&alg_values,
- &ps,
+ &bks,
+ &coin_priv,
&c_hash,
&pd));
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -332,7 +340,7 @@ test_signing (struct TALER_CRYPTO_RsaDenominationHelper *dh)
if (GNUNET_OK !=
TALER_denom_sig_unblind (&rs,
&ds,
- &ps.blinding_key,
+ &bks,
&keys[i].denom_pub))
{
GNUNET_break (0);
@@ -429,11 +437,18 @@ perf_signing (struct TALER_CRYPTO_RsaDenominationHelper *dh,
enum TALER_ErrorCode ec;
struct GNUNET_TIME_Relative duration;
struct TALER_PlanchetSecretsP ps;
+ struct TALER_CoinSpendPrivateKeyP coin_priv;
+ union TALER_DenominationBlindingKeyP bks;
struct TALER_ExchangeWithdrawValues alg_values;
+ GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_STRONG,
+ &ps,
+ sizeof (ps));
+
alg_values.cipher = TALER_DENOMINATION_RSA;
- TALER_planchet_setup_random (&ps,
- &alg_values);
+ TALER_planchet_setup_coin_priv (&ps, &alg_values, &coin_priv);
+ TALER_planchet_blinding_secret_create (&ps, &alg_values, &bks);
+
duration = GNUNET_TIME_UNIT_ZERO;
TALER_CRYPTO_helper_rsa_poll (dh);
for (unsigned int j = 0; j<NUM_SIGN_PERFS;)
@@ -461,7 +476,8 @@ perf_signing (struct TALER_CRYPTO_RsaDenominationHelper *dh,
GNUNET_assert (GNUNET_YES ==
TALER_planchet_prepare (&keys[i].denom_pub,
&alg_values,
- &ps,
+ &bks,
+ &coin_priv,
&c_hash,
&pd));
/* use this key as long as it works */