-rename fest

This commit is contained in:
Christian Grothoff 2022-02-07 12:33:35 +01:00
parent 0d03f55282
commit fb9ba5b1d2
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
26 changed files with 129 additions and 126 deletions

View File

@ -228,7 +228,7 @@ struct Merchant
/** /**
* Salt used when computing @e h_wire. * Salt used when computing @e h_wire.
*/ */
struct TALER_WireSalt wire_salt; struct TALER_WireSaltP wire_salt;
/** /**
* Account information for the merchant. * Account information for the merchant.

View File

@ -205,9 +205,9 @@ run (void *cls,
global_ret = 1; global_ret = 1;
return; return;
} }
TALER_planchet_setup_refresh (&transfer_secret, TALER_transfer_secret_to_planchet_secret (&transfer_secret,
coin_index, coin_index,
&ps); &ps);
GNUNET_CRYPTO_eddsa_key_get_public (&ps.coin_priv.eddsa_priv, GNUNET_CRYPTO_eddsa_key_get_public (&ps.coin_priv.eddsa_priv,
&coin_pub.eddsa_pub); &coin_pub.eddsa_pub);

View File

@ -98,12 +98,12 @@ TEH_handler_csr (struct TEH_RequestContext *rc,
return (GNUNET_NO == res) ? MHD_YES : MHD_NO; return (GNUNET_NO == res) ? MHD_YES : MHD_NO;
} }
struct TALER_DenominationCsPublicR r_pubs[GNUNET_NZL (csr_requests_num)]; struct TALER_DenominationCSPublicRPairP r_pubs[GNUNET_NZL (csr_requests_num)];
for (unsigned int i = 0; i < csr_requests_num; i++) for (unsigned int i = 0; i < csr_requests_num; i++)
{ {
const struct TALER_CsNonce *nonce = &nonces[i]; const struct TALER_CsNonce *nonce = &nonces[i];
const struct TALER_DenominationHash *denom_pub_hash = &denom_pub_hashes[i]; const struct TALER_DenominationHash *denom_pub_hash = &denom_pub_hashes[i];
struct TALER_DenominationCsPublicR *r_pub = &r_pubs[i]; struct TALER_DenominationCSPublicRPairP *r_pub = &r_pubs[i];
// check denomination referenced by denom_pub_hash // check denomination referenced by denom_pub_hash
{ {
@ -182,7 +182,7 @@ TEH_handler_csr (struct TEH_RequestContext *rc,
csr_response = json_array (); csr_response = json_array ();
for (unsigned int i = 0; i < csr_requests_num; i++) for (unsigned int i = 0; i < csr_requests_num; i++)
{ {
const struct TALER_DenominationCsPublicR *r_pub = &r_pubs[i]; const struct TALER_DenominationCSPublicRPairP *r_pub = &r_pubs[i];
json_t *csr_obj; json_t *csr_obj;
csr_obj = GNUNET_JSON_PACK ( csr_obj = GNUNET_JSON_PACK (

View File

@ -2461,7 +2461,7 @@ enum TALER_ErrorCode
TEH_keys_denomination_cs_r_pub (const struct TEH_keys_denomination_cs_r_pub (const struct
TALER_DenominationHash *h_denom_pub, TALER_DenominationHash *h_denom_pub,
const struct TALER_CsNonce *nonce, const struct TALER_CsNonce *nonce,
struct TALER_DenominationCsPublicR *r_pub) struct TALER_DenominationCSPublicRPairP *r_pub)
{ {
struct TEH_KeyStateHandle *ksh; struct TEH_KeyStateHandle *ksh;
struct HelperDenomination *hd; struct HelperDenomination *hd;

View File

@ -233,7 +233,7 @@ enum TALER_ErrorCode
TEH_keys_denomination_cs_r_pub (const struct TEH_keys_denomination_cs_r_pub (const struct
TALER_DenominationHash *h_denom_pub, TALER_DenominationHash *h_denom_pub,
const struct TALER_CsNonce *nonce, const struct TALER_CsNonce *nonce,
struct TALER_DenominationCsPublicR *r_pub); struct TALER_DenominationCSPublicRPairP *r_pub);
/** /**

View File

@ -182,9 +182,9 @@ check_commitment (struct RevealContext *rctx,
struct TALER_PlanchetSecretsP ps; struct TALER_PlanchetSecretsP ps;
rcd->dk = &rctx->dks[j]->denom_pub; rcd->dk = &rctx->dks[j]->denom_pub;
TALER_planchet_setup_refresh (&ts, TALER_transfer_secret_to_planchet_secret (&ts,
j, j,
&ps); &ps);
// TODO: implement cipher handling // TODO: implement cipher handling
alg_values.cipher = TALER_DENOMINATION_RSA; alg_values.cipher = TALER_DENOMINATION_RSA;
TALER_planchet_setup_coin_priv (&ps, TALER_planchet_setup_coin_priv (&ps,

View File

@ -7212,7 +7212,7 @@ postgres_lookup_transfer_by_deposit (
GNUNET_PQ_query_param_end GNUNET_PQ_query_param_end
}; };
char *payto_uri; char *payto_uri;
struct TALER_WireSalt wire_salt; struct TALER_WireSaltP wire_salt;
struct GNUNET_PQ_ResultSpec rs[] = { struct GNUNET_PQ_ResultSpec rs[] = {
GNUNET_PQ_result_spec_auto_from_type ("wtid_raw", GNUNET_PQ_result_spec_auto_from_type ("wtid_raw",
wtid), wtid),

View File

@ -1345,7 +1345,7 @@ run (void *cls)
unsigned int cnt; unsigned int cnt;
enum GNUNET_DB_QueryStatus qs; enum GNUNET_DB_QueryStatus qs;
struct GNUNET_TIME_Timestamp now; struct GNUNET_TIME_Timestamp now;
struct TALER_WireSalt salt; struct TALER_WireSaltP salt;
struct TALER_CoinPubHash c_hash; struct TALER_CoinPubHash c_hash;
uint64_t known_coin_id; uint64_t known_coin_id;
uint64_t rrc_serial; uint64_t rrc_serial;

View File

@ -1,6 +1,6 @@
/* /*
This file is part of TALER This file is part of TALER
Copyright (C) 2014-2021 Taler Systems SA Copyright (C) 2014-2022 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software terms of the GNU General Public License as published by the Free Software
@ -27,6 +27,12 @@
#include <gcrypt.h> #include <gcrypt.h>
/**
* Maximum number of fresh coins we allow per refresh operation.
*/
#define TALER_MAX_FRESH_COINS 256
/* ****************** Coin crypto primitives ************* */ /* ****************** Coin crypto primitives ************* */
GNUNET_NETWORK_STRUCT_BEGIN GNUNET_NETWORK_STRUCT_BEGIN
@ -419,7 +425,7 @@ struct TALER_ClaimTokenP
* Salt used to hash a merchant's payto:// URI to * Salt used to hash a merchant's payto:// URI to
* compute the "h_wire" (say for deposit requests). * compute the "h_wire" (say for deposit requests).
*/ */
struct TALER_WireSalt struct TALER_WireSaltP
{ {
/** /**
* Actual 128-bit salt value. * Actual 128-bit salt value.
@ -802,13 +808,13 @@ struct TALER_DenominationPrivateKey
struct TALER_BlindedRsaPlanchet struct TALER_BlindedRsaPlanchet
{ {
/** /**
* blinded message to be signed * Blinded message to be signed
* Note: is malloc()'ed! * Note: is malloc()'ed!
*/ */
void *blinded_msg; void *blinded_msg;
/** /**
* size of the blinded message to be signed * Size of the @e blinded_msg to be signed.
*/ */
size_t blinded_msg_size; size_t blinded_msg_size;
}; };
@ -820,7 +826,7 @@ struct TALER_BlindedRsaPlanchet
struct TALER_CsNonce struct TALER_CsNonce
{ {
/** /**
* 32 bit nonce to include in withdrawals * 32 bit nonce to include in withdrawals when using CS.
*/ */
struct GNUNET_CRYPTO_CsNonce nonce; struct GNUNET_CRYPTO_CsNonce nonce;
}; };
@ -828,7 +834,6 @@ struct TALER_CsNonce
/** /**
* @brief CS Parameters to create blinded signature * @brief CS Parameters to create blinded signature
*
*/ */
struct TALER_BlindedCsPlanchet struct TALER_BlindedCsPlanchet
{ {
@ -843,9 +848,9 @@ struct TALER_BlindedCsPlanchet
struct TALER_CsNonce nonce; struct TALER_CsNonce nonce;
}; };
/** /**
* @brief Type including Parameters to create blinded signature * @brief Type including Parameters to create blinded signature
*
*/ */
struct TALER_BlindedPlanchet struct TALER_BlindedPlanchet
{ {
@ -872,10 +877,11 @@ struct TALER_BlindedPlanchet
} details; } details;
}; };
/** /**
* Withdraw nonce for CS denominations * Withdraw nonce for CS denominations
*/ */
struct TALER_RefreshNonce struct TALER_RefreshNonceXXXDEADFIXME
{ {
/** /**
* 32 bit nonce to include in withdrawals * 32 bit nonce to include in withdrawals
@ -883,19 +889,20 @@ struct TALER_RefreshNonce
struct GNUNET_CRYPTO_CsNonce nonce; struct GNUNET_CRYPTO_CsNonce nonce;
}; };
/** /**
* Public R for Cs denominations * Pair of Public R values for Cs denominations
*/ */
struct TALER_DenominationCsPublicR struct TALER_DenominationCSPublicRPairP
{ {
struct GNUNET_CRYPTO_CsRPublic r_pub[2]; struct GNUNET_CRYPTO_CsRPublic r_pub[2];
}; };
/** /**
* Secret r for Cs denominations * Secret r for Cs denominations
*/ */
struct TALER_DenominationCSPrivateRPairP
struct TALER_DenominationCsPrivateR
{ {
struct GNUNET_CRYPTO_CsRSecret r[2]; struct GNUNET_CRYPTO_CsRSecret r[2];
}; };
@ -969,9 +976,10 @@ struct TALER_ExchangeWithdrawCsValues
/** /**
* (non-blinded) r_pub * (non-blinded) r_pub
*/ */
struct TALER_DenominationCsPublicR r_pub; struct TALER_DenominationCSPublicRPairP r_pub_pair;
}; };
/** /**
* @brief Type of algorithm specific Values for withdrawal * @brief Type of algorithm specific Values for withdrawal
*/ */
@ -1097,7 +1105,7 @@ enum GNUNET_GenericReturnValue
TALER_denom_cs_derive_r_public ( TALER_denom_cs_derive_r_public (
const struct TALER_CsNonce *nonce, const struct TALER_CsNonce *nonce,
const struct TALER_DenominationPrivateKey *denom_priv, const struct TALER_DenominationPrivateKey *denom_priv,
struct TALER_DenominationCsPublicR *r_pub); struct TALER_DenominationCSPublicRPairP *r_pub);
/** /**
@ -1473,9 +1481,10 @@ GNUNET_NETWORK_STRUCT_END
* @param[out] ps value to initialize * @param[out] ps value to initialize
*/ */
void void
TALER_planchet_setup_refresh (const struct TALER_TransferSecretP *secret_seed, TALER_transfer_secret_to_planchet_secret (
uint32_t coin_num_salt, const struct TALER_TransferSecretP *secret_seed,
struct TALER_PlanchetSecretsP *ps); uint32_t coin_num_salt,
struct TALER_PlanchetSecretsP *ps);
/** /**
@ -1490,11 +1499,12 @@ TALER_planchet_setup_random (
/** /**
* Create a blinding secret @a bs for @a cipher. * Create a blinding secret @a bks given the client's @a ps and the alg_values
* from the exchange.
* *
* @param ps secret to derive blindings from * @param ps secret to derive blindings from
* @param alg_values withdraw values containing cipher and additional CS values * @param alg_values withdraw values containing cipher and additional CS values
* @param bks blinding secrets * @param[out] bks blinding secrets
*/ */
void void
TALER_planchet_blinding_secret_create ( TALER_planchet_blinding_secret_create (
@ -1504,7 +1514,7 @@ TALER_planchet_blinding_secret_create (
/** /**
* Prepare a planchet for tipping. Creates and blinds a coin. * Prepare a planchet for withdrawal. Creates and blinds a coin.
* *
* @param dk denomination key for the coin to be created * @param dk denomination key for the coin to be created
* @param alg_values algorithm specific values * @param alg_values algorithm specific values
@ -1527,7 +1537,7 @@ TALER_planchet_prepare (const struct TALER_DenominationPublicKey *dk,
/** /**
* Frees blinded message inside blinded planchet depending on blinded_planchet->cipher * Frees blinded message inside blinded planchet depending on `blinded_planchet->cipher`.
* Does not free the @a blinded_planchet itself! * Does not free the @a blinded_planchet itself!
* *
* @param[in] blinded_planchet blinded planchet * @param[in] blinded_planchet blinded planchet
@ -1537,7 +1547,7 @@ TALER_blinded_planchet_free (struct TALER_BlindedPlanchet *blinded_planchet);
/** /**
* Frees blinded message inside planchet detail. * Frees blinded message inside planchet detail @a pd.
* *
* @param[in] pd planchet detail to free * @param[in] pd planchet detail to free
*/ */
@ -1554,6 +1564,7 @@ TALER_planchet_detail_free (struct TALER_PlanchetDetail *pd);
* @param bks blinding key secret * @param bks blinding key secret
* @param coin_priv private key of the coin * @param coin_priv private key of the coin
* @param c_hash hash of the coin's public key for verification of the signature * @param c_hash hash of the coin's public key for verification of the signature
* @param alg_values values obtained from the exchange for the withdrawal
* @param[out] coin set to the details of the fresh coin * @param[out] coin set to the details of the fresh coin
* @return #GNUNET_OK on success * @return #GNUNET_OK on success
*/ */
@ -1568,15 +1579,6 @@ TALER_planchet_to_coin (
struct TALER_FreshCoin *coin); struct TALER_FreshCoin *coin);
/* ****************** Refresh crypto primitives ************* */
/**
* Maximum number of fresh coins we allow per refresh operation.
*/
#define TALER_MAX_FRESH_COINS 256
/** /**
* Given the coin and the transfer private keys, compute the * Given the coin and the transfer private keys, compute the
* transfer secret. (Technically, we only need one of the two * transfer secret. (Technically, we only need one of the two
@ -1935,7 +1937,7 @@ TALER_CRYPTO_helper_cs_revoke (
* @return R, the value inside the structure will be NULL on failure, * @return R, the value inside the structure will be NULL on failure,
* see @a ec for details about the failure * see @a ec for details about the failure
*/ */
struct TALER_DenominationCsPublicR struct TALER_DenominationCSPublicRPairP
TALER_CRYPTO_helper_cs_r_derive (struct TALER_CRYPTO_CsDenominationHelper *dh, TALER_CRYPTO_helper_cs_r_derive (struct TALER_CRYPTO_CsDenominationHelper *dh,
const struct TALER_CsPubHashP *h_cs, const struct TALER_CsPubHashP *h_cs,
const struct TALER_CsNonce *nonce, const struct TALER_CsNonce *nonce,
@ -2982,7 +2984,7 @@ TALER_exchange_wire_signature_make (
*/ */
void void
TALER_merchant_wire_signature_hash (const char *payto_uri, TALER_merchant_wire_signature_hash (const char *payto_uri,
const struct TALER_WireSalt *salt, const struct TALER_WireSaltP *salt,
struct TALER_MerchantWireHash *hc); struct TALER_MerchantWireHash *hc);
@ -2998,7 +3000,7 @@ TALER_merchant_wire_signature_hash (const char *payto_uri,
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_merchant_wire_signature_check ( TALER_merchant_wire_signature_check (
const char *payto_uri, const char *payto_uri,
const struct TALER_WireSalt *salt, const struct TALER_WireSaltP *salt,
const struct TALER_MerchantPublicKeyP *merch_pub, const struct TALER_MerchantPublicKeyP *merch_pub,
const struct TALER_MerchantSignatureP *merch_sig); const struct TALER_MerchantSignatureP *merch_sig);
@ -3014,7 +3016,7 @@ TALER_merchant_wire_signature_check (
void void
TALER_merchant_wire_signature_make ( TALER_merchant_wire_signature_make (
const char *payto_uri, const char *payto_uri,
const struct TALER_WireSalt *salt, const struct TALER_WireSaltP *salt,
const struct TALER_MerchantPrivateKeyP *merch_priv, const struct TALER_MerchantPrivateKeyP *merch_priv,
struct TALER_MerchantSignatureP *merch_sig); struct TALER_MerchantSignatureP *merch_sig);

View File

@ -922,7 +922,7 @@ TALER_EXCHANGE_deposit (
const struct TALER_Amount *amount, const struct TALER_Amount *amount,
struct GNUNET_TIME_Timestamp wire_deadline, struct GNUNET_TIME_Timestamp wire_deadline,
const char *merchant_payto_uri, const char *merchant_payto_uri,
const struct TALER_WireSalt *wire_salt, const struct TALER_WireSaltP *wire_salt,
const struct TALER_PrivateContractHash *h_contract_terms, const struct TALER_PrivateContractHash *h_contract_terms,
const json_t *extension_details, const json_t *extension_details,
const struct TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub,

View File

@ -340,7 +340,7 @@ struct TALER_EXCHANGEDB_TableData
struct TALER_MerchantPublicKeyP merchant_pub; struct TALER_MerchantPublicKeyP merchant_pub;
struct TALER_PrivateContractHash h_contract_terms; struct TALER_PrivateContractHash h_contract_terms;
struct TALER_CoinSpendSignatureP coin_sig; struct TALER_CoinSpendSignatureP coin_sig;
struct TALER_WireSalt wire_salt; struct TALER_WireSaltP wire_salt;
uint64_t wire_target_serial_id; uint64_t wire_target_serial_id;
bool tiny; bool tiny;
bool done; bool done;
@ -1027,7 +1027,7 @@ struct TALER_EXCHANGEDB_Deposit
/** /**
* Salt used by the merchant to compute "h_wire". * Salt used by the merchant to compute "h_wire".
*/ */
struct TALER_WireSalt wire_salt; struct TALER_WireSaltP wire_salt;
/** /**
* Information about the receiver for executing the transaction. URI in * Information about the receiver for executing the transaction. URI in
@ -1126,7 +1126,7 @@ struct TALER_EXCHANGEDB_DepositListEntry
/** /**
* Salt used to compute h_wire from the @e receiver_wire_account. * Salt used to compute h_wire from the @e receiver_wire_account.
*/ */
struct TALER_WireSalt wire_salt; struct TALER_WireSaltP wire_salt;
/** /**
* Time when this request was generated. Used, for example, to * Time when this request was generated. Used, for example, to

View File

@ -29,7 +29,7 @@ TALER_JSON_merchant_wire_signature_hash (const json_t *wire_s,
struct TALER_MerchantWireHash *hc) struct TALER_MerchantWireHash *hc)
{ {
const char *payto_uri; const char *payto_uri;
struct TALER_WireSalt salt; struct TALER_WireSaltP salt;
struct GNUNET_JSON_Specification spec[] = { struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_string ("payto_uri", GNUNET_JSON_spec_string ("payto_uri",
&payto_uri), &payto_uri),

View File

@ -105,11 +105,11 @@ csr_ok (struct TALER_EXCHANGE_CsRHandle *csrh,
struct GNUNET_JSON_Specification spec[] = { struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_fixed ( GNUNET_JSON_spec_fixed (
"r_pub_0", "r_pub_0",
&alg_values[i].details.cs_values.r_pub.r_pub[0], &alg_values[i].details.cs_values.r_pub_pair.r_pub[0],
sizeof (struct GNUNET_CRYPTO_CsRPublic)), sizeof (struct GNUNET_CRYPTO_CsRPublic)),
GNUNET_JSON_spec_fixed ( GNUNET_JSON_spec_fixed (
"r_pub_1", "r_pub_1",
&alg_values[i].details.cs_values.r_pub.r_pub[1], &alg_values[i].details.cs_values.r_pub_pair.r_pub[1],
sizeof (struct GNUNET_CRYPTO_CsRPublic)), sizeof (struct GNUNET_CRYPTO_CsRPublic)),
GNUNET_JSON_spec_end () GNUNET_JSON_spec_end ()
}; };

View File

@ -545,7 +545,7 @@ TALER_EXCHANGE_deposit (
const struct TALER_Amount *amount, const struct TALER_Amount *amount,
struct GNUNET_TIME_Timestamp wire_deadline, struct GNUNET_TIME_Timestamp wire_deadline,
const char *merchant_payto_uri, const char *merchant_payto_uri,
const struct TALER_WireSalt *wire_salt, const struct TALER_WireSaltP *wire_salt,
const struct TALER_PrivateContractHash *h_contract_terms, const struct TALER_PrivateContractHash *h_contract_terms,
const json_t *extension_details, const json_t *extension_details,
const struct TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_CoinSpendPublicKeyP *coin_pub,

View File

@ -120,9 +120,9 @@ parse_link_coin (const struct TALER_EXCHANGE_LinkHandle *lh,
TALER_link_recover_transfer_secret (trans_pub, TALER_link_recover_transfer_secret (trans_pub,
&lh->coin_priv, &lh->coin_priv,
&secret); &secret);
TALER_planchet_setup_refresh (&secret, TALER_transfer_secret_to_planchet_secret (&secret,
coin_num, coin_num,
&ps); &ps);
// TODO: implement cipher handling // TODO: implement cipher handling
alg_values.cipher = TALER_DENOMINATION_RSA; alg_values.cipher = TALER_DENOMINATION_RSA;

View File

@ -136,9 +136,9 @@ TALER_EXCHANGE_get_melt_data_ (
struct TALER_CoinSpendPrivateKeyP coin_priv; struct TALER_CoinSpendPrivateKeyP coin_priv;
union TALER_DenominationBlindingKeyP bks; union TALER_DenominationBlindingKeyP bks;
TALER_planchet_setup_refresh (&trans_sec[i], TALER_transfer_secret_to_planchet_secret (&trans_sec[i],
j, j,
fc); fc);
TALER_planchet_setup_coin_priv (fc, TALER_planchet_setup_coin_priv (fc,
&alg_values[j], &alg_values[j],
&coin_priv); &coin_priv);

View File

@ -384,9 +384,9 @@ TALER_EXCHANGE_refreshes_reveal (
json_array_append_new (new_denoms_h, json_array_append_new (new_denoms_h,
GNUNET_JSON_from_data_auto ( GNUNET_JSON_from_data_auto (
&denom_hash))); &denom_hash)));
TALER_planchet_setup_refresh (&ts, TALER_transfer_secret_to_planchet_secret (&ts,
i, i,
&ps); &ps);
TALER_planchet_setup_coin_priv (&ps, TALER_planchet_setup_coin_priv (&ps,
&alg_values[i], &alg_values[i],
&coin_priv); &coin_priv);

View File

@ -293,7 +293,7 @@ deposit_run (void *cls,
struct TALER_MerchantPublicKeyP merchant_pub; struct TALER_MerchantPublicKeyP merchant_pub;
struct TALER_PrivateContractHash h_contract_terms; struct TALER_PrivateContractHash h_contract_terms;
enum TALER_ErrorCode ec; enum TALER_ErrorCode ec;
struct TALER_WireSalt wire_salt; struct TALER_WireSaltP wire_salt;
const char *payto_uri; const char *payto_uri;
struct GNUNET_JSON_Specification spec[] = { struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_string ("payto_uri", GNUNET_JSON_spec_string ("payto_uri",

View File

@ -670,7 +670,7 @@ TALER_TESTING_prepare_fakebank (const char *config_filename,
json_t * json_t *
TALER_TESTING_make_wire_details (const char *payto) TALER_TESTING_make_wire_details (const char *payto)
{ {
struct TALER_WireSalt salt; struct TALER_WireSaltP salt;
/* salt must be constant for aggregation tests! */ /* salt must be constant for aggregation tests! */
memset (&salt, memset (&salt,

View File

@ -156,10 +156,10 @@ TALER_planchet_setup_random (
void void
TALER_planchet_setup_refresh (const struct TALER_TransferSecretP *secret_seed, TALER_transfer_secret_to_planchet_secret (
uint32_t coin_num_salt, const struct TALER_TransferSecretP *secret_seed,
struct TALER_PlanchetSecretsP *ps) uint32_t coin_num_salt,
struct TALER_PlanchetSecretsP *ps)
{ {
uint32_t be_salt = htonl (coin_num_salt); uint32_t be_salt = htonl (coin_num_salt);
@ -381,14 +381,14 @@ TALER_blinded_planchet_free (struct TALER_BlindedPlanchet *blinded_planchet)
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_planchet_to_coin (const struct TALER_DenominationPublicKey *dk, TALER_planchet_to_coin (
const struct const struct TALER_DenominationPublicKey *dk,
TALER_BlindedDenominationSignature *blind_sig, const struct TALER_BlindedDenominationSignature *blind_sig,
const union TALER_DenominationBlindingKeyP *bks, const union TALER_DenominationBlindingKeyP *bks,
const struct TALER_CoinSpendPrivateKeyP *coin_priv, const struct TALER_CoinSpendPrivateKeyP *coin_priv,
const struct TALER_CoinPubHash *c_hash, const struct TALER_CoinPubHash *c_hash,
const struct TALER_ExchangeWithdrawValues *alg_values, const struct TALER_ExchangeWithdrawValues *alg_values,
struct TALER_FreshCoin *coin) struct TALER_FreshCoin *coin)
{ {
struct TALER_DenominationSignature sig; struct TALER_DenominationSignature sig;
@ -416,21 +416,20 @@ TALER_planchet_to_coin (const struct TALER_DenominationPublicKey *dk,
{ {
struct GNUNET_CRYPTO_CsC c[2]; struct GNUNET_CRYPTO_CsC c[2];
struct GNUNET_CRYPTO_CsBlindingSecret bs[2]; struct GNUNET_CRYPTO_CsBlindingSecret bs[2];
struct TALER_DenominationCsPublicR r_pub_blind; struct TALER_DenominationCSPublicRPairP r_pub_blind;
GNUNET_CRYPTO_cs_blinding_secrets_derive (&bks->nonce, bs);
GNUNET_CRYPTO_cs_calc_blinded_c (bs,
alg_values->details.cs_values.r_pub.r_pub,
&dk->details.cs_public_key,
&c_hash->hash,
sizeof(struct GNUNET_HashCode),
c,
r_pub_blind.r_pub);
GNUNET_CRYPTO_cs_blinding_secrets_derive (&bks->nonce,
bs);
GNUNET_CRYPTO_cs_calc_blinded_c (
bs,
alg_values->details.cs_values.r_pub_pair.r_pub,
&dk->details.cs_public_key,
&c_hash->hash,
sizeof(struct GNUNET_HashCode),
c,
r_pub_blind.r_pub);
sig.details.cs_signature.r_point sig.details.cs_signature.r_point
= r_pub_blind.r_pub[blind_sig->details.blinded_cs_answer.b]; = r_pub_blind.r_pub[blind_sig->details.blinded_cs_answer.b];
if (GNUNET_OK != if (GNUNET_OK !=
TALER_denom_sig_unblind (&sig, TALER_denom_sig_unblind (&sig,
blind_sig, blind_sig,

View File

@ -607,13 +607,13 @@ TALER_CRYPTO_helper_cs_revoke (
} }
struct TALER_DenominationCsPublicR struct TALER_DenominationCSPublicRPairP
TALER_CRYPTO_helper_cs_r_derive (struct TALER_CRYPTO_CsDenominationHelper *dh, TALER_CRYPTO_helper_cs_r_derive (struct TALER_CRYPTO_CsDenominationHelper *dh,
const struct TALER_CsPubHashP *h_cs, const struct TALER_CsPubHashP *h_cs,
const struct TALER_CsNonce *nonce, const struct TALER_CsNonce *nonce,
enum TALER_ErrorCode *ec) enum TALER_ErrorCode *ec)
{ {
struct TALER_DenominationCsPublicR r_pub; struct TALER_DenominationCSPublicRPairP r_pub;
memset (&r_pub, memset (&r_pub,
0, 0,

View File

@ -64,7 +64,7 @@ TALER_exchange_wire_signature_make (
void void
TALER_merchant_wire_signature_hash (const char *payto_uri, TALER_merchant_wire_signature_hash (const char *payto_uri,
const struct TALER_WireSalt *salt, const struct TALER_WireSaltP *salt,
struct TALER_MerchantWireHash *hc) struct TALER_MerchantWireHash *hc)
{ {
GNUNET_assert (GNUNET_YES == GNUNET_assert (GNUNET_YES ==
@ -83,7 +83,7 @@ TALER_merchant_wire_signature_hash (const char *payto_uri,
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_merchant_wire_signature_check ( TALER_merchant_wire_signature_check (
const char *payto_uri, const char *payto_uri,
const struct TALER_WireSalt *salt, const struct TALER_WireSaltP *salt,
const struct TALER_MerchantPublicKeyP *merch_pub, const struct TALER_MerchantPublicKeyP *merch_pub,
const struct TALER_MerchantSignatureP *merch_sig) const struct TALER_MerchantSignatureP *merch_sig)
{ {
@ -105,7 +105,7 @@ TALER_merchant_wire_signature_check (
void void
TALER_merchant_wire_signature_make ( TALER_merchant_wire_signature_make (
const char *payto_uri, const char *payto_uri,
const struct TALER_WireSalt *salt, const struct TALER_WireSaltP *salt,
const struct TALER_MerchantPrivateKeyP *merch_priv, const struct TALER_MerchantPrivateKeyP *merch_priv,
struct TALER_MerchantSignatureP *merch_sig) struct TALER_MerchantSignatureP *merch_sig)
{ {

View File

@ -86,7 +86,7 @@ enum GNUNET_GenericReturnValue
TALER_denom_cs_derive_r_public (const struct TALER_CsNonce *nonce, TALER_denom_cs_derive_r_public (const struct TALER_CsNonce *nonce,
const struct const struct
TALER_DenominationPrivateKey *denom_priv, TALER_DenominationPrivateKey *denom_priv,
struct TALER_DenominationCsPublicR *r_pub) struct TALER_DenominationCSPublicRPairP *r_pub)
{ {
if (denom_priv->cipher != TALER_DENOMINATION_CS) if (denom_priv->cipher != TALER_DENOMINATION_CS)
{ {
@ -316,13 +316,14 @@ TALER_denom_priv_to_pub (const struct TALER_DenominationPrivateKey *denom_priv,
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TALER_denom_blind (const struct TALER_DenominationPublicKey *dk, TALER_denom_blind (
const union TALER_DenominationBlindingKeyP *coin_bks, const struct TALER_DenominationPublicKey *dk,
const struct TALER_AgeHash *age_commitment_hash, const union TALER_DenominationBlindingKeyP *coin_bks,
const struct TALER_CoinSpendPublicKeyP *coin_pub, const struct TALER_AgeHash *age_commitment_hash,
const struct TALER_ExchangeWithdrawValues *alg_values, const struct TALER_CoinSpendPublicKeyP *coin_pub,
struct TALER_CoinPubHash *c_hash, const struct TALER_ExchangeWithdrawValues *alg_values,
struct TALER_BlindedPlanchet *blinded_planchet) struct TALER_CoinPubHash *c_hash,
struct TALER_BlindedPlanchet *blinded_planchet)
{ {
TALER_coin_pub_hash (coin_pub, TALER_coin_pub_hash (coin_pub,
age_commitment_hash, age_commitment_hash,
@ -348,19 +349,20 @@ TALER_denom_blind (const struct TALER_DenominationPublicKey *dk,
case TALER_DENOMINATION_CS: case TALER_DENOMINATION_CS:
{ {
blinded_planchet->cipher = dk->cipher; blinded_planchet->cipher = dk->cipher;
struct TALER_DenominationCsPublicR blinded_r_pub; struct TALER_DenominationCSPublicRPairP blinded_r_pub;
struct GNUNET_CRYPTO_CsBlindingSecret bs[2]; struct GNUNET_CRYPTO_CsBlindingSecret bs[2];
GNUNET_CRYPTO_cs_blinding_secrets_derive (&coin_bks->nonce, bs); GNUNET_CRYPTO_cs_blinding_secrets_derive (&coin_bks->nonce,
bs);
GNUNET_CRYPTO_cs_calc_blinded_c (bs, GNUNET_CRYPTO_cs_calc_blinded_c (
alg_values->details.cs_values.r_pub.r_pub, bs,
&dk->details.cs_public_key, alg_values->details.cs_values.r_pub_pair.r_pub,
&c_hash->hash, &dk->details.cs_public_key,
sizeof(struct GNUNET_HashCode), &c_hash->hash,
blinded_planchet->details. sizeof(struct GNUNET_HashCode),
cs_blinded_planchet.c, blinded_planchet->details.
blinded_r_pub.r_pub); cs_blinded_planchet.c,
blinded_r_pub.r_pub);
return GNUNET_OK; return GNUNET_OK;
} }
default: default:

View File

@ -553,8 +553,8 @@ handle_r_derive_request (struct TES_Client *client,
const struct TALER_CRYPTO_CsRDeriveRequest *rdr) const struct TALER_CRYPTO_CsRDeriveRequest *rdr)
{ {
struct DenominationKey *dk; struct DenominationKey *dk;
struct TALER_DenominationCsPrivateR r_priv; struct TALER_DenominationCSPrivateRPairP r_priv;
struct TALER_DenominationCsPublicR r_pub; struct TALER_DenominationCSPublicRPairP r_pub;
struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get (); struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get ();
GNUNET_assert (0 == pthread_mutex_lock (&keys_lock)); GNUNET_assert (0 == pthread_mutex_lock (&keys_lock));

View File

@ -227,7 +227,7 @@ struct TALER_CRYPTO_RDeriveResponse
/** /**
* derived R * derived R
*/ */
struct TALER_DenominationCsPublicR r_pub; struct TALER_DenominationCSPublicRPairP r_pub;
}; };

View File

@ -68,9 +68,9 @@ test_high_level (void)
GNUNET_assert (0 == GNUNET_assert (0 ==
GNUNET_memcmp (&secret, GNUNET_memcmp (&secret,
&secret2)); &secret2));
TALER_planchet_setup_refresh (&secret, TALER_transfer_secret_to_planchet_secret (&secret,
0, 0,
&ps1); &ps1);
alg1.cipher = TALER_DENOMINATION_RSA; alg1.cipher = TALER_DENOMINATION_RSA;
TALER_planchet_setup_coin_priv (&ps1, TALER_planchet_setup_coin_priv (&ps1,
&alg1, &alg1,
@ -79,9 +79,9 @@ test_high_level (void)
&alg1, &alg1,
&bks1); &bks1);
alg2.cipher = TALER_DENOMINATION_RSA; alg2.cipher = TALER_DENOMINATION_RSA;
TALER_planchet_setup_refresh (&secret, TALER_transfer_secret_to_planchet_secret (&secret,
1, 1,
&ps2); &ps2);
TALER_planchet_setup_coin_priv (&ps2, TALER_planchet_setup_coin_priv (&ps2,
&alg2, &alg2,
&coin_priv2); &coin_priv2);
@ -307,7 +307,7 @@ static int
test_merchant_sigs (void) test_merchant_sigs (void)
{ {
const char *pt = "payto://x-taler-bank/localhost/Account"; const char *pt = "payto://x-taler-bank/localhost/Account";
struct TALER_WireSalt salt; struct TALER_WireSaltP salt;
struct TALER_MerchantPrivateKeyP priv; struct TALER_MerchantPrivateKeyP priv;
struct TALER_MerchantPublicKeyP pub; struct TALER_MerchantPublicKeyP pub;
struct TALER_MerchantSignatureP sig; struct TALER_MerchantSignatureP sig;