summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2021-11-05 21:37:46 +0100
committerChristian Grothoff <grothoff@gnunet.org>2021-11-05 21:37:46 +0100
commitebbc250f8b86de14a5684addade285cb5d1ad9ac (patch)
tree43fb26307a3cb6257e3460db93eb13d9d973413b
parent2549fb6dc7b08c03196ef40d8326d10e661a5379 (diff)
downloadexchange-ebbc250f8b86de14a5684addade285cb5d1ad9ac.tar.gz
exchange-ebbc250f8b86de14a5684addade285cb5d1ad9ac.tar.bz2
exchange-ebbc250f8b86de14a5684addade285cb5d1ad9ac.zip
-brks
-rw-r--r--src/include/taler_crypto_lib.h2
-rw-r--r--src/util/test_helper_rsa.c41
2 files changed, 17 insertions, 26 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index 06247689f..a948d98e9 100644
--- a/src/include/taler_crypto_lib.h
+++ b/src/include/taler_crypto_lib.h
@@ -326,6 +326,7 @@ struct TALER_CoinSpendSignatureP
*/
struct TALER_DenominationBlindingKeyP
{
+ // FIXME: RSA migration!
/**
* Taler uses RSA for blind signatures.
*/
@@ -986,6 +987,7 @@ struct TALER_PlanchetSecretsP
* The blinding key.
*/
struct TALER_DenominationBlindingKeyP blinding_key;
+ // FIXME: RSA migration on generation!
};
diff --git a/src/util/test_helper_rsa.c b/src/util/test_helper_rsa.c
index 5dedf8f78..87e58bd3f 100644
--- a/src/util/test_helper_rsa.c
+++ b/src/util/test_helper_rsa.c
@@ -238,39 +238,32 @@ test_signing (struct TALER_CRYPTO_DenominationHelper *dh)
struct TALER_BlindedDenominationSignature ds;
enum TALER_ErrorCode ec;
bool success = false;
- struct TALER_CoinPubHash m_hash;
- struct TALER_BlindingSecret bks;
-
- GNUNET_assert (GNUNET_OK ==
- TALER_blinding_secret_create (&bks,
- TALER_DENOMINATION_RSA));
- GNUNET_CRYPTO_hash ("Hello",
- strlen ("Hello"),
- &m_hash.hash);
+ struct TALER_PlanchetSecretsP ps;
+ struct TALER_CoinPubHash c_hash;
+
+ TALER_planchet_setup_random (&ps);
for (unsigned int i = 0; i<MAX_KEYS; i++)
{
if (! keys[i].valid)
continue;
{
- void *buf;
- size_t buf_size;
+ struct TALER_PlanchetDetail pd;
GNUNET_assert (GNUNET_YES ==
- TALER_rsa_blind (&m_hash,
- &bks.details.rsa_bks,
- keys[i].denom_pub.details.rsa_public_key,
- &buf,
- &buf_size));
+ TALER_planchet_prepare (&keys[i].denom_pub,
+ &ps,
+ &c_hash,
+ &pd));
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Requesting signature over %u bytes with key %s\n",
- (unsigned int) buf_size,
+ (unsigned int) pd.coin_ev_size,
GNUNET_h2s (&keys[i].h_denom_pub.hash));
ds = TALER_CRYPTO_helper_denom_sign (dh,
&keys[i].h_denom_pub,
- buf,
- buf_size,
+ pd.coin_ev,
+ pd.coin_ev_size,
&ec);
- GNUNET_free (buf);
+ GNUNET_free (pd.coin_ev);
}
switch (ec)
{
@@ -295,7 +288,7 @@ test_signing (struct TALER_CRYPTO_DenominationHelper *dh)
if (GNUNET_OK !=
TALER_denom_sig_unblind (&rs,
&ds,
- &bks,
+ &ps.blinding_key.bks,
&keys[i].denom_pub))
{
GNUNET_break (0);
@@ -305,7 +298,7 @@ test_signing (struct TALER_CRYPTO_DenominationHelper *dh)
if (GNUNET_OK !=
TALER_denom_pub_verify (&keys[i].denom_pub,
&rs,
- &m_hash))
+ &c_hash))
{
/* signature invalid */
GNUNET_break (0);
@@ -385,14 +378,10 @@ perf_signing (struct TALER_CRYPTO_DenominationHelper *dh)
{
struct TALER_BlindedDenominationSignature ds;
enum TALER_ErrorCode ec;
- struct TALER_CoinPubHash m_hash;
struct GNUNET_TIME_Relative duration;
struct TALER_PlanchetSecretsP ps;
TALER_planchet_setup_random (&ps);
- GNUNET_CRYPTO_hash ("Hello",
- strlen ("Hello"),
- &m_hash.hash);
duration = GNUNET_TIME_UNIT_ZERO;
for (unsigned int j = 0; j<NUM_SIGN_TESTS;)
{