summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorLucien Heuzeveldt <lucienclaude.heuzeveldt@students.bfh.ch>2021-12-31 17:38:20 +0100
committerGian Demarmels <gian@demarmels.org>2022-02-04 15:33:10 +0100
commit75eff1524adef47cf9baa71b8426469c301548b2 (patch)
treecdca523e3a65ebfe52a9325560b009a6ff3cd707 /src/util
parentcf4fd36cc481d3af369a059df213ef00212046d5 (diff)
downloadexchange-75eff1524adef47cf9baa71b8426469c301548b2.tar.gz
exchange-75eff1524adef47cf9baa71b8426469c301548b2.tar.bz2
exchange-75eff1524adef47cf9baa71b8426469c301548b2.zip
clean up cs implementation
Diffstat (limited to 'src/util')
-rw-r--r--src/util/crypto.c50
1 files changed, 21 insertions, 29 deletions
diff --git a/src/util/crypto.c b/src/util/crypto.c
index 2d3099a44..84d20d6ba 100644
--- a/src/util/crypto.c
+++ b/src/util/crypto.c
@@ -262,11 +262,7 @@ TALER_planchet_setup_random (struct TALER_PlanchetSecretsP *ps,
GNUNET_break (0);
return;
case TALER_DENOMINATION_RSA:
- // TODO: replace with call to TALER_blinding_secret_create
- GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_STRONG,
- &ps->blinding_key.rsa_bks,
- sizeof (struct
- GNUNET_CRYPTO_RsaBlindingKeySecret));
+ TALER_blinding_secret_create (&ps->blinding_key, cipher);
return;
case TALER_DENOMINATION_CS:
// Will be set in a later stage for Clause Blind Schnorr Scheme
@@ -304,22 +300,20 @@ TALER_planchet_prepare (const struct TALER_DenominationPublicKey *dk,
}
break;
case TALER_DENOMINATION_CS:
+ if (GNUNET_OK !=
+ TALER_denom_blind (dk,
+ &ps->blinding_key,
+ NULL, /* FIXME-Oec */
+ &coin_pub,
+ c_hash,
+ &pd->blinded_planchet,
+ &ps->cs_r_pub,
+ &ps->cs_r_pub_blinded))
{
- if (GNUNET_OK !=
- TALER_denom_blind (dk,
- &ps->blinding_key,
- NULL, /* FIXME-Oec */
- &coin_pub,
- c_hash,
- &pd->blinded_planchet,
- &ps->cs_r_pub,
- &ps->cs_r_pub_blinded))
- {
- GNUNET_break (0);
- return GNUNET_SYSERR;
- }
- break;
+ GNUNET_break (0);
+ return GNUNET_SYSERR;
}
+ break;
default:
GNUNET_break (0);
return GNUNET_SYSERR;
@@ -355,17 +349,15 @@ TALER_planchet_to_coin (const struct TALER_DenominationPublicKey *dk,
}
break;
case TALER_DENOMINATION_CS:
+ if (GNUNET_OK !=
+ TALER_denom_sig_unblind (&sig,
+ blind_sig,
+ &ps->blinding_key,
+ dk,
+ &ps->cs_r_pub_blinded))
{
- if (GNUNET_OK !=
- TALER_denom_sig_unblind (&sig,
- blind_sig,
- &ps->blinding_key,
- dk,
- &ps->cs_r_pub_blinded))
- {
- GNUNET_break_op (0);
- return GNUNET_SYSERR;
- }
+ GNUNET_break_op (0);
+ return GNUNET_SYSERR;
}
break;
default: