summaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_refresh_common.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-02-13 12:44:09 +0100
committerChristian Grothoff <christian@grothoff.org>2022-02-13 12:44:09 +0100
commit9b8c350d4dc38256fe746ef31c480bc4f50ac4c8 (patch)
treef8dcdd0c0b76d2ee9e91865f8cc7718131800354 /src/lib/exchange_api_refresh_common.h
parentf6ecf7458ab4a0e23233439ca6c878fd93921083 (diff)
downloadexchange-9b8c350d4dc38256fe746ef31c480bc4f50ac4c8.tar.gz
exchange-9b8c350d4dc38256fe746ef31c480bc4f50ac4c8.tar.bz2
exchange-9b8c350d4dc38256fe746ef31c480bc4f50ac4c8.zip
-remove redundancies in the refresh-melt computation and fix uninitialized bks return value
Diffstat (limited to 'src/lib/exchange_api_refresh_common.h')
-rw-r--r--src/lib/exchange_api_refresh_common.h77
1 files changed, 62 insertions, 15 deletions
diff --git a/src/lib/exchange_api_refresh_common.h b/src/lib/exchange_api_refresh_common.h
index 2115b5a19..ab19ad7d1 100644
--- a/src/lib/exchange_api_refresh_common.h
+++ b/src/lib/exchange_api_refresh_common.h
@@ -53,11 +53,6 @@ struct MeltedCoin
struct TALER_Amount original_value;
/**
- * Transfer private keys for each cut-and-choose dimension.
- */
- struct TALER_TransferPrivateKeyP transfer_priv[TALER_CNC_KAPPA];
-
- /**
* Timestamp indicating when coins of this denomination become invalid.
*/
struct GNUNET_TIME_Timestamp expire_deposit;
@@ -76,6 +71,37 @@ struct MeltedCoin
/**
+ * Data we keep for each fresh coin created in the
+ * melt process.
+ */
+struct FreshCoinData
+{
+ /**
+ * Denomination public key of the coin.
+ */
+ struct TALER_DenominationPublicKey fresh_pk;
+
+ /**
+ * Array of planchet secrets for the coins, depending
+ * on the cut-and-choose.
+ */
+ struct TALER_PlanchetMasterSecretP ps[TALER_CNC_KAPPA];
+
+ /**
+ * Private key of the coin.
+ */
+ struct TALER_CoinSpendPrivateKeyP coin_priv;
+
+ /**
+ * Blinding key secrets for the coins, depending on the
+ * cut-and-choose.
+ */
+ union TALER_DenominationBlindingKeyP bks[TALER_CNC_KAPPA];
+
+};
+
+
+/**
* Melt data in non-serialized format for convenient processing.
*/
struct MeltData
@@ -87,26 +113,47 @@ struct MeltData
struct TALER_RefreshCommitmentP rc;
/**
- * Number of coins we are creating
+ * Information about the melted coin.
*/
- uint16_t num_fresh_coins;
+ struct MeltedCoin melted_coin;
/**
- * Information about the melted coin.
+ * Array of length @e num_fresh_coins with information
+ * about each fresh coin.
*/
- struct MeltedCoin melted_coin;
+ struct FreshCoinData *fcds;
+
+ /**
+ * Transfer secrets, one per cut and choose.
+ */
+ struct TALER_TransferSecretP trans_sec[TALER_CNC_KAPPA];
+
+ /**
+ * Transfer private keys for each cut-and-choose dimension.
+ */
+ struct TALER_TransferPrivateKeyP transfer_priv[TALER_CNC_KAPPA];
+
+ /**
+ * Transfer public key of this commitment.
+ */
+ struct TALER_TransferPublicKeyP transfer_pub[TALER_CNC_KAPPA];
/**
- * Array of @e num_fresh_coins denomination keys for the coins to be
- * freshly exchangeed.
+ * Transfer secrets, one per cut and choose.
*/
- struct TALER_DenominationPublicKey *fresh_pks;
+ struct TALER_RefreshCommitmentEntry rce[TALER_CNC_KAPPA];
/**
- * Arrays of @e num_fresh_coins with information about the fresh
- * coins to be created, for each cut-and-choose dimension.
+ * Blinded planchets and denominations of the fresh coins, depending on the cut-and-choose. Array of length
+ * @e num_fresh_coins.
*/
- struct TALER_PlanchetMasterSecretP *fresh_coins[TALER_CNC_KAPPA];
+ struct TALER_RefreshCoinData *rcd[TALER_CNC_KAPPA];
+
+ /**
+ * Number of coins we are creating
+ */
+ uint16_t num_fresh_coins;
+
};