From a491a4709a6444868b8881067c99d6ccc15554c2 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 31 Oct 2017 12:38:14 +0100 Subject: [PATCH] rename: TALER_FreshCoinP -> TALER_PlanchetSecretsP, and TALER_setup_fresh_coin -> TALER_setup_planchet --- src/exchange-lib/exchange_api_refresh.c | 30 +++++++++---------- src/exchange-lib/exchange_api_refresh_link.c | 4 +-- .../taler-exchange-httpd_refresh_reveal.c | 4 +-- src/include/taler_crypto_lib.h | 8 ++--- src/util/crypto.c | 4 +-- src/util/test_crypto.c | 10 +++---- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/exchange-lib/exchange_api_refresh.c b/src/exchange-lib/exchange_api_refresh.c index 79381f3bd..51273160d 100644 --- a/src/exchange-lib/exchange_api_refresh.c +++ b/src/exchange-lib/exchange_api_refresh.c @@ -117,7 +117,7 @@ struct MeltDataP 1) struct MeltedCoinP melted_coins[num_melted_coins]; 2) struct TALER_EXCHANGE_DenomPublicKey fresh_pks[num_fresh_coins]; 3) TALER_CNC_KAPPA times: - 3a) struct TALER_FreshCoinP fresh_coins[num_fresh_coins]; + 3a) struct TALER_PlanchetSecretsP fresh_coins[num_fresh_coins]; */ }; @@ -204,7 +204,7 @@ struct MeltData * Arrays of @e num_fresh_coins with information about the fresh * coins to be created, for each cut-and-choose dimension. */ - struct TALER_FreshCoinP *fresh_coins[TALER_CNC_KAPPA]; + struct TALER_PlanchetSecretsP *fresh_coins[TALER_CNC_KAPPA]; }; @@ -490,15 +490,15 @@ deserialize_denomination_key (struct TALER_DenominationPublicKey *dk, * @a buf is NULL, number of bytes required */ static size_t -serialize_fresh_coin (const struct TALER_FreshCoinP *fc, +serialize_fresh_coin (const struct TALER_PlanchetSecretsP *fc, char *buf, size_t off) { if (NULL != buf) memcpy (&buf[off], fc, - sizeof (struct TALER_FreshCoinP)); - return sizeof (struct TALER_FreshCoinP); + sizeof (struct TALER_PlanchetSecretsP)); + return sizeof (struct TALER_PlanchetSecretsP); } @@ -512,12 +512,12 @@ serialize_fresh_coin (const struct TALER_FreshCoinP *fc, * @return number of bytes read from @a buf, 0 on error */ static size_t -deserialize_fresh_coin (struct TALER_FreshCoinP *fc, +deserialize_fresh_coin (struct TALER_PlanchetSecretsP *fc, const char *buf, size_t size, int *ok) { - if (size < sizeof (struct TALER_FreshCoinP)) + if (size < sizeof (struct TALER_PlanchetSecretsP)) { GNUNET_break (0); *ok = GNUNET_NO; @@ -525,8 +525,8 @@ deserialize_fresh_coin (struct TALER_FreshCoinP *fc, } memcpy (fc, buf, - sizeof (struct TALER_FreshCoinP)); - return sizeof (struct TALER_FreshCoinP); + sizeof (struct TALER_PlanchetSecretsP)); + return sizeof (struct TALER_PlanchetSecretsP); } @@ -617,7 +617,7 @@ deserialize_melt_data (const char *buf, struct TALER_DenominationPublicKey); for (i=0;ifresh_coins[i] = GNUNET_new_array (md->num_fresh_coins, - struct TALER_FreshCoinP); + struct TALER_PlanchetSecretsP); off = sizeof (struct MeltDataP); ok = GNUNET_YES; off += deserialize_melted_coin (&md->melted_coin, @@ -753,10 +753,10 @@ TALER_EXCHANGE_refresh_prepare (const struct TALER_CoinSpendPrivateKeyP *melt_pr for (i=0;inum_fresh_coins;i++) { - const struct TALER_FreshCoinP *fc = &md->fresh_coins[j][i]; + const struct TALER_PlanchetSecretsP *fc = &md->fresh_coins[j][i]; struct TALER_CoinSpendPublicKeyP coin_pub; struct GNUNET_HashCode coin_hash; char *coin_ev; /* blinded message to be signed (in envelope) for each coin */ @@ -1506,7 +1506,7 @@ refresh_reveal_ok (struct TALER_EXCHANGE_RefreshRevealHandle *rrh, } for (i=0;imd->num_fresh_coins;i++) { - const struct TALER_FreshCoinP *fc; + const struct TALER_PlanchetSecretsP *fc; struct TALER_DenominationPublicKey *pk; json_t *jsonai; struct GNUNET_CRYPTO_RsaSignature *blind_sig; diff --git a/src/exchange-lib/exchange_api_refresh_link.c b/src/exchange-lib/exchange_api_refresh_link.c index 5b7f68674..2c2340eff 100644 --- a/src/exchange-lib/exchange_api_refresh_link.c +++ b/src/exchange-lib/exchange_api_refresh_link.c @@ -99,7 +99,7 @@ parse_refresh_link_coin (const struct TALER_EXCHANGE_RefreshLinkHandle *rlh, GNUNET_JSON_spec_end() }; struct TALER_TransferSecretP secret; - struct TALER_FreshCoinP fc; + struct TALER_PlanchetSecretsP fc; /* parse reply */ if (GNUNET_OK != @@ -114,7 +114,7 @@ parse_refresh_link_coin (const struct TALER_EXCHANGE_RefreshLinkHandle *rlh, TALER_link_recover_transfer_secret (trans_pub, &rlh->coin_priv, &secret); - TALER_setup_fresh_coin (&secret, + TALER_setup_planchet (&secret, coin_num, &fc); diff --git a/src/exchange/taler-exchange-httpd_refresh_reveal.c b/src/exchange/taler-exchange-httpd_refresh_reveal.c index 5d857fcae..57ced9bf6 100644 --- a/src/exchange/taler-exchange-httpd_refresh_reveal.c +++ b/src/exchange/taler-exchange-httpd_refresh_reveal.c @@ -171,13 +171,13 @@ check_commitment (struct MHD_Connection *connection, /* Check that the commitments for all new coins were correct */ for (unsigned int j = 0; j < num_newcoins; j++) { - struct TALER_FreshCoinP fc; + struct TALER_PlanchetSecretsP fc; struct TALER_CoinSpendPublicKeyP coin_pub; struct GNUNET_HashCode h_msg; char *buf; size_t buf_len; - TALER_setup_fresh_coin (&transfer_secret, + TALER_setup_planchet (&transfer_secret, j, &fc); GNUNET_CRYPTO_eddsa_key_get_public (&fc.coin_priv.eddsa_priv, diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index 9e9352f54..90f6f1407 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -522,7 +522,7 @@ TALER_link_recover_transfer_secret (const struct TALER_TransferPublicKeyP *trans * Header for serializations of coin-specific information about the * fresh coins we generate during a melt. */ -struct TALER_FreshCoinP +struct TALER_PlanchetSecretsP { /** @@ -548,9 +548,9 @@ struct TALER_FreshCoinP * @param[out] fc value to initialize */ void -TALER_setup_fresh_coin (const struct TALER_TransferSecretP *secret_seed, - unsigned int coin_num_salt, - struct TALER_FreshCoinP *fc); +TALER_setup_planchet (const struct TALER_TransferSecretP *secret_seed, + unsigned int coin_num_salt, + struct TALER_PlanchetSecretsP *fc); diff --git a/src/util/crypto.c b/src/util/crypto.c index ce5bfac82..527aecbf2 100644 --- a/src/util/crypto.c +++ b/src/util/crypto.c @@ -178,9 +178,9 @@ TALER_link_recover_transfer_secret (const struct TALER_TransferPublicKeyP *trans * @param[out] fc value to initialize */ void -TALER_setup_fresh_coin (const struct TALER_TransferSecretP *secret_seed, +TALER_setup_planchet (const struct TALER_TransferSecretP *secret_seed, unsigned int coin_num_salt, - struct TALER_FreshCoinP *fc) + struct TALER_PlanchetSecretsP *fc) { uint32_t be_salt = htonl (coin_num_salt); uint8_t *p; diff --git a/src/util/test_crypto.c b/src/util/test_crypto.c index f28ae8003..76ab5fd25 100644 --- a/src/util/test_crypto.c +++ b/src/util/test_crypto.c @@ -40,8 +40,8 @@ test_high_level () struct TALER_TransferPublicKeyP trans_pub; struct TALER_TransferSecretP secret; struct TALER_TransferSecretP secret2; - struct TALER_FreshCoinP fc1; - struct TALER_FreshCoinP fc2; + struct TALER_PlanchetSecretsP fc1; + struct TALER_PlanchetSecretsP fc2; pk = GNUNET_CRYPTO_eddsa_key_create (); coin_priv.eddsa_priv = *pk; @@ -70,16 +70,16 @@ test_high_level () memcmp (&secret, &secret2, sizeof (secret))); - TALER_setup_fresh_coin (&secret, + TALER_setup_planchet (&secret, 0, &fc1); - TALER_setup_fresh_coin (&secret, + TALER_setup_planchet (&secret, 1, &fc2); GNUNET_assert (0 != memcmp (&fc1, &fc2, - sizeof (struct TALER_FreshCoinP))); + sizeof (struct TALER_PlanchetSecretsP))); return 0; }