This commit is contained in:
Christian Grothoff 2021-11-05 21:37:46 +01:00
parent 2549fb6dc7
commit ebbc250f8b
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
2 changed files with 16 additions and 25 deletions

View File

@ -326,6 +326,7 @@ struct TALER_CoinSpendSignatureP
*/ */
struct TALER_DenominationBlindingKeyP struct TALER_DenominationBlindingKeyP
{ {
// FIXME: RSA migration!
/** /**
* Taler uses RSA for blind signatures. * Taler uses RSA for blind signatures.
*/ */
@ -986,6 +987,7 @@ struct TALER_PlanchetSecretsP
* The blinding key. * The blinding key.
*/ */
struct TALER_DenominationBlindingKeyP blinding_key; struct TALER_DenominationBlindingKeyP blinding_key;
// FIXME: RSA migration on generation!
}; };

View File

@ -238,39 +238,32 @@ test_signing (struct TALER_CRYPTO_DenominationHelper *dh)
struct TALER_BlindedDenominationSignature ds; struct TALER_BlindedDenominationSignature ds;
enum TALER_ErrorCode ec; enum TALER_ErrorCode ec;
bool success = false; bool success = false;
struct TALER_CoinPubHash m_hash; struct TALER_PlanchetSecretsP ps;
struct TALER_BlindingSecret bks; struct TALER_CoinPubHash c_hash;
GNUNET_assert (GNUNET_OK == TALER_planchet_setup_random (&ps);
TALER_blinding_secret_create (&bks,
TALER_DENOMINATION_RSA));
GNUNET_CRYPTO_hash ("Hello",
strlen ("Hello"),
&m_hash.hash);
for (unsigned int i = 0; i<MAX_KEYS; i++) for (unsigned int i = 0; i<MAX_KEYS; i++)
{ {
if (! keys[i].valid) if (! keys[i].valid)
continue; continue;
{ {
void *buf; struct TALER_PlanchetDetail pd;
size_t buf_size;
GNUNET_assert (GNUNET_YES == GNUNET_assert (GNUNET_YES ==
TALER_rsa_blind (&m_hash, TALER_planchet_prepare (&keys[i].denom_pub,
&bks.details.rsa_bks, &ps,
keys[i].denom_pub.details.rsa_public_key, &c_hash,
&buf, &pd));
&buf_size));
GNUNET_log (GNUNET_ERROR_TYPE_INFO, GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Requesting signature over %u bytes with key %s\n", "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)); GNUNET_h2s (&keys[i].h_denom_pub.hash));
ds = TALER_CRYPTO_helper_denom_sign (dh, ds = TALER_CRYPTO_helper_denom_sign (dh,
&keys[i].h_denom_pub, &keys[i].h_denom_pub,
buf, pd.coin_ev,
buf_size, pd.coin_ev_size,
&ec); &ec);
GNUNET_free (buf); GNUNET_free (pd.coin_ev);
} }
switch (ec) switch (ec)
{ {
@ -295,7 +288,7 @@ test_signing (struct TALER_CRYPTO_DenominationHelper *dh)
if (GNUNET_OK != if (GNUNET_OK !=
TALER_denom_sig_unblind (&rs, TALER_denom_sig_unblind (&rs,
&ds, &ds,
&bks, &ps.blinding_key.bks,
&keys[i].denom_pub)) &keys[i].denom_pub))
{ {
GNUNET_break (0); GNUNET_break (0);
@ -305,7 +298,7 @@ test_signing (struct TALER_CRYPTO_DenominationHelper *dh)
if (GNUNET_OK != if (GNUNET_OK !=
TALER_denom_pub_verify (&keys[i].denom_pub, TALER_denom_pub_verify (&keys[i].denom_pub,
&rs, &rs,
&m_hash)) &c_hash))
{ {
/* signature invalid */ /* signature invalid */
GNUNET_break (0); GNUNET_break (0);
@ -385,14 +378,10 @@ perf_signing (struct TALER_CRYPTO_DenominationHelper *dh)
{ {
struct TALER_BlindedDenominationSignature ds; struct TALER_BlindedDenominationSignature ds;
enum TALER_ErrorCode ec; enum TALER_ErrorCode ec;
struct TALER_CoinPubHash m_hash;
struct GNUNET_TIME_Relative duration; struct GNUNET_TIME_Relative duration;
struct TALER_PlanchetSecretsP ps; struct TALER_PlanchetSecretsP ps;
TALER_planchet_setup_random (&ps); TALER_planchet_setup_random (&ps);
GNUNET_CRYPTO_hash ("Hello",
strlen ("Hello"),
&m_hash.hash);
duration = GNUNET_TIME_UNIT_ZERO; duration = GNUNET_TIME_UNIT_ZERO;
for (unsigned int j = 0; j<NUM_SIGN_TESTS;) for (unsigned int j = 0; j<NUM_SIGN_TESTS;)
{ {