diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-02-11 09:36:01 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-02-11 09:36:01 +0100 |
commit | 0995bdd1d05356ed5f97954449f5a5c74a41bdc5 (patch) | |
tree | 6feb57a46708ea95e0b1921d9ffa3e8210ae1f13 /src/include | |
parent | 532d4ad0dca62055056e5b6093e82daa3541f690 (diff) | |
download | exchange-0995bdd1d05356ed5f97954449f5a5c74a41bdc5.tar.gz exchange-0995bdd1d05356ed5f97954449f5a5c74a41bdc5.tar.bz2 exchange-0995bdd1d05356ed5f97954449f5a5c74a41bdc5.zip |
-get tests to pass
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/taler_crypto_lib.h | 57 | ||||
-rw-r--r-- | src/include/taler_exchange_service.h | 20 | ||||
-rw-r--r-- | src/include/taler_testing_lib.h | 6 |
3 files changed, 53 insertions, 30 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index 8e8203790..b6dccda46 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -464,12 +464,25 @@ struct TALER_RsaPubHashP /** * Master key material for the deriviation of + * private coins and blinding factors during + * withdraw or refresh. + */ +struct TALER_PlanchetMasterSecretP +{ + + /** + * Key material. + */ + uint32_t key_data[8]; + +}; + + +/** + * Master key material for the deriviation of * private coins and blinding factors. */ -// FIXME: split this struct, we should have -// a different one for the Melt/Refresh secrets -// and the withdraw secrets! -struct TALER_PlanchetSecretsP +struct TALER_RefreshMasterSecretP { /** @@ -1026,7 +1039,7 @@ TALER_denom_pub_free (struct TALER_DenominationPublicKey *denom_pub); */ void TALER_planchet_setup_coin_priv ( - const struct TALER_PlanchetSecretsP *ps, + const struct TALER_PlanchetMasterSecretP *ps, const struct TALER_ExchangeWithdrawValues *alg_values, struct TALER_CoinSpendPrivateKeyP *coin_priv); @@ -1039,7 +1052,7 @@ TALER_planchet_setup_coin_priv ( */ void TALER_cs_withdraw_nonce_derive ( - const struct TALER_PlanchetSecretsP *ps, + const struct TALER_PlanchetMasterSecretP *ps, struct TALER_CsNonce *nonce); @@ -1047,13 +1060,13 @@ TALER_cs_withdraw_nonce_derive ( * @brief Method to derive /csr nonce * to be used during refresh/melt operation. * - * @param coin_priv private key of the coin + * @param rms secret input for the refresh operation * @param idx index of the fresh coin * @param[out] nonce set to nonce included in the request to generate R_0 and R_1 */ void TALER_cs_refresh_nonce_derive ( - const struct TALER_PlanchetSecretsP *ps, + const struct TALER_RefreshMasterSecretP *rms, uint32_t idx, struct TALER_CsNonce *nonce); @@ -1511,34 +1524,44 @@ void TALER_transfer_secret_to_planchet_secret ( const struct TALER_TransferSecretP *secret_seed, uint32_t coin_num_salt, - struct TALER_PlanchetSecretsP *ps); + struct TALER_PlanchetMasterSecretP *ps); /** * Derive the @a coin_num transfer private key @a tpriv from a refresh from - * the @a ps seed of the refresh operation. The transfer private key + * the @a rms seed of the refresh operation. The transfer private key * derivation is based on the @a ps with a KDF salted by the @a coin_num. * - * @param ps seed to use for KDF to derive transfer keys + * @param rms seed to use for KDF to derive transfer keys * @param cnc_num cut and choose number to include in KDF * @param[out] tpriv value to initialize */ void TALER_planchet_secret_to_transfer_priv ( - const struct TALER_PlanchetSecretsP *ps, + const struct TALER_RefreshMasterSecretP *rms, uint32_t cnc_num, struct TALER_TransferPrivateKeyP *tpriv); /** - * Setup information for fresh coins to be withdrawn - * or refreshed. + * Setup secret seed information for fresh coins to be + * withdrawn. * * @param[out] ps value to initialize */ void -TALER_planchet_setup_random ( - struct TALER_PlanchetSecretsP *ps); +TALER_planchet_master_setup_random ( + struct TALER_PlanchetMasterSecretP *ps); + + +/** + * Setup secret seed for fresh coins to be refreshed. + * + * @param[out] rms value to initialize + */ +void +TALER_refresh_master_setup_random ( + struct TALER_RefreshMasterSecretP *rms); /** @@ -1551,7 +1574,7 @@ TALER_planchet_setup_random ( */ void TALER_planchet_blinding_secret_create ( - const struct TALER_PlanchetSecretsP *ps, + const struct TALER_PlanchetMasterSecretP *ps, const struct TALER_ExchangeWithdrawValues *alg_values, union TALER_DenominationBlindingKeyP *bks); diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h index 58364b159..fe5c74618 100644 --- a/src/include/taler_exchange_service.h +++ b/src/include/taler_exchange_service.h @@ -1500,7 +1500,7 @@ TALER_EXCHANGE_withdraw ( struct TALER_EXCHANGE_Handle *exchange, const struct TALER_EXCHANGE_DenomPublicKey *pk, const struct TALER_ReservePrivateKeyP *reserve_priv, - const struct TALER_PlanchetSecretsP *ps, + const struct TALER_PlanchetMasterSecretP *ps, TALER_EXCHANGE_WithdrawCallback res_cb, void *res_cb_cls); @@ -1667,7 +1667,7 @@ typedef void * prior to calling this function. * * @param exchange the exchange handle; the exchange must be ready to operate - * @param ps the fresh secret that defines the refresh operation + * @param rms the fresh secret that defines the refresh operation * @param rd the refresh data specifying the characteristics of the operation * @param melt_cb the callback to call with the result * @param melt_cb_cls closure for @a melt_cb @@ -1676,7 +1676,7 @@ typedef void */ struct TALER_EXCHANGE_MeltHandle * TALER_EXCHANGE_melt (struct TALER_EXCHANGE_Handle *exchange, - const struct TALER_PlanchetSecretsP *ps, + const struct TALER_RefreshMasterSecretP *rms, const struct TALER_EXCHANGE_RefreshData *rd, TALER_EXCHANGE_MeltCallback melt_cb, void *melt_cb_cls); @@ -1716,7 +1716,7 @@ typedef void const struct TALER_EXCHANGE_HttpResponse *hr, unsigned int num_coins, const struct TALER_CoinSpendPrivateKeyP *coin_privs, - const struct TALER_PlanchetSecretsP *psa, + const struct TALER_PlanchetMasterSecretP *psa, const struct TALER_DenominationSignature *sigs); @@ -1736,7 +1736,7 @@ struct TALER_EXCHANGE_RefreshesRevealHandle; * prior to calling this function. * * @param exchange the exchange handle; the exchange must be ready to operate - * @param ps the fresh secret that defines the refresh operation + * @param rms the fresh secret that defines the refresh operation * @param rd the refresh data that characterizes the refresh operation * @param num_coins number of fresh coins to be created, length of the @a exchange_vals array, must match value in @a rd * @param alg_values array @a num_coins of exchange values contributed to the refresh operation @@ -1751,7 +1751,7 @@ struct TALER_EXCHANGE_RefreshesRevealHandle; struct TALER_EXCHANGE_RefreshesRevealHandle * TALER_EXCHANGE_refreshes_reveal ( struct TALER_EXCHANGE_Handle *exchange, - const struct TALER_PlanchetSecretsP *ps, + const struct TALER_RefreshMasterSecretP *rms, const struct TALER_EXCHANGE_RefreshData *rd, unsigned int num_coins, const struct TALER_ExchangeWithdrawValues *alg_values, @@ -2186,7 +2186,7 @@ TALER_EXCHANGE_recoup (struct TALER_EXCHANGE_Handle *exchange, const struct TALER_EXCHANGE_DenomPublicKey *pk, const struct TALER_DenominationSignature *denom_sig, const struct TALER_ExchangeWithdrawValues *exchange_vals, - const struct TALER_PlanchetSecretsP *ps, + const struct TALER_PlanchetMasterSecretP *ps, TALER_EXCHANGE_RecoupResultCallback recoup_cb, void *recoup_cb_cls); @@ -2236,7 +2236,7 @@ typedef void * @param pk kind of coin to pay back * @param denom_sig signature over the coin by the exchange using @a pk * @param exchange_vals contribution from the exchange on the withdraw - * @param rps melt secret of the refreshing operation + * @param rms melt secret of the refreshing operation * @param ps coin-specific secrets derived for this coin during the refreshing operation * @param idx index of the fresh coin in the refresh operation that is now being recouped * @param recoup_cb the callback to call when the final result for this request is available @@ -2251,8 +2251,8 @@ TALER_EXCHANGE_recoup_refresh ( const struct TALER_EXCHANGE_DenomPublicKey *pk, const struct TALER_DenominationSignature *denom_sig, const struct TALER_ExchangeWithdrawValues *exchange_vals, - const struct TALER_PlanchetSecretsP *rps, - const struct TALER_PlanchetSecretsP *ps, + const struct TALER_RefreshMasterSecretP *rms, + const struct TALER_PlanchetMasterSecretP *ps, unsigned int idx, TALER_EXCHANGE_RecoupRefreshResultCallback recoup_cb, void *recoup_cb_cls); diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h index 7284a1247..a0385a85e 100644 --- a/src/include/taler_testing_lib.h +++ b/src/include/taler_testing_lib.h @@ -2443,8 +2443,8 @@ TALER_TESTING_get_trait (const struct TALER_TESTING_Trait *traits, #define TALER_TESTING_SIMPLE_TRAITS(op) \ op (bank_row, const uint64_t) \ op (reserve_priv, const struct TALER_ReservePrivateKeyP) \ - op (planchet_secret, const struct TALER_PlanchetSecretsP) \ - op (refresh_secret, const struct TALER_PlanchetSecretsP) \ + op (planchet_secret, const struct TALER_PlanchetMasterSecretP) \ + op (refresh_secret, const struct TALER_RefreshMasterSecretP) \ op (reserve_pub, const struct TALER_ReservePublicKeyP) \ op (merchant_priv, const struct TALER_MerchantPrivateKeyP) \ op (merchant_pub, const struct TALER_MerchantPublicKeyP) \ @@ -2484,7 +2484,7 @@ TALER_TESTING_get_trait (const struct TALER_TESTING_Trait *traits, #define TALER_TESTING_INDEXED_TRAITS(op) \ op (denom_pub, const struct TALER_EXCHANGE_DenomPublicKey) \ op (denom_sig, const struct TALER_DenominationSignature) \ - op (planchet_secrets, const struct TALER_PlanchetSecretsP) \ + op (planchet_secrets, const struct TALER_PlanchetMasterSecretP) \ op (exchange_wd_value, const struct TALER_ExchangeWithdrawValues) \ op (coin_priv, const struct TALER_CoinSpendPrivateKeyP) \ op (coin_pub, const struct TALER_CoinSpendPublicKeyP) \ |