aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/crypto.c23
-rw-r--r--src/util/test_crypto.c6
-rw-r--r--src/util/test_helper_cs.c18
3 files changed, 15 insertions, 32 deletions
diff --git a/src/util/crypto.c b/src/util/crypto.c
index 445b820a..664d75aa 100644
--- a/src/util/crypto.c
+++ b/src/util/crypto.c
@@ -208,9 +208,8 @@ TALER_cs_withdraw_nonce_derive (const struct
void
-TALER_blinding_secret_create (union TALER_DenominationBlindingKeyP *bs,
- enum TALER_DenominationCipher cipher,
- ...)
+TALER_planchet_blinding_secret_create (struct TALER_PlanchetSecretsP *ps,
+ enum TALER_DenominationCipher cipher)
{
switch (cipher)
{
@@ -219,23 +218,15 @@ TALER_blinding_secret_create (union TALER_DenominationBlindingKeyP *bs,
return;
case TALER_DENOMINATION_RSA:
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_STRONG,
- &bs->rsa_bks,
+ &ps->blinding_key.rsa_bks,
sizeof (struct
GNUNET_CRYPTO_RsaBlindingKeySecret));
return;
case TALER_DENOMINATION_CS:
{
- va_list ap;
- va_start (ap, cipher);
- struct TALER_CoinSpendPrivateKeyP *coin_priv;
- struct TALER_DenominationCsPublicR *r_pub;
- coin_priv = va_arg (ap, struct TALER_CoinSpendPrivateKeyP *);
- r_pub = va_arg (ap, struct TALER_DenominationCsPublicR *);
-
- cs_blinding_seed_derive (coin_priv,
- r_pub->r_pub,
- &bs->nonce);
- va_end (ap);
+ cs_blinding_seed_derive (&ps->coin_priv,
+ ps->cs_r_pub.r_pub,
+ &ps->blinding_key.nonce);
return;
}
default:
@@ -262,7 +253,7 @@ TALER_planchet_setup_random (struct TALER_PlanchetSecretsP *ps,
GNUNET_break (0);
return;
case TALER_DENOMINATION_RSA:
- TALER_blinding_secret_create (&ps->blinding_key, cipher);
+ TALER_planchet_blinding_secret_create (ps, TALER_DENOMINATION_RSA);
return;
case TALER_DENOMINATION_CS:
// Will be set in a later stage for Clause Blind Schnorr Scheme
diff --git a/src/util/test_crypto.c b/src/util/test_crypto.c
index 513fbbad..9ddd6cfd 100644
--- a/src/util/test_crypto.c
+++ b/src/util/test_crypto.c
@@ -164,10 +164,8 @@ test_planchets_cs (void)
&dk_priv,
&ps.cs_r_pub));
// TODO: eliminate r_pubs parameter
- TALER_blinding_secret_create (&ps.blinding_key,
- TALER_DENOMINATION_CS,
- &ps.coin_priv,
- &ps.cs_r_pub);
+ TALER_planchet_blinding_secret_create (&ps,
+ TALER_DENOMINATION_CS);
GNUNET_assert (GNUNET_OK ==
TALER_planchet_prepare (&dk_pub,
diff --git a/src/util/test_helper_cs.c b/src/util/test_helper_cs.c
index 501a398f..8ce380d4 100644
--- a/src/util/test_helper_cs.c
+++ b/src/util/test_helper_cs.c
@@ -319,10 +319,8 @@ test_r_derive (struct TALER_CRYPTO_CsDenominationHelper *dh)
"Received valid R for key %s\n",
GNUNET_h2s (&keys[i].h_cs.hash));
- TALER_blinding_secret_create (&ps.blinding_key,
- TALER_DENOMINATION_CS,
- &ps.coin_priv,
- &ps.cs_r_pub);
+ TALER_planchet_blinding_secret_create (&ps,
+ TALER_DENOMINATION_CS);
GNUNET_assert (GNUNET_OK ==
TALER_planchet_prepare (&keys[i].denom_pub,
&ps,
@@ -426,10 +424,8 @@ test_signing (struct TALER_CRYPTO_CsDenominationHelper *dh)
details.
cs_blinded_planchet.nonce,
&ec);
- TALER_blinding_secret_create (&ps.blinding_key,
- TALER_DENOMINATION_CS,
- &ps.coin_priv,
- &ps.cs_r_pub);
+ TALER_planchet_blinding_secret_create (&ps,
+ TALER_DENOMINATION_CS);
GNUNET_assert (GNUNET_YES ==
TALER_planchet_prepare (&keys[i].denom_pub,
@@ -614,10 +610,8 @@ perf_signing (struct TALER_CRYPTO_CsDenominationHelper *dh,
details.
cs_blinded_planchet.nonce,
&ec);
- TALER_blinding_secret_create (&ps.blinding_key,
- TALER_DENOMINATION_CS,
- &ps.coin_priv,
- &ps.cs_r_pub);
+ TALER_planchet_blinding_secret_create (&ps,
+ TALER_DENOMINATION_CS);
GNUNET_assert (GNUNET_YES ==
TALER_planchet_prepare (&keys[i].denom_pub,