-refactor: AgeCommitmentHash->AgeCommitmentHashP
This commit is contained in:
parent
af1e15ddf6
commit
6a074b36c4
@ -1218,7 +1218,7 @@ static enum GNUNET_GenericReturnValue
|
|||||||
refresh_session_cb (void *cls,
|
refresh_session_cb (void *cls,
|
||||||
uint64_t rowid,
|
uint64_t rowid,
|
||||||
const struct TALER_DenominationPublicKey *denom_pub,
|
const struct TALER_DenominationPublicKey *denom_pub,
|
||||||
const struct TALER_AgeCommitmentHash *h_age_commitment,
|
const struct TALER_AgeCommitmentHashP *h_age_commitment,
|
||||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||||
const struct TALER_CoinSpendSignatureP *coin_sig,
|
const struct TALER_CoinSpendSignatureP *coin_sig,
|
||||||
const struct TALER_Amount *amount_with_fee,
|
const struct TALER_Amount *amount_with_fee,
|
||||||
|
@ -277,7 +277,7 @@ add_deposit (const struct Merchant *m)
|
|||||||
struct TALER_EXCHANGEDB_Deposit deposit;
|
struct TALER_EXCHANGEDB_Deposit deposit;
|
||||||
uint64_t known_coin_id;
|
uint64_t known_coin_id;
|
||||||
struct TALER_DenominationHashP dph;
|
struct TALER_DenominationHashP dph;
|
||||||
struct TALER_AgeCommitmentHash agh;
|
struct TALER_AgeCommitmentHashP agh;
|
||||||
|
|
||||||
RANDOMIZE (&d.coin.coin_pub);
|
RANDOMIZE (&d.coin.coin_pub);
|
||||||
d.coin.denom_pub_hash = h_denom_pub;
|
d.coin.denom_pub_hash = h_denom_pub;
|
||||||
@ -468,7 +468,7 @@ run (void *cls,
|
|||||||
struct TALER_PlanchetMasterSecretP ps;
|
struct TALER_PlanchetMasterSecretP ps;
|
||||||
struct TALER_ExchangeWithdrawValues alg_values;
|
struct TALER_ExchangeWithdrawValues alg_values;
|
||||||
struct TALER_CoinSpendPublicKeyP coin_pub;
|
struct TALER_CoinSpendPublicKeyP coin_pub;
|
||||||
struct TALER_AgeCommitmentHash hac;
|
struct TALER_AgeCommitmentHashP hac;
|
||||||
union TALER_DenominationBlindingKeyP bks;
|
union TALER_DenominationBlindingKeyP bks;
|
||||||
|
|
||||||
RANDOMIZE (&coin_pub);
|
RANDOMIZE (&coin_pub);
|
||||||
|
@ -37,7 +37,7 @@ TEH_make_coin_known (const struct TALER_CoinPublicInfo *coin,
|
|||||||
{
|
{
|
||||||
enum TALER_EXCHANGEDB_CoinKnownStatus cks;
|
enum TALER_EXCHANGEDB_CoinKnownStatus cks;
|
||||||
struct TALER_DenominationHashP h_denom_pub;
|
struct TALER_DenominationHashP h_denom_pub;
|
||||||
struct TALER_AgeCommitmentHash age_hash;
|
struct TALER_AgeCommitmentHashP age_hash;
|
||||||
|
|
||||||
/* make sure coin is 'known' in database */
|
/* make sure coin is 'known' in database */
|
||||||
cks = TEH_plugin->ensure_coin_known (TEH_plugin->cls,
|
cks = TEH_plugin->ensure_coin_known (TEH_plugin->cls,
|
||||||
|
@ -260,7 +260,7 @@ create_transaction (void *cls,
|
|||||||
struct TALER_CoinSpendPublicKeyP coin_pub;
|
struct TALER_CoinSpendPublicKeyP coin_pub;
|
||||||
struct TALER_CoinSpendSignatureP coin_sig;
|
struct TALER_CoinSpendSignatureP coin_sig;
|
||||||
struct TALER_DenominationHashP h_denom_pub;
|
struct TALER_DenominationHashP h_denom_pub;
|
||||||
struct TALER_AgeCommitmentHash phac;
|
struct TALER_AgeCommitmentHashP phac;
|
||||||
char *partner_url = NULL;
|
char *partner_url = NULL;
|
||||||
|
|
||||||
TEH_plugin->rollback (TEH_plugin->cls);
|
TEH_plugin->rollback (TEH_plugin->cls);
|
||||||
|
@ -222,7 +222,7 @@ deposit_transaction (void *cls,
|
|||||||
struct TALER_CoinSpendPublicKeyP coin_pub;
|
struct TALER_CoinSpendPublicKeyP coin_pub;
|
||||||
struct TALER_CoinSpendSignatureP coin_sig;
|
struct TALER_CoinSpendSignatureP coin_sig;
|
||||||
struct TALER_DenominationHashP h_denom_pub;
|
struct TALER_DenominationHashP h_denom_pub;
|
||||||
struct TALER_AgeCommitmentHash phac;
|
struct TALER_AgeCommitmentHashP phac;
|
||||||
char *partner_url = NULL;
|
char *partner_url = NULL;
|
||||||
|
|
||||||
TEH_plugin->rollback (TEH_plugin->cls);
|
TEH_plugin->rollback (TEH_plugin->cls);
|
||||||
|
@ -263,8 +263,8 @@ check_commitment (struct RevealContext *rctx,
|
|||||||
const struct TALER_TransferPrivateKeyP *tpriv
|
const struct TALER_TransferPrivateKeyP *tpriv
|
||||||
= &rctx->transfer_privs[i - off];
|
= &rctx->transfer_privs[i - off];
|
||||||
struct TALER_TransferSecretP ts;
|
struct TALER_TransferSecretP ts;
|
||||||
struct TALER_AgeCommitmentHash h = {0};
|
struct TALER_AgeCommitmentHashP h = {0};
|
||||||
struct TALER_AgeCommitmentHash *hac = NULL;
|
struct TALER_AgeCommitmentHashP *hac = NULL;
|
||||||
|
|
||||||
GNUNET_CRYPTO_ecdhe_key_get_public (&tpriv->ecdhe_priv,
|
GNUNET_CRYPTO_ecdhe_key_get_public (&tpriv->ecdhe_priv,
|
||||||
&rce->transfer_pub.ecdhe_pub);
|
&rce->transfer_pub.ecdhe_pub);
|
||||||
@ -657,11 +657,11 @@ resolve_refreshes_reveal_denominations (
|
|||||||
|
|
||||||
/* Sanity check: Compare hash from melting with hash of this age commitment */
|
/* Sanity check: Compare hash from melting with hash of this age commitment */
|
||||||
{
|
{
|
||||||
struct TALER_AgeCommitmentHash hac = {0};
|
struct TALER_AgeCommitmentHashP hac = {0};
|
||||||
TALER_age_commitment_hash (oac, &hac);
|
TALER_age_commitment_hash (oac, &hac);
|
||||||
if (0 != memcmp (&hac,
|
if (0 != memcmp (&hac,
|
||||||
&rctx->melt.session.coin.h_age_commitment,
|
&rctx->melt.session.coin.h_age_commitment,
|
||||||
sizeof(struct TALER_AgeCommitmentHash)))
|
sizeof(struct TALER_AgeCommitmentHashP)))
|
||||||
goto clean_age;
|
goto clean_age;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ TEH_RESPONSE_compile_transaction_history (
|
|||||||
{
|
{
|
||||||
const struct TALER_EXCHANGEDB_MeltListEntry *melt =
|
const struct TALER_EXCHANGEDB_MeltListEntry *melt =
|
||||||
pos->details.melt;
|
pos->details.melt;
|
||||||
const struct TALER_AgeCommitmentHash *phac = NULL;
|
const struct TALER_AgeCommitmentHashP *phac = NULL;
|
||||||
|
|
||||||
#if ENABLE_SANITY_CHECKS
|
#if ENABLE_SANITY_CHECKS
|
||||||
TEH_METRICS_num_verifications[TEH_MT_SIGNATURE_EDDSA]++;
|
TEH_METRICS_num_verifications[TEH_MT_SIGNATURE_EDDSA]++;
|
||||||
@ -391,7 +391,7 @@ TEH_RESPONSE_compile_transaction_history (
|
|||||||
{
|
{
|
||||||
struct TALER_EXCHANGEDB_PurseDepositListEntry *pd
|
struct TALER_EXCHANGEDB_PurseDepositListEntry *pd
|
||||||
= pos->details.purse_deposit;
|
= pos->details.purse_deposit;
|
||||||
const struct TALER_AgeCommitmentHash *phac = NULL;
|
const struct TALER_AgeCommitmentHashP *phac = NULL;
|
||||||
|
|
||||||
if (! pd->no_age_commitment)
|
if (! pd->no_age_commitment)
|
||||||
phac = &pd->h_age_commitment;
|
phac = &pd->h_age_commitment;
|
||||||
|
@ -31,7 +31,7 @@ TEH_PG_ensure_coin_known (void *cls,
|
|||||||
const struct TALER_CoinPublicInfo *coin,
|
const struct TALER_CoinPublicInfo *coin,
|
||||||
uint64_t *known_coin_id,
|
uint64_t *known_coin_id,
|
||||||
struct TALER_DenominationHashP *denom_hash,
|
struct TALER_DenominationHashP *denom_hash,
|
||||||
struct TALER_AgeCommitmentHash *h_age_commitment)
|
struct TALER_AgeCommitmentHashP *h_age_commitment)
|
||||||
{
|
{
|
||||||
struct PostgresClosure *pg = cls;
|
struct PostgresClosure *pg = cls;
|
||||||
enum GNUNET_DB_QueryStatus qs;
|
enum GNUNET_DB_QueryStatus qs;
|
||||||
|
@ -40,6 +40,6 @@ TEH_PG_ensure_coin_known (void *cls,
|
|||||||
const struct TALER_CoinPublicInfo *coin,
|
const struct TALER_CoinPublicInfo *coin,
|
||||||
uint64_t *known_coin_id,
|
uint64_t *known_coin_id,
|
||||||
struct TALER_DenominationHashP *denom_hash,
|
struct TALER_DenominationHashP *denom_hash,
|
||||||
struct TALER_AgeCommitmentHash *h_age_commitment);
|
struct TALER_AgeCommitmentHashP *h_age_commitment);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -32,7 +32,7 @@ TEH_PG_get_purse_deposit (
|
|||||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||||
struct TALER_Amount *amount,
|
struct TALER_Amount *amount,
|
||||||
struct TALER_DenominationHashP *h_denom_pub,
|
struct TALER_DenominationHashP *h_denom_pub,
|
||||||
struct TALER_AgeCommitmentHash *phac,
|
struct TALER_AgeCommitmentHashP *phac,
|
||||||
struct TALER_CoinSpendSignatureP *coin_sig,
|
struct TALER_CoinSpendSignatureP *coin_sig,
|
||||||
char **partner_url)
|
char **partner_url)
|
||||||
{
|
{
|
||||||
|
@ -46,7 +46,7 @@ TEH_PG_get_purse_deposit (
|
|||||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||||
struct TALER_Amount *amount,
|
struct TALER_Amount *amount,
|
||||||
struct TALER_DenominationHashP *h_denom_pub,
|
struct TALER_DenominationHashP *h_denom_pub,
|
||||||
struct TALER_AgeCommitmentHash *phac,
|
struct TALER_AgeCommitmentHashP *phac,
|
||||||
struct TALER_CoinSpendSignatureP *coin_sig,
|
struct TALER_CoinSpendSignatureP *coin_sig,
|
||||||
char **partner_url);
|
char **partner_url);
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ refreshs_serial_helper_cb (void *cls,
|
|||||||
struct TALER_DenominationPublicKey denom_pub;
|
struct TALER_DenominationPublicKey denom_pub;
|
||||||
struct TALER_CoinSpendPublicKeyP coin_pub;
|
struct TALER_CoinSpendPublicKeyP coin_pub;
|
||||||
struct TALER_CoinSpendSignatureP coin_sig;
|
struct TALER_CoinSpendSignatureP coin_sig;
|
||||||
struct TALER_AgeCommitmentHash h_age_commitment;
|
struct TALER_AgeCommitmentHashP h_age_commitment;
|
||||||
bool ac_isnull;
|
bool ac_isnull;
|
||||||
struct TALER_Amount amount_with_fee;
|
struct TALER_Amount amount_with_fee;
|
||||||
uint32_t noreveal_index;
|
uint32_t noreveal_index;
|
||||||
@ -130,10 +130,6 @@ refreshs_serial_helper_cb (void *cls,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
enum GNUNET_DB_QueryStatus
|
enum GNUNET_DB_QueryStatus
|
||||||
TEH_PG_select_refreshes_above_serial_id (
|
TEH_PG_select_refreshes_above_serial_id (
|
||||||
void *cls,
|
void *cls,
|
||||||
|
@ -449,7 +449,7 @@ audit_refresh_session_cb (
|
|||||||
void *cls,
|
void *cls,
|
||||||
uint64_t rowid,
|
uint64_t rowid,
|
||||||
const struct TALER_DenominationPublicKey *denom_pub,
|
const struct TALER_DenominationPublicKey *denom_pub,
|
||||||
const struct TALER_AgeCommitmentHash *h_age_commitment,
|
const struct TALER_AgeCommitmentHashP *h_age_commitment,
|
||||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||||
const struct TALER_CoinSpendSignatureP *coin_sig,
|
const struct TALER_CoinSpendSignatureP *coin_sig,
|
||||||
const struct TALER_Amount *amount_with_fee,
|
const struct TALER_Amount *amount_with_fee,
|
||||||
@ -1340,8 +1340,8 @@ run (void *cls)
|
|||||||
{
|
{
|
||||||
struct TALER_PlanchetDetail pd;
|
struct TALER_PlanchetDetail pd;
|
||||||
struct TALER_CoinSpendPublicKeyP coin_pub;
|
struct TALER_CoinSpendPublicKeyP coin_pub;
|
||||||
struct TALER_AgeCommitmentHash age_hash;
|
struct TALER_AgeCommitmentHashP age_hash;
|
||||||
struct TALER_AgeCommitmentHash *p_ah[2] = {
|
struct TALER_AgeCommitmentHashP *p_ah[2] = {
|
||||||
NULL,
|
NULL,
|
||||||
&age_hash
|
&age_hash
|
||||||
};
|
};
|
||||||
@ -1465,7 +1465,7 @@ run (void *cls)
|
|||||||
deadline = GNUNET_TIME_timestamp_get ();
|
deadline = GNUNET_TIME_timestamp_get ();
|
||||||
{
|
{
|
||||||
struct TALER_DenominationHashP dph;
|
struct TALER_DenominationHashP dph;
|
||||||
struct TALER_AgeCommitmentHash agh;
|
struct TALER_AgeCommitmentHashP agh;
|
||||||
|
|
||||||
FAILIF (TALER_EXCHANGEDB_CKS_ADDED !=
|
FAILIF (TALER_EXCHANGEDB_CKS_ADDED !=
|
||||||
plugin->ensure_coin_known (plugin->cls,
|
plugin->ensure_coin_known (plugin->cls,
|
||||||
@ -1713,7 +1713,7 @@ run (void *cls)
|
|||||||
uint64_t new_known_coin_id;
|
uint64_t new_known_coin_id;
|
||||||
struct TALER_CoinPublicInfo new_coin;
|
struct TALER_CoinPublicInfo new_coin;
|
||||||
struct TALER_DenominationHashP dph;
|
struct TALER_DenominationHashP dph;
|
||||||
struct TALER_AgeCommitmentHash agh;
|
struct TALER_AgeCommitmentHashP agh;
|
||||||
bool recoup_ok;
|
bool recoup_ok;
|
||||||
bool internal_failure;
|
bool internal_failure;
|
||||||
|
|
||||||
@ -2086,7 +2086,7 @@ run (void *cls)
|
|||||||
{
|
{
|
||||||
uint64_t known_coin_id;
|
uint64_t known_coin_id;
|
||||||
struct TALER_DenominationHashP dph;
|
struct TALER_DenominationHashP dph;
|
||||||
struct TALER_AgeCommitmentHash agh;
|
struct TALER_AgeCommitmentHashP agh;
|
||||||
|
|
||||||
FAILIF (TALER_EXCHANGEDB_CKS_ADDED !=
|
FAILIF (TALER_EXCHANGEDB_CKS_ADDED !=
|
||||||
plugin->ensure_coin_known (plugin->cls,
|
plugin->ensure_coin_known (plugin->cls,
|
||||||
|
@ -183,6 +183,7 @@ create_denom_key_pair (unsigned int size,
|
|||||||
return dkp;
|
return dkp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function called with the session hashes and transfer secret
|
* Function called with the session hashes and transfer secret
|
||||||
* information for a given coin.
|
* information for a given coin.
|
||||||
@ -223,7 +224,6 @@ handle_link_data_cb (void *cls,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main function that will be run by the scheduler.
|
* Main function that will be run by the scheduler.
|
||||||
*
|
*
|
||||||
@ -238,12 +238,12 @@ run (void *cls)
|
|||||||
struct GNUNET_CONFIGURATION_Handle *cfg = cls;
|
struct GNUNET_CONFIGURATION_Handle *cfg = cls;
|
||||||
const uint32_t num_partitions = 10;
|
const uint32_t num_partitions = 10;
|
||||||
struct DenomKeyPair *dkp = NULL;
|
struct DenomKeyPair *dkp = NULL;
|
||||||
struct TALER_EXCHANGEDB_Deposit *depos=NULL;
|
struct TALER_EXCHANGEDB_Deposit *depos = NULL;
|
||||||
struct TALER_Amount value;
|
struct TALER_Amount value;
|
||||||
struct TALER_DenominationPublicKey *new_denom_pubs = NULL;
|
struct TALER_DenominationPublicKey *new_denom_pubs = NULL;
|
||||||
struct GNUNET_TIME_Relative times = GNUNET_TIME_UNIT_ZERO;
|
struct GNUNET_TIME_Relative times = GNUNET_TIME_UNIT_ZERO;
|
||||||
unsigned long long sqrs=0;
|
unsigned long long sqrs = 0;
|
||||||
struct TALER_EXCHANGEDB_Refund *ref=NULL;
|
struct TALER_EXCHANGEDB_Refund *ref = NULL;
|
||||||
unsigned int *perm;
|
unsigned int *perm;
|
||||||
unsigned long long duration_sq;
|
unsigned long long duration_sq;
|
||||||
struct TALER_EXCHANGEDB_RefreshRevealedCoin *ccoin;
|
struct TALER_EXCHANGEDB_RefreshRevealedCoin *ccoin;
|
||||||
@ -251,11 +251,11 @@ run (void *cls)
|
|||||||
.cipher = TALER_DENOMINATION_RSA
|
.cipher = TALER_DENOMINATION_RSA
|
||||||
};
|
};
|
||||||
|
|
||||||
ref = GNUNET_new_array (ROUNDS +1,
|
ref = GNUNET_new_array (ROUNDS + 1,
|
||||||
struct TALER_EXCHANGEDB_Refund);
|
struct TALER_EXCHANGEDB_Refund);
|
||||||
depos = GNUNET_new_array (ROUNDS +1,
|
depos = GNUNET_new_array (ROUNDS + 1,
|
||||||
struct TALER_EXCHANGEDB_Deposit);
|
struct TALER_EXCHANGEDB_Deposit);
|
||||||
refresh = GNUNET_new_array (ROUNDS +1,
|
refresh = GNUNET_new_array (ROUNDS + 1,
|
||||||
struct TALER_EXCHANGEDB_Refresh);
|
struct TALER_EXCHANGEDB_Refresh);
|
||||||
|
|
||||||
if (NULL ==
|
if (NULL ==
|
||||||
@ -297,15 +297,15 @@ run (void *cls)
|
|||||||
GNUNET_assert (GNUNET_OK ==
|
GNUNET_assert (GNUNET_OK ==
|
||||||
TALER_string_to_amount (CURRENCY ":0.000010",
|
TALER_string_to_amount (CURRENCY ":0.000010",
|
||||||
&fees.refund));
|
&fees.refund));
|
||||||
//DENOMINATION
|
// DENOMINATION
|
||||||
{
|
{
|
||||||
//PAIR KEY LIST
|
// PAIR KEY LIST
|
||||||
new_dkp = GNUNET_new_array (MELT_NEW_COINS,
|
new_dkp = GNUNET_new_array (MELT_NEW_COINS,
|
||||||
struct DenomKeyPair *);
|
struct DenomKeyPair *);
|
||||||
//PUBLIC KEY LIST
|
// PUBLIC KEY LIST
|
||||||
new_denom_pubs = GNUNET_new_array (MELT_NEW_COINS,
|
new_denom_pubs = GNUNET_new_array (MELT_NEW_COINS,
|
||||||
struct TALER_DenominationPublicKey);
|
struct TALER_DenominationPublicKey);
|
||||||
//REFRESH REVEAL COIN LIST
|
// REFRESH REVEAL COIN LIST
|
||||||
revealed_coins
|
revealed_coins
|
||||||
= GNUNET_new_array (MELT_NEW_COINS,
|
= GNUNET_new_array (MELT_NEW_COINS,
|
||||||
struct TALER_EXCHANGEDB_RefreshRevealedCoin);
|
struct TALER_EXCHANGEDB_RefreshRevealedCoin);
|
||||||
@ -316,7 +316,7 @@ run (void *cls)
|
|||||||
struct TALER_BlindedPlanchet *bp;
|
struct TALER_BlindedPlanchet *bp;
|
||||||
|
|
||||||
now = GNUNET_TIME_timestamp_get ();
|
now = GNUNET_TIME_timestamp_get ();
|
||||||
//5 KEY PAIR
|
// 5 KEY PAIR
|
||||||
new_dkp[cnt] = create_denom_key_pair (RSA_KEY_SIZE,
|
new_dkp[cnt] = create_denom_key_pair (RSA_KEY_SIZE,
|
||||||
now,
|
now,
|
||||||
&value,
|
&value,
|
||||||
@ -349,7 +349,7 @@ run (void *cls)
|
|||||||
}
|
}
|
||||||
perm = GNUNET_CRYPTO_random_permute (GNUNET_CRYPTO_QUALITY_NONCE,
|
perm = GNUNET_CRYPTO_random_permute (GNUNET_CRYPTO_QUALITY_NONCE,
|
||||||
NUM_ROWS);
|
NUM_ROWS);
|
||||||
//BEGIN
|
// BEGIN
|
||||||
FAILIF (GNUNET_OK !=
|
FAILIF (GNUNET_OK !=
|
||||||
plugin->start (plugin->cls,
|
plugin->start (plugin->cls,
|
||||||
"Transaction"));
|
"Transaction"));
|
||||||
@ -358,7 +358,7 @@ run (void *cls)
|
|||||||
union TALER_DenominationBlindingKeyP bks;
|
union TALER_DenominationBlindingKeyP bks;
|
||||||
struct TALER_CoinSpendPublicKeyP coin_pub;
|
struct TALER_CoinSpendPublicKeyP coin_pub;
|
||||||
struct TALER_CoinPubHashP c_hash;
|
struct TALER_CoinPubHashP c_hash;
|
||||||
unsigned int k = (unsigned int)rand()%5;
|
unsigned int k = (unsigned int) rand () % 5;
|
||||||
unsigned int i = perm[j];
|
unsigned int i = perm[j];
|
||||||
if (i >= ROUNDS)
|
if (i >= ROUNDS)
|
||||||
i = ROUNDS; /* throw-away slot, do not keep around */
|
i = ROUNDS; /* throw-away slot, do not keep around */
|
||||||
@ -379,7 +379,7 @@ run (void *cls)
|
|||||||
/* ENSURE_COIN_KNOWN */
|
/* ENSURE_COIN_KNOWN */
|
||||||
uint64_t known_coin_id;
|
uint64_t known_coin_id;
|
||||||
struct TALER_DenominationHashP dph;
|
struct TALER_DenominationHashP dph;
|
||||||
struct TALER_AgeCommitmentHash agh;
|
struct TALER_AgeCommitmentHashP agh;
|
||||||
bool zombie_required = false;
|
bool zombie_required = false;
|
||||||
bool balance_ok;
|
bool balance_ok;
|
||||||
FAILIF (TALER_EXCHANGEDB_CKS_ADDED !=
|
FAILIF (TALER_EXCHANGEDB_CKS_ADDED !=
|
||||||
@ -407,7 +407,7 @@ run (void *cls)
|
|||||||
/**** INSERT REFRESH_REVEAL + TRANSFER_KEYS *****/
|
/**** INSERT REFRESH_REVEAL + TRANSFER_KEYS *****/
|
||||||
RND_BLK (&tprivs);
|
RND_BLK (&tprivs);
|
||||||
RND_BLK (&tpub);
|
RND_BLK (&tpub);
|
||||||
RND_BLK(&melt_serial_id);
|
RND_BLK (&melt_serial_id);
|
||||||
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
||||||
plugin->insert_refresh_reveal (plugin->cls,
|
plugin->insert_refresh_reveal (plugin->cls,
|
||||||
melt_serial_id,
|
melt_serial_id,
|
||||||
@ -420,17 +420,17 @@ run (void *cls)
|
|||||||
TALER_denom_sig_free (&depos[i].coin.denom_sig);
|
TALER_denom_sig_free (&depos[i].coin.denom_sig);
|
||||||
}
|
}
|
||||||
/* End of benchmark setup */
|
/* End of benchmark setup */
|
||||||
GNUNET_free(perm);
|
GNUNET_free (perm);
|
||||||
// commit
|
// commit
|
||||||
FAILIF (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
|
FAILIF (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
|
||||||
plugin->commit (plugin->cls));
|
plugin->commit (plugin->cls));
|
||||||
/**** CALL GET LINK DATA ****/
|
/**** CALL GET LINK DATA ****/
|
||||||
for (unsigned int r=0; r< ROUNDS; r++)
|
for (unsigned int r = 0; r< ROUNDS; r++)
|
||||||
{
|
{
|
||||||
struct GNUNET_TIME_Absolute time;
|
struct GNUNET_TIME_Absolute time;
|
||||||
struct GNUNET_TIME_Relative duration;
|
struct GNUNET_TIME_Relative duration;
|
||||||
enum GNUNET_DB_QueryStatus qs;
|
enum GNUNET_DB_QueryStatus qs;
|
||||||
time = GNUNET_TIME_absolute_get();
|
time = GNUNET_TIME_absolute_get ();
|
||||||
qs = plugin->get_link_data (plugin->cls,
|
qs = plugin->get_link_data (plugin->cls,
|
||||||
&refresh[r].coin.coin_pub,
|
&refresh[r].coin.coin_pub,
|
||||||
&handle_link_data_cb,
|
&handle_link_data_cb,
|
||||||
@ -441,7 +441,8 @@ run (void *cls)
|
|||||||
times = GNUNET_TIME_relative_add (times,
|
times = GNUNET_TIME_relative_add (times,
|
||||||
duration);
|
duration);
|
||||||
duration_sq = duration.rel_value_us * duration.rel_value_us;
|
duration_sq = duration.rel_value_us * duration.rel_value_us;
|
||||||
GNUNET_assert (duration_sq / duration.rel_value_us == duration.rel_value_us);
|
GNUNET_assert (duration_sq / duration.rel_value_us ==
|
||||||
|
duration.rel_value_us);
|
||||||
GNUNET_assert (sqrs + duration_sq >= sqrs);
|
GNUNET_assert (sqrs + duration_sq >= sqrs);
|
||||||
sqrs += duration_sq;
|
sqrs += duration_sq;
|
||||||
}
|
}
|
||||||
@ -456,10 +457,10 @@ run (void *cls)
|
|||||||
ROUNDS);
|
ROUNDS);
|
||||||
avg_dbl = avg.rel_value_us;
|
avg_dbl = avg.rel_value_us;
|
||||||
variance = sqrs - (avg_dbl * avg_dbl * ROUNDS);
|
variance = sqrs - (avg_dbl * avg_dbl * ROUNDS);
|
||||||
fprintf(stdout,
|
fprintf (stdout,
|
||||||
"%8llu ± %6.0f\n",
|
"%8llu ± %6.0f\n",
|
||||||
(unsigned long long) avg.rel_value_us,
|
(unsigned long long) avg.rel_value_us,
|
||||||
sqrt (variance / (ROUNDS-1)));
|
sqrt (variance / (ROUNDS - 1)));
|
||||||
}
|
}
|
||||||
result = 0;
|
result = 0;
|
||||||
drop:
|
drop:
|
||||||
@ -484,13 +485,13 @@ cleanup:
|
|||||||
cnt++)
|
cnt++)
|
||||||
destroy_denom_key_pair (new_dkp[cnt]);
|
destroy_denom_key_pair (new_dkp[cnt]);
|
||||||
GNUNET_free (new_dkp);
|
GNUNET_free (new_dkp);
|
||||||
for (unsigned int i=0; i< ROUNDS; i++)
|
for (unsigned int i = 0; i< ROUNDS; i++)
|
||||||
{
|
{
|
||||||
TALER_denom_sig_free (&depos[i].coin.denom_sig);
|
TALER_denom_sig_free (&depos[i].coin.denom_sig);
|
||||||
}
|
}
|
||||||
GNUNET_free(depos);
|
GNUNET_free (depos);
|
||||||
GNUNET_free(ref);
|
GNUNET_free (ref);
|
||||||
GNUNET_free(refresh);
|
GNUNET_free (refresh);
|
||||||
dkp = NULL;
|
dkp = NULL;
|
||||||
TALER_EXCHANGEDB_plugin_unload (plugin);
|
TALER_EXCHANGEDB_plugin_unload (plugin);
|
||||||
plugin = NULL;
|
plugin = NULL;
|
||||||
|
@ -183,8 +183,6 @@ create_denom_key_pair (unsigned int size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main function that will be run by the scheduler.
|
* Main function that will be run by the scheduler.
|
||||||
*
|
*
|
||||||
@ -201,9 +199,9 @@ run (void *cls)
|
|||||||
struct TALER_EXCHANGEDB_CollectableBlindcoin cbc;
|
struct TALER_EXCHANGEDB_CollectableBlindcoin cbc;
|
||||||
struct TALER_DenominationPublicKey *new_denom_pubs = NULL;
|
struct TALER_DenominationPublicKey *new_denom_pubs = NULL;
|
||||||
struct GNUNET_TIME_Relative times = GNUNET_TIME_UNIT_ZERO;
|
struct GNUNET_TIME_Relative times = GNUNET_TIME_UNIT_ZERO;
|
||||||
unsigned long long sqrs=0;
|
unsigned long long sqrs = 0;
|
||||||
struct TALER_EXCHANGEDB_Deposit *depos=NULL;
|
struct TALER_EXCHANGEDB_Deposit *depos = NULL;
|
||||||
struct TALER_EXCHANGEDB_Refund *ref=NULL;
|
struct TALER_EXCHANGEDB_Refund *ref = NULL;
|
||||||
unsigned int *perm;
|
unsigned int *perm;
|
||||||
unsigned long long duration_sq;
|
unsigned long long duration_sq;
|
||||||
struct TALER_EXCHANGEDB_RefreshRevealedCoin *ccoin;
|
struct TALER_EXCHANGEDB_RefreshRevealedCoin *ccoin;
|
||||||
@ -211,9 +209,9 @@ run (void *cls)
|
|||||||
.cipher = TALER_DENOMINATION_RSA
|
.cipher = TALER_DENOMINATION_RSA
|
||||||
};
|
};
|
||||||
|
|
||||||
ref = GNUNET_new_array (ROUNDS +1,
|
ref = GNUNET_new_array (ROUNDS + 1,
|
||||||
struct TALER_EXCHANGEDB_Refund);
|
struct TALER_EXCHANGEDB_Refund);
|
||||||
depos = GNUNET_new_array (ROUNDS +1,
|
depos = GNUNET_new_array (ROUNDS + 1,
|
||||||
struct TALER_EXCHANGEDB_Deposit);
|
struct TALER_EXCHANGEDB_Deposit);
|
||||||
|
|
||||||
if (NULL ==
|
if (NULL ==
|
||||||
@ -255,16 +253,16 @@ run (void *cls)
|
|||||||
GNUNET_assert (GNUNET_OK ==
|
GNUNET_assert (GNUNET_OK ==
|
||||||
TALER_string_to_amount (CURRENCY ":0.000010",
|
TALER_string_to_amount (CURRENCY ":0.000010",
|
||||||
&fees.refund));
|
&fees.refund));
|
||||||
//DENOMINATION
|
// DENOMINATION
|
||||||
{
|
{
|
||||||
ZR_BLK (&cbc);
|
ZR_BLK (&cbc);
|
||||||
//PAIR KEY LIST
|
// PAIR KEY LIST
|
||||||
new_dkp = GNUNET_new_array (MELT_NEW_COINS,
|
new_dkp = GNUNET_new_array (MELT_NEW_COINS,
|
||||||
struct DenomKeyPair *);
|
struct DenomKeyPair *);
|
||||||
//PUBLIC KEY LIST
|
// PUBLIC KEY LIST
|
||||||
new_denom_pubs = GNUNET_new_array (MELT_NEW_COINS,
|
new_denom_pubs = GNUNET_new_array (MELT_NEW_COINS,
|
||||||
struct TALER_DenominationPublicKey);
|
struct TALER_DenominationPublicKey);
|
||||||
//REFRESH REVEAL COIN LIST
|
// REFRESH REVEAL COIN LIST
|
||||||
revealed_coins
|
revealed_coins
|
||||||
= GNUNET_new_array (MELT_NEW_COINS,
|
= GNUNET_new_array (MELT_NEW_COINS,
|
||||||
struct TALER_EXCHANGEDB_RefreshRevealedCoin);
|
struct TALER_EXCHANGEDB_RefreshRevealedCoin);
|
||||||
@ -275,7 +273,7 @@ run (void *cls)
|
|||||||
struct TALER_BlindedPlanchet *bp;
|
struct TALER_BlindedPlanchet *bp;
|
||||||
|
|
||||||
now = GNUNET_TIME_timestamp_get ();
|
now = GNUNET_TIME_timestamp_get ();
|
||||||
//5 KEY PAIR
|
// 5 KEY PAIR
|
||||||
new_dkp[cnt] = create_denom_key_pair (RSA_KEY_SIZE,
|
new_dkp[cnt] = create_denom_key_pair (RSA_KEY_SIZE,
|
||||||
now,
|
now,
|
||||||
&value,
|
&value,
|
||||||
@ -319,7 +317,7 @@ run (void *cls)
|
|||||||
}
|
}
|
||||||
perm = GNUNET_CRYPTO_random_permute (GNUNET_CRYPTO_QUALITY_NONCE,
|
perm = GNUNET_CRYPTO_random_permute (GNUNET_CRYPTO_QUALITY_NONCE,
|
||||||
NUM_ROWS);
|
NUM_ROWS);
|
||||||
//BEGIN
|
// BEGIN
|
||||||
FAILIF (GNUNET_OK !=
|
FAILIF (GNUNET_OK !=
|
||||||
plugin->start (plugin->cls,
|
plugin->start (plugin->cls,
|
||||||
"Transaction"));
|
"Transaction"));
|
||||||
@ -331,7 +329,7 @@ run (void *cls)
|
|||||||
struct TALER_CoinSpendPublicKeyP coin_pub;
|
struct TALER_CoinSpendPublicKeyP coin_pub;
|
||||||
struct TALER_ReservePublicKeyP reserve_pub;
|
struct TALER_ReservePublicKeyP reserve_pub;
|
||||||
struct TALER_CoinPubHashP c_hash;
|
struct TALER_CoinPubHashP c_hash;
|
||||||
unsigned int k = (unsigned int)rand()%5;
|
unsigned int k = (unsigned int) rand () % 5;
|
||||||
unsigned int i = perm[j];
|
unsigned int i = perm[j];
|
||||||
if (i >= ROUNDS)
|
if (i >= ROUNDS)
|
||||||
i = ROUNDS; /* throw-away slot, do not keep around */
|
i = ROUNDS; /* throw-away slot, do not keep around */
|
||||||
@ -394,7 +392,7 @@ run (void *cls)
|
|||||||
/* ENSURE_COIN_KNOWN */
|
/* ENSURE_COIN_KNOWN */
|
||||||
uint64_t known_coin_id;
|
uint64_t known_coin_id;
|
||||||
struct TALER_DenominationHashP dph;
|
struct TALER_DenominationHashP dph;
|
||||||
struct TALER_AgeCommitmentHash agh;
|
struct TALER_AgeCommitmentHashP agh;
|
||||||
FAILIF (TALER_EXCHANGEDB_CKS_ADDED !=
|
FAILIF (TALER_EXCHANGEDB_CKS_ADDED !=
|
||||||
plugin->ensure_coin_known (plugin->cls,
|
plugin->ensure_coin_known (plugin->cls,
|
||||||
&depos[i].coin,
|
&depos[i].coin,
|
||||||
@ -420,18 +418,18 @@ run (void *cls)
|
|||||||
TALER_denom_sig_free (&depos[i].coin.denom_sig);
|
TALER_denom_sig_free (&depos[i].coin.denom_sig);
|
||||||
}
|
}
|
||||||
/* End of benchmark setup */
|
/* End of benchmark setup */
|
||||||
GNUNET_free(perm);
|
GNUNET_free (perm);
|
||||||
// commit
|
// commit
|
||||||
FAILIF (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
|
FAILIF (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
|
||||||
plugin->commit (plugin->cls));
|
plugin->commit (plugin->cls));
|
||||||
/**** CALL GET LINK DATA ****/
|
/**** CALL GET LINK DATA ****/
|
||||||
for (unsigned int r=0; r< ROUNDS; r++)
|
for (unsigned int r = 0; r< ROUNDS; r++)
|
||||||
{
|
{
|
||||||
struct GNUNET_TIME_Absolute time;
|
struct GNUNET_TIME_Absolute time;
|
||||||
struct GNUNET_TIME_Relative duration;
|
struct GNUNET_TIME_Relative duration;
|
||||||
struct TALER_MerchantPublicKeyP merchant_pub;
|
struct TALER_MerchantPublicKeyP merchant_pub;
|
||||||
char *payto_uri;
|
char *payto_uri;
|
||||||
time = GNUNET_TIME_absolute_get();
|
time = GNUNET_TIME_absolute_get ();
|
||||||
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
|
||||||
plugin->get_ready_deposit (plugin->cls,
|
plugin->get_ready_deposit (plugin->cls,
|
||||||
0,
|
0,
|
||||||
@ -443,7 +441,8 @@ run (void *cls)
|
|||||||
times = GNUNET_TIME_relative_add (times,
|
times = GNUNET_TIME_relative_add (times,
|
||||||
duration);
|
duration);
|
||||||
duration_sq = duration.rel_value_us * duration.rel_value_us;
|
duration_sq = duration.rel_value_us * duration.rel_value_us;
|
||||||
GNUNET_assert (duration_sq / duration.rel_value_us == duration.rel_value_us);
|
GNUNET_assert (duration_sq / duration.rel_value_us ==
|
||||||
|
duration.rel_value_us);
|
||||||
GNUNET_assert (sqrs + duration_sq >= sqrs);
|
GNUNET_assert (sqrs + duration_sq >= sqrs);
|
||||||
sqrs += duration_sq;
|
sqrs += duration_sq;
|
||||||
}
|
}
|
||||||
@ -458,10 +457,10 @@ run (void *cls)
|
|||||||
ROUNDS);
|
ROUNDS);
|
||||||
avg_dbl = avg.rel_value_us;
|
avg_dbl = avg.rel_value_us;
|
||||||
variance = sqrs - (avg_dbl * avg_dbl * ROUNDS);
|
variance = sqrs - (avg_dbl * avg_dbl * ROUNDS);
|
||||||
fprintf(stdout,
|
fprintf (stdout,
|
||||||
"%8llu ± %6.0f\n",
|
"%8llu ± %6.0f\n",
|
||||||
(unsigned long long) avg.rel_value_us,
|
(unsigned long long) avg.rel_value_us,
|
||||||
sqrt (variance / (ROUNDS-1)));
|
sqrt (variance / (ROUNDS - 1)));
|
||||||
}
|
}
|
||||||
result = 0;
|
result = 0;
|
||||||
drop:
|
drop:
|
||||||
@ -484,12 +483,12 @@ cleanup:
|
|||||||
cnt++)
|
cnt++)
|
||||||
destroy_denom_key_pair (new_dkp[cnt]);
|
destroy_denom_key_pair (new_dkp[cnt]);
|
||||||
GNUNET_free (new_dkp);
|
GNUNET_free (new_dkp);
|
||||||
for (unsigned int i=0; i< ROUNDS ; i++)
|
for (unsigned int i = 0; i< ROUNDS; i++)
|
||||||
{
|
{
|
||||||
TALER_denom_sig_free (&depos[i].coin.denom_sig);
|
TALER_denom_sig_free (&depos[i].coin.denom_sig);
|
||||||
}
|
}
|
||||||
GNUNET_free(depos);
|
GNUNET_free (depos);
|
||||||
GNUNET_free(ref);
|
GNUNET_free (ref);
|
||||||
TALER_EXCHANGEDB_plugin_unload (plugin);
|
TALER_EXCHANGEDB_plugin_unload (plugin);
|
||||||
plugin = NULL;
|
plugin = NULL;
|
||||||
}
|
}
|
||||||
|
@ -172,6 +172,8 @@ create_denom_key_pair (unsigned int size,
|
|||||||
}
|
}
|
||||||
return dkp;
|
return dkp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Callback invoked with information about refunds applicable
|
* Callback invoked with information about refunds applicable
|
||||||
* to a particular coin.
|
* to a particular coin.
|
||||||
@ -209,7 +211,7 @@ run (void *cls)
|
|||||||
const uint32_t num_partitions = 10;
|
const uint32_t num_partitions = 10;
|
||||||
struct DenomKeyPair *dkp = NULL;
|
struct DenomKeyPair *dkp = NULL;
|
||||||
struct GNUNET_TIME_Timestamp ts;
|
struct GNUNET_TIME_Timestamp ts;
|
||||||
struct TALER_EXCHANGEDB_Deposit *depos=NULL;
|
struct TALER_EXCHANGEDB_Deposit *depos = NULL;
|
||||||
struct GNUNET_TIME_Timestamp deadline;
|
struct GNUNET_TIME_Timestamp deadline;
|
||||||
struct TALER_Amount value;
|
struct TALER_Amount value;
|
||||||
union TALER_DenominationBlindingKeyP bks;
|
union TALER_DenominationBlindingKeyP bks;
|
||||||
@ -220,15 +222,15 @@ run (void *cls)
|
|||||||
};
|
};
|
||||||
struct GNUNET_TIME_Relative times = GNUNET_TIME_UNIT_ZERO;
|
struct GNUNET_TIME_Relative times = GNUNET_TIME_UNIT_ZERO;
|
||||||
unsigned long long sqrs = 0;
|
unsigned long long sqrs = 0;
|
||||||
struct TALER_EXCHANGEDB_Refund *ref=NULL;
|
struct TALER_EXCHANGEDB_Refund *ref = NULL;
|
||||||
unsigned int *perm;
|
unsigned int *perm;
|
||||||
unsigned long long duration_sq;
|
unsigned long long duration_sq;
|
||||||
struct TALER_CoinSpendPublicKeyP coin_pub;
|
struct TALER_CoinSpendPublicKeyP coin_pub;
|
||||||
struct TALER_EXCHANGEDB_RefreshRevealedCoin *ccoin;
|
struct TALER_EXCHANGEDB_RefreshRevealedCoin *ccoin;
|
||||||
struct TALER_DenominationPublicKey *new_denom_pubs = NULL;
|
struct TALER_DenominationPublicKey *new_denom_pubs = NULL;
|
||||||
ref = GNUNET_new_array (ROUNDS +1,
|
ref = GNUNET_new_array (ROUNDS + 1,
|
||||||
struct TALER_EXCHANGEDB_Refund);
|
struct TALER_EXCHANGEDB_Refund);
|
||||||
depos = GNUNET_new_array (ROUNDS +1,
|
depos = GNUNET_new_array (ROUNDS + 1,
|
||||||
struct TALER_EXCHANGEDB_Deposit);
|
struct TALER_EXCHANGEDB_Deposit);
|
||||||
ZR_BLK (&cbc);
|
ZR_BLK (&cbc);
|
||||||
|
|
||||||
@ -276,15 +278,15 @@ run (void *cls)
|
|||||||
|
|
||||||
ts = GNUNET_TIME_timestamp_get ();
|
ts = GNUNET_TIME_timestamp_get ();
|
||||||
deadline = GNUNET_TIME_timestamp_get ();
|
deadline = GNUNET_TIME_timestamp_get ();
|
||||||
//DENOMINATION
|
// DENOMINATION
|
||||||
{
|
{
|
||||||
//PAIR KEY LIST
|
// PAIR KEY LIST
|
||||||
new_dkp = GNUNET_new_array (MELT_NEW_COINS,
|
new_dkp = GNUNET_new_array (MELT_NEW_COINS,
|
||||||
struct DenomKeyPair *);
|
struct DenomKeyPair *);
|
||||||
//PUBLIC KEY LIST
|
// PUBLIC KEY LIST
|
||||||
new_denom_pubs = GNUNET_new_array (MELT_NEW_COINS,
|
new_denom_pubs = GNUNET_new_array (MELT_NEW_COINS,
|
||||||
struct TALER_DenominationPublicKey);
|
struct TALER_DenominationPublicKey);
|
||||||
//REFRESH REVEAL COIN LIST
|
// REFRESH REVEAL COIN LIST
|
||||||
revealed_coins
|
revealed_coins
|
||||||
= GNUNET_new_array (MELT_NEW_COINS,
|
= GNUNET_new_array (MELT_NEW_COINS,
|
||||||
struct TALER_EXCHANGEDB_RefreshRevealedCoin);
|
struct TALER_EXCHANGEDB_RefreshRevealedCoin);
|
||||||
@ -295,7 +297,7 @@ run (void *cls)
|
|||||||
struct TALER_BlindedPlanchet *bp;
|
struct TALER_BlindedPlanchet *bp;
|
||||||
|
|
||||||
now = GNUNET_TIME_timestamp_get ();
|
now = GNUNET_TIME_timestamp_get ();
|
||||||
//5 KEY PAIR
|
// 5 KEY PAIR
|
||||||
new_dkp[cnt] = create_denom_key_pair (RSA_KEY_SIZE,
|
new_dkp[cnt] = create_denom_key_pair (RSA_KEY_SIZE,
|
||||||
now,
|
now,
|
||||||
&value,
|
&value,
|
||||||
@ -344,10 +346,10 @@ run (void *cls)
|
|||||||
FAILIF (GNUNET_OK !=
|
FAILIF (GNUNET_OK !=
|
||||||
plugin->start (plugin->cls,
|
plugin->start (plugin->cls,
|
||||||
"Transaction"));
|
"Transaction"));
|
||||||
for (unsigned int j=0; j< NUM_ROWS; j++)
|
for (unsigned int j = 0; j< NUM_ROWS; j++)
|
||||||
{
|
{
|
||||||
unsigned int i = perm[j];
|
unsigned int i = perm[j];
|
||||||
unsigned int k = (unsigned int)rand()%5;
|
unsigned int k = (unsigned int) rand () % 5;
|
||||||
if (i >= ROUNDS)
|
if (i >= ROUNDS)
|
||||||
i = ROUNDS; /* throw-away slot, do not keep around */
|
i = ROUNDS; /* throw-away slot, do not keep around */
|
||||||
RND_BLK (&coin_pub);
|
RND_BLK (&coin_pub);
|
||||||
@ -380,10 +382,10 @@ run (void *cls)
|
|||||||
&h_wire_wt);
|
&h_wire_wt);
|
||||||
depos[i].timestamp = ts;
|
depos[i].timestamp = ts;
|
||||||
uint64_t known_coin_id;
|
uint64_t known_coin_id;
|
||||||
{//ENSURE_COIN_KNOWN
|
{// ENSURE_COIN_KNOWN
|
||||||
|
|
||||||
struct TALER_DenominationHashP dph;
|
struct TALER_DenominationHashP dph;
|
||||||
struct TALER_AgeCommitmentHash agh;
|
struct TALER_AgeCommitmentHashP agh;
|
||||||
FAILIF (TALER_EXCHANGEDB_CKS_ADDED !=
|
FAILIF (TALER_EXCHANGEDB_CKS_ADDED !=
|
||||||
plugin->ensure_coin_known (plugin->cls,
|
plugin->ensure_coin_known (plugin->cls,
|
||||||
&depos[i].coin,
|
&depos[i].coin,
|
||||||
@ -409,7 +411,7 @@ run (void *cls)
|
|||||||
bool conflict;
|
bool conflict;
|
||||||
ref[i].coin = depos[i].coin;
|
ref[i].coin = depos[i].coin;
|
||||||
ref[i].details.merchant_pub = depos[i].merchant_pub;
|
ref[i].details.merchant_pub = depos[i].merchant_pub;
|
||||||
RND_BLK(&ref[i].details.merchant_sig);
|
RND_BLK (&ref[i].details.merchant_sig);
|
||||||
ref[i].details.h_contract_terms = depos[i].h_contract_terms;
|
ref[i].details.h_contract_terms = depos[i].h_contract_terms;
|
||||||
ref[i].coin.coin_pub = depos[i].coin.coin_pub;
|
ref[i].coin.coin_pub = depos[i].coin.coin_pub;
|
||||||
ref[i].details.rtransaction_id = i;
|
ref[i].details.rtransaction_id = i;
|
||||||
@ -454,7 +456,8 @@ run (void *cls)
|
|||||||
times = GNUNET_TIME_relative_add (times,
|
times = GNUNET_TIME_relative_add (times,
|
||||||
duration);
|
duration);
|
||||||
duration_sq = duration.rel_value_us * duration.rel_value_us;
|
duration_sq = duration.rel_value_us * duration.rel_value_us;
|
||||||
GNUNET_assert (duration_sq / duration.rel_value_us == duration.rel_value_us);
|
GNUNET_assert (duration_sq / duration.rel_value_us ==
|
||||||
|
duration.rel_value_us);
|
||||||
GNUNET_assert (sqrs + duration_sq >= sqrs);
|
GNUNET_assert (sqrs + duration_sq >= sqrs);
|
||||||
sqrs += duration_sq;
|
sqrs += duration_sq;
|
||||||
}
|
}
|
||||||
@ -468,10 +471,10 @@ run (void *cls)
|
|||||||
ROUNDS);
|
ROUNDS);
|
||||||
avg_dbl = avg.rel_value_us;
|
avg_dbl = avg.rel_value_us;
|
||||||
variance = sqrs - (avg_dbl * avg_dbl * ROUNDS);
|
variance = sqrs - (avg_dbl * avg_dbl * ROUNDS);
|
||||||
fprintf(stdout,
|
fprintf (stdout,
|
||||||
"%8llu ± %6.0f\n",
|
"%8llu ± %6.0f\n",
|
||||||
(unsigned long long) avg.rel_value_us,
|
(unsigned long long) avg.rel_value_us,
|
||||||
sqrt (variance / (ROUNDS-1)));
|
sqrt (variance / (ROUNDS - 1)));
|
||||||
}
|
}
|
||||||
result = 0;
|
result = 0;
|
||||||
drop:
|
drop:
|
||||||
@ -496,12 +499,12 @@ cleanup:
|
|||||||
cnt++)
|
cnt++)
|
||||||
destroy_denom_key_pair (new_dkp[cnt]);
|
destroy_denom_key_pair (new_dkp[cnt]);
|
||||||
GNUNET_free (new_dkp);
|
GNUNET_free (new_dkp);
|
||||||
for (unsigned int i=0; i< ROUNDS +1 ; i++)
|
for (unsigned int i = 0; i< ROUNDS + 1; i++)
|
||||||
{
|
{
|
||||||
TALER_denom_sig_free (&depos[i].coin.denom_sig);
|
TALER_denom_sig_free (&depos[i].coin.denom_sig);
|
||||||
}
|
}
|
||||||
GNUNET_free(depos);
|
GNUNET_free (depos);
|
||||||
GNUNET_free(ref);
|
GNUNET_free (ref);
|
||||||
dkp = NULL;
|
dkp = NULL;
|
||||||
TALER_EXCHANGEDB_plugin_unload (plugin);
|
TALER_EXCHANGEDB_plugin_unload (plugin);
|
||||||
plugin = NULL;
|
plugin = NULL;
|
||||||
|
@ -1259,13 +1259,13 @@ struct TALER_AgeAttestation
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const struct TALER_AgeCommitmentHash TALER_ZeroAgeCommitmentHash;
|
extern const struct TALER_AgeCommitmentHashP TALER_ZeroAgeCommitmentHash;
|
||||||
#define TALER_AgeCommitmentHash_isNullOrZero(ph) ((NULL == ph) || \
|
#define TALER_AgeCommitmentHash_isNullOrZero(ph) ((NULL == ph) || \
|
||||||
(0 == memcmp (ph, \
|
(0 == memcmp (ph, \
|
||||||
& \
|
& \
|
||||||
TALER_ZeroAgeCommitmentHash, \
|
TALER_ZeroAgeCommitmentHash, \
|
||||||
sizeof(struct \
|
sizeof(struct \
|
||||||
TALER_AgeCommitmentHash))))
|
TALER_AgeCommitmentHashP))))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Type of public signing keys for verifying blindly signed coins.
|
* @brief Type of public signing keys for verifying blindly signed coins.
|
||||||
@ -1448,7 +1448,7 @@ struct TALER_CoinPublicInfo
|
|||||||
* Hash of the age commitment. If no age commitment was provided, it must be
|
* Hash of the age commitment. If no age commitment was provided, it must be
|
||||||
* set to all zeroes.
|
* set to all zeroes.
|
||||||
*/
|
*/
|
||||||
struct TALER_AgeCommitmentHash h_age_commitment;
|
struct TALER_AgeCommitmentHashP h_age_commitment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* True, if age commitment is not applicable.
|
* True, if age commitment is not applicable.
|
||||||
@ -1624,7 +1624,7 @@ TALER_denom_sig_free (struct TALER_DenominationSignature *denom_sig);
|
|||||||
enum GNUNET_GenericReturnValue
|
enum GNUNET_GenericReturnValue
|
||||||
TALER_denom_blind (const struct TALER_DenominationPublicKey *dk,
|
TALER_denom_blind (const struct TALER_DenominationPublicKey *dk,
|
||||||
const union TALER_DenominationBlindingKeyP *coin_bks,
|
const union TALER_DenominationBlindingKeyP *coin_bks,
|
||||||
const struct TALER_AgeCommitmentHash *age_commitment_hash,
|
const struct TALER_AgeCommitmentHashP *age_commitment_hash,
|
||||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||||
const struct TALER_ExchangeWithdrawValues *alg_values,
|
const struct TALER_ExchangeWithdrawValues *alg_values,
|
||||||
struct TALER_CoinPubHashP *c_hash,
|
struct TALER_CoinPubHashP *c_hash,
|
||||||
@ -1873,7 +1873,7 @@ TALER_coin_ev_hash (const struct TALER_BlindedPlanchet *blinded_planchet,
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
TALER_coin_pub_hash (const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
TALER_coin_pub_hash (const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||||
const struct TALER_AgeCommitmentHash *age_commitment_hash,
|
const struct TALER_AgeCommitmentHashP *age_commitment_hash,
|
||||||
struct TALER_CoinPubHashP *coin_h);
|
struct TALER_CoinPubHashP *coin_h);
|
||||||
|
|
||||||
|
|
||||||
@ -1928,7 +1928,7 @@ struct TALER_FreshCoin
|
|||||||
/**
|
/**
|
||||||
* Optional hash of an age commitment bound to this coin, maybe NULL.
|
* Optional hash of an age commitment bound to this coin, maybe NULL.
|
||||||
*/
|
*/
|
||||||
const struct TALER_AgeCommitmentHash *h_age_commitment;
|
const struct TALER_AgeCommitmentHashP *h_age_commitment;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -2111,7 +2111,7 @@ TALER_planchet_prepare (const struct TALER_DenominationPublicKey *dk,
|
|||||||
const struct TALER_ExchangeWithdrawValues *alg_values,
|
const struct TALER_ExchangeWithdrawValues *alg_values,
|
||||||
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_AgeCommitmentHash *ach,
|
const struct TALER_AgeCommitmentHashP *ach,
|
||||||
struct TALER_CoinPubHashP *c_hash,
|
struct TALER_CoinPubHashP *c_hash,
|
||||||
struct TALER_PlanchetDetail *pd);
|
struct TALER_PlanchetDetail *pd);
|
||||||
|
|
||||||
@ -2155,7 +2155,7 @@ TALER_planchet_to_coin (
|
|||||||
const struct 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_AgeCommitmentHash *ach,
|
const struct TALER_AgeCommitmentHashP *ach,
|
||||||
const struct TALER_CoinPubHashP *c_hash,
|
const struct TALER_CoinPubHashP *c_hash,
|
||||||
const struct TALER_ExchangeWithdrawValues *alg_values,
|
const struct TALER_ExchangeWithdrawValues *alg_values,
|
||||||
struct TALER_FreshCoin *coin);
|
struct TALER_FreshCoin *coin);
|
||||||
@ -3110,7 +3110,7 @@ TALER_wallet_purse_deposit_sign (
|
|||||||
const struct TALER_PurseContractPublicKeyP *purse_pub,
|
const struct TALER_PurseContractPublicKeyP *purse_pub,
|
||||||
const struct TALER_Amount *amount,
|
const struct TALER_Amount *amount,
|
||||||
const struct TALER_DenominationHashP *h_denom_pub,
|
const struct TALER_DenominationHashP *h_denom_pub,
|
||||||
const struct TALER_AgeCommitmentHash *h_age_commitment,
|
const struct TALER_AgeCommitmentHashP *h_age_commitment,
|
||||||
const struct TALER_CoinSpendPrivateKeyP *coin_priv,
|
const struct TALER_CoinSpendPrivateKeyP *coin_priv,
|
||||||
struct TALER_CoinSpendSignatureP *coin_sig);
|
struct TALER_CoinSpendSignatureP *coin_sig);
|
||||||
|
|
||||||
@ -3133,7 +3133,7 @@ TALER_wallet_purse_deposit_verify (
|
|||||||
const struct TALER_PurseContractPublicKeyP *purse_pub,
|
const struct TALER_PurseContractPublicKeyP *purse_pub,
|
||||||
const struct TALER_Amount *amount,
|
const struct TALER_Amount *amount,
|
||||||
const struct TALER_DenominationHashP *h_denom_pub,
|
const struct TALER_DenominationHashP *h_denom_pub,
|
||||||
const struct TALER_AgeCommitmentHash *h_age_commitment,
|
const struct TALER_AgeCommitmentHashP *h_age_commitment,
|
||||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||||
const struct TALER_CoinSpendSignatureP *coin_sig);
|
const struct TALER_CoinSpendSignatureP *coin_sig);
|
||||||
|
|
||||||
@ -3469,7 +3469,7 @@ TALER_wallet_deposit_sign (
|
|||||||
const struct TALER_Amount *deposit_fee,
|
const struct TALER_Amount *deposit_fee,
|
||||||
const struct TALER_MerchantWireHashP *h_wire,
|
const struct TALER_MerchantWireHashP *h_wire,
|
||||||
const struct TALER_PrivateContractHashP *h_contract_terms,
|
const struct TALER_PrivateContractHashP *h_contract_terms,
|
||||||
const struct TALER_AgeCommitmentHash *h_age_commitment,
|
const struct TALER_AgeCommitmentHashP *h_age_commitment,
|
||||||
const struct TALER_ExtensionPolicyHashP *h_policy,
|
const struct TALER_ExtensionPolicyHashP *h_policy,
|
||||||
const struct TALER_DenominationHashP *h_denom_pub,
|
const struct TALER_DenominationHashP *h_denom_pub,
|
||||||
struct GNUNET_TIME_Timestamp wallet_timestamp,
|
struct GNUNET_TIME_Timestamp wallet_timestamp,
|
||||||
@ -3502,7 +3502,7 @@ TALER_wallet_deposit_verify (
|
|||||||
const struct TALER_Amount *deposit_fee,
|
const struct TALER_Amount *deposit_fee,
|
||||||
const struct TALER_MerchantWireHashP *h_wire,
|
const struct TALER_MerchantWireHashP *h_wire,
|
||||||
const struct TALER_PrivateContractHashP *h_contract_terms,
|
const struct TALER_PrivateContractHashP *h_contract_terms,
|
||||||
const struct TALER_AgeCommitmentHash *h_age_commitment,
|
const struct TALER_AgeCommitmentHashP *h_age_commitment,
|
||||||
const struct TALER_ExtensionPolicyHashP *h_policy,
|
const struct TALER_ExtensionPolicyHashP *h_policy,
|
||||||
const struct TALER_DenominationHashP *h_denom_pub,
|
const struct TALER_DenominationHashP *h_denom_pub,
|
||||||
struct GNUNET_TIME_Timestamp wallet_timestamp,
|
struct GNUNET_TIME_Timestamp wallet_timestamp,
|
||||||
@ -3529,7 +3529,7 @@ TALER_wallet_melt_sign (
|
|||||||
const struct TALER_Amount *melt_fee,
|
const struct TALER_Amount *melt_fee,
|
||||||
const struct TALER_RefreshCommitmentP *rc,
|
const struct TALER_RefreshCommitmentP *rc,
|
||||||
const struct TALER_DenominationHashP *h_denom_pub,
|
const struct TALER_DenominationHashP *h_denom_pub,
|
||||||
const struct TALER_AgeCommitmentHash *h_age_commitment,
|
const struct TALER_AgeCommitmentHashP *h_age_commitment,
|
||||||
const struct TALER_CoinSpendPrivateKeyP *coin_priv,
|
const struct TALER_CoinSpendPrivateKeyP *coin_priv,
|
||||||
struct TALER_CoinSpendSignatureP *coin_sig);
|
struct TALER_CoinSpendSignatureP *coin_sig);
|
||||||
|
|
||||||
@ -3552,7 +3552,7 @@ TALER_wallet_melt_verify (
|
|||||||
const struct TALER_Amount *melt_fee,
|
const struct TALER_Amount *melt_fee,
|
||||||
const struct TALER_RefreshCommitmentP *rc,
|
const struct TALER_RefreshCommitmentP *rc,
|
||||||
const struct TALER_DenominationHashP *h_denom_pub,
|
const struct TALER_DenominationHashP *h_denom_pub,
|
||||||
const struct TALER_AgeCommitmentHash *h_age_commitment,
|
const struct TALER_AgeCommitmentHashP *h_age_commitment,
|
||||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||||
const struct TALER_CoinSpendSignatureP *coin_sig);
|
const struct TALER_CoinSpendSignatureP *coin_sig);
|
||||||
|
|
||||||
@ -5687,7 +5687,7 @@ struct TALER_AgeCommitmentProof
|
|||||||
void
|
void
|
||||||
TALER_age_commitment_hash (
|
TALER_age_commitment_hash (
|
||||||
const struct TALER_AgeCommitment *commitment,
|
const struct TALER_AgeCommitment *commitment,
|
||||||
struct TALER_AgeCommitmentHash *hash);
|
struct TALER_AgeCommitmentHashP *hash);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -844,7 +844,7 @@ struct TALER_EXCHANGE_CoinDepositDetail
|
|||||||
/**
|
/**
|
||||||
* Hash over the age commitment of the coin.
|
* Hash over the age commitment of the coin.
|
||||||
*/
|
*/
|
||||||
struct TALER_AgeCommitmentHash h_age_commitment;
|
struct TALER_AgeCommitmentHashP h_age_commitment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The coin’s public key.
|
* The coin’s public key.
|
||||||
@ -2155,7 +2155,7 @@ struct TALER_EXCHANGE_WithdrawCoinInput
|
|||||||
/**
|
/**
|
||||||
* Age commitment for the coin.
|
* Age commitment for the coin.
|
||||||
*/
|
*/
|
||||||
const struct TALER_AgeCommitmentHash *ach;
|
const struct TALER_AgeCommitmentHashP *ach;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2579,7 +2579,7 @@ struct TALER_EXCHANGE_RefreshData
|
|||||||
* might be NULL.
|
* might be NULL.
|
||||||
*/
|
*/
|
||||||
const struct TALER_AgeCommitmentProof *melt_age_commitment_proof;
|
const struct TALER_AgeCommitmentProof *melt_age_commitment_proof;
|
||||||
const struct TALER_AgeCommitmentHash *melt_h_age_commitment;
|
const struct TALER_AgeCommitmentHashP *melt_h_age_commitment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* amount specifying how much the coin will contribute to the melt
|
* amount specifying how much the coin will contribute to the melt
|
||||||
@ -2752,7 +2752,7 @@ struct TALER_EXCHANGE_RevealedCoinInfo
|
|||||||
* Age commitment and its hash of the coin, might be NULL.
|
* Age commitment and its hash of the coin, might be NULL.
|
||||||
*/
|
*/
|
||||||
struct TALER_AgeCommitmentProof *age_commitment_proof;
|
struct TALER_AgeCommitmentProof *age_commitment_proof;
|
||||||
struct TALER_AgeCommitmentHash *h_age_commitment;
|
struct TALER_AgeCommitmentHashP *h_age_commitment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Blinding keys used to blind the fresh coin.
|
* Blinding keys used to blind the fresh coin.
|
||||||
@ -2896,7 +2896,7 @@ struct TALER_EXCHANGE_LinkedCoinInfo
|
|||||||
* Age commitment and its hash, if applicable. Might be NULL.
|
* Age commitment and its hash, if applicable. Might be NULL.
|
||||||
*/
|
*/
|
||||||
struct TALER_AgeCommitmentProof *age_commitment_proof;
|
struct TALER_AgeCommitmentProof *age_commitment_proof;
|
||||||
struct TALER_AgeCommitmentHash *h_age_commitment;
|
struct TALER_AgeCommitmentHashP *h_age_commitment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Master secret of this coin.
|
* Master secret of this coin.
|
||||||
|
@ -391,7 +391,7 @@ struct TALER_EXCHANGEDB_TableData
|
|||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
struct TALER_CoinSpendPublicKeyP coin_pub;
|
struct TALER_CoinSpendPublicKeyP coin_pub;
|
||||||
struct TALER_AgeCommitmentHash age_hash;
|
struct TALER_AgeCommitmentHashP age_hash;
|
||||||
uint64_t denominations_serial;
|
uint64_t denominations_serial;
|
||||||
struct TALER_DenominationSignature denom_sig;
|
struct TALER_DenominationSignature denom_sig;
|
||||||
} known_coins;
|
} known_coins;
|
||||||
@ -1668,7 +1668,7 @@ struct TALER_EXCHANGEDB_DepositListEntry
|
|||||||
* Age commitment hash, if applicable to the denomination. Should be all
|
* Age commitment hash, if applicable to the denomination. Should be all
|
||||||
* zeroes if age commitment is not applicable to the denonimation.
|
* zeroes if age commitment is not applicable to the denonimation.
|
||||||
*/
|
*/
|
||||||
struct TALER_AgeCommitmentHash h_age_commitment;
|
struct TALER_AgeCommitmentHashP h_age_commitment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* true, if age commitment is not applicable
|
* true, if age commitment is not applicable
|
||||||
@ -1946,7 +1946,7 @@ struct TALER_EXCHANGEDB_PurseDepositListEntry
|
|||||||
* Hash of the age commitment used to sign the coin, if age restriction was
|
* Hash of the age commitment used to sign the coin, if age restriction was
|
||||||
* applicable to the denomination.
|
* applicable to the denomination.
|
||||||
*/
|
*/
|
||||||
struct TALER_AgeCommitmentHash h_age_commitment;
|
struct TALER_AgeCommitmentHashP h_age_commitment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to true if the coin was refunded.
|
* Set to true if the coin was refunded.
|
||||||
@ -2053,7 +2053,7 @@ struct TALER_EXCHANGEDB_PurseDeposit
|
|||||||
* applicable to the denomination. May be all zeroes if no age restriction
|
* applicable to the denomination. May be all zeroes if no age restriction
|
||||||
* applies.
|
* applies.
|
||||||
*/
|
*/
|
||||||
struct TALER_AgeCommitmentHash h_age_commitment;
|
struct TALER_AgeCommitmentHashP h_age_commitment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set to true if @e h_age_commitment is not available.
|
* Set to true if @e h_age_commitment is not available.
|
||||||
@ -2533,7 +2533,7 @@ typedef enum GNUNET_GenericReturnValue
|
|||||||
void *cls,
|
void *cls,
|
||||||
uint64_t rowid,
|
uint64_t rowid,
|
||||||
const struct TALER_DenominationPublicKey *denom_pub,
|
const struct TALER_DenominationPublicKey *denom_pub,
|
||||||
const struct TALER_AgeCommitmentHash *h_age_commitment,
|
const struct TALER_AgeCommitmentHashP *h_age_commitment,
|
||||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||||
const struct TALER_CoinSpendSignatureP *coin_sig,
|
const struct TALER_CoinSpendSignatureP *coin_sig,
|
||||||
const struct TALER_Amount *amount_with_fee,
|
const struct TALER_Amount *amount_with_fee,
|
||||||
@ -4019,7 +4019,7 @@ struct TALER_EXCHANGEDB_Plugin
|
|||||||
const struct TALER_CoinPublicInfo *coin,
|
const struct TALER_CoinPublicInfo *coin,
|
||||||
uint64_t *known_coin_id,
|
uint64_t *known_coin_id,
|
||||||
struct TALER_DenominationHashP *denom_pub_hash,
|
struct TALER_DenominationHashP *denom_pub_hash,
|
||||||
struct TALER_AgeCommitmentHash *age_hash);
|
struct TALER_AgeCommitmentHashP *age_hash);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -6105,7 +6105,7 @@ struct TALER_EXCHANGEDB_Plugin
|
|||||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||||
struct TALER_Amount *amount,
|
struct TALER_Amount *amount,
|
||||||
struct TALER_DenominationHashP *h_denom_pub,
|
struct TALER_DenominationHashP *h_denom_pub,
|
||||||
struct TALER_AgeCommitmentHash *phac,
|
struct TALER_AgeCommitmentHashP *phac,
|
||||||
struct TALER_CoinSpendSignatureP *coin_sig,
|
struct TALER_CoinSpendSignatureP *coin_sig,
|
||||||
char **partner_url);
|
char **partner_url);
|
||||||
|
|
||||||
|
@ -2958,7 +2958,7 @@ TALER_TESTING_get_trait (const struct TALER_TESTING_Trait *traits,
|
|||||||
op (deposit_fee_amount, const struct TALER_Amount) \
|
op (deposit_fee_amount, const struct TALER_Amount) \
|
||||||
op (age_commitment, const struct TALER_AgeCommitment) \
|
op (age_commitment, const struct TALER_AgeCommitment) \
|
||||||
op (age_commitment_proof, const struct TALER_AgeCommitmentProof) \
|
op (age_commitment_proof, const struct TALER_AgeCommitmentProof) \
|
||||||
op (h_age_commitment, const struct TALER_AgeCommitmentHash) \
|
op (h_age_commitment, const struct TALER_AgeCommitmentHashP) \
|
||||||
op (reserve_history, const struct TALER_EXCHANGE_ReserveHistoryEntry) \
|
op (reserve_history, const struct TALER_EXCHANGE_ReserveHistoryEntry) \
|
||||||
op (planchet_secrets, const struct TALER_PlanchetMasterSecretP) \
|
op (planchet_secrets, const struct TALER_PlanchetMasterSecretP) \
|
||||||
op (exchange_wd_value, const struct TALER_ExchangeWithdrawValues) \
|
op (exchange_wd_value, const struct TALER_ExchangeWithdrawValues) \
|
||||||
|
@ -51,7 +51,7 @@ struct CoinData
|
|||||||
/**
|
/**
|
||||||
* Age commitment for the coin.
|
* Age commitment for the coin.
|
||||||
*/
|
*/
|
||||||
const struct TALER_AgeCommitmentHash *ach;
|
const struct TALER_AgeCommitmentHashP *ach;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* blinding secret
|
* blinding secret
|
||||||
|
@ -850,7 +850,7 @@ help_deposit (struct CoinHistoryParseContext *pc,
|
|||||||
struct TALER_MerchantPublicKeyP merchant_pub;
|
struct TALER_MerchantPublicKeyP merchant_pub;
|
||||||
struct GNUNET_TIME_Timestamp refund_deadline = {0};
|
struct GNUNET_TIME_Timestamp refund_deadline = {0};
|
||||||
struct TALER_CoinSpendSignatureP sig;
|
struct TALER_CoinSpendSignatureP sig;
|
||||||
struct TALER_AgeCommitmentHash hac;
|
struct TALER_AgeCommitmentHashP hac;
|
||||||
bool no_hac;
|
bool no_hac;
|
||||||
struct TALER_Amount deposit_fee;
|
struct TALER_Amount deposit_fee;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
@ -938,7 +938,7 @@ help_melt (struct CoinHistoryParseContext *pc,
|
|||||||
{
|
{
|
||||||
struct TALER_CoinSpendSignatureP sig;
|
struct TALER_CoinSpendSignatureP sig;
|
||||||
struct TALER_RefreshCommitmentP rc;
|
struct TALER_RefreshCommitmentP rc;
|
||||||
struct TALER_AgeCommitmentHash h_age_commitment;
|
struct TALER_AgeCommitmentHashP h_age_commitment;
|
||||||
bool no_hac;
|
bool no_hac;
|
||||||
struct TALER_Amount melt_fee;
|
struct TALER_Amount melt_fee;
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
@ -1292,7 +1292,7 @@ help_purse_deposit (struct CoinHistoryParseContext *pc,
|
|||||||
struct TALER_CoinSpendSignatureP coin_sig;
|
struct TALER_CoinSpendSignatureP coin_sig;
|
||||||
const char *exchange_base_url;
|
const char *exchange_base_url;
|
||||||
bool refunded;
|
bool refunded;
|
||||||
struct TALER_AgeCommitmentHash phac = { 0 };
|
struct TALER_AgeCommitmentHashP phac = { 0 };
|
||||||
struct GNUNET_JSON_Specification spec[] = {
|
struct GNUNET_JSON_Specification spec[] = {
|
||||||
GNUNET_JSON_spec_fixed_auto ("purse_pub",
|
GNUNET_JSON_spec_fixed_auto ("purse_pub",
|
||||||
&purse_pub),
|
&purse_pub),
|
||||||
@ -1758,7 +1758,7 @@ TALER_EXCHANGE_check_purse_coin_conflict_ (
|
|||||||
const char *exchange_url,
|
const char *exchange_url,
|
||||||
const json_t *proof,
|
const json_t *proof,
|
||||||
struct TALER_DenominationHashP *h_denom_pub,
|
struct TALER_DenominationHashP *h_denom_pub,
|
||||||
struct TALER_AgeCommitmentHash *phac,
|
struct TALER_AgeCommitmentHashP *phac,
|
||||||
struct TALER_CoinSpendPublicKeyP *coin_pub,
|
struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||||
struct TALER_CoinSpendSignatureP *coin_sig)
|
struct TALER_CoinSpendSignatureP *coin_sig)
|
||||||
{
|
{
|
||||||
|
@ -87,7 +87,7 @@ TALER_EXCHANGE_check_purse_coin_conflict_ (
|
|||||||
const char *exchange_url,
|
const char *exchange_url,
|
||||||
const json_t *proof,
|
const json_t *proof,
|
||||||
struct TALER_DenominationHashP *h_denom_pub,
|
struct TALER_DenominationHashP *h_denom_pub,
|
||||||
struct TALER_AgeCommitmentHash *phac,
|
struct TALER_AgeCommitmentHashP *phac,
|
||||||
struct TALER_CoinSpendPublicKeyP *coin_pub,
|
struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||||
struct TALER_CoinSpendSignatureP *coin_sig);
|
struct TALER_CoinSpendSignatureP *coin_sig);
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ parse_link_coin (const struct TALER_EXCHANGE_LinkHandle *lh,
|
|||||||
if (NULL != lh->age_commitment_proof)
|
if (NULL != lh->age_commitment_proof)
|
||||||
{
|
{
|
||||||
lci->age_commitment_proof = GNUNET_new (struct TALER_AgeCommitmentProof);
|
lci->age_commitment_proof = GNUNET_new (struct TALER_AgeCommitmentProof);
|
||||||
lci->h_age_commitment = GNUNET_new (struct TALER_AgeCommitmentHash);
|
lci->h_age_commitment = GNUNET_new (struct TALER_AgeCommitmentHashP);
|
||||||
|
|
||||||
GNUNET_assert (GNUNET_OK ==
|
GNUNET_assert (GNUNET_OK ==
|
||||||
TALER_age_commitment_derive (
|
TALER_age_commitment_derive (
|
||||||
|
@ -57,7 +57,7 @@ struct Deposit
|
|||||||
/**
|
/**
|
||||||
* Age restriction hash for the coin.
|
* Age restriction hash for the coin.
|
||||||
*/
|
*/
|
||||||
struct TALER_AgeCommitmentHash ahac;
|
struct TALER_AgeCommitmentHashP ahac;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* How much did we say the coin contributed.
|
* How much did we say the coin contributed.
|
||||||
@ -381,7 +381,7 @@ handle_purse_create_deposit_finished (void *cls,
|
|||||||
struct TALER_CoinSpendPublicKeyP coin_pub;
|
struct TALER_CoinSpendPublicKeyP coin_pub;
|
||||||
struct TALER_CoinSpendSignatureP coin_sig;
|
struct TALER_CoinSpendSignatureP coin_sig;
|
||||||
struct TALER_DenominationHashP h_denom_pub;
|
struct TALER_DenominationHashP h_denom_pub;
|
||||||
struct TALER_AgeCommitmentHash phac;
|
struct TALER_AgeCommitmentHashP phac;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
@ -594,7 +594,7 @@ TALER_EXCHANGE_purse_create_with_deposit (
|
|||||||
const struct TALER_AgeCommitmentProof *acp = deposit->age_commitment_proof;
|
const struct TALER_AgeCommitmentProof *acp = deposit->age_commitment_proof;
|
||||||
struct Deposit *d = &pch->deposits[i];
|
struct Deposit *d = &pch->deposits[i];
|
||||||
json_t *jdeposit;
|
json_t *jdeposit;
|
||||||
struct TALER_AgeCommitmentHash *aghp = NULL;
|
struct TALER_AgeCommitmentHashP *aghp = NULL;
|
||||||
struct TALER_AgeAttestation attest;
|
struct TALER_AgeAttestation attest;
|
||||||
struct TALER_AgeAttestation *attestp = NULL;
|
struct TALER_AgeAttestation *attestp = NULL;
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ struct Coin
|
|||||||
/**
|
/**
|
||||||
* Age restriction hash for the coin.
|
* Age restriction hash for the coin.
|
||||||
*/
|
*/
|
||||||
struct TALER_AgeCommitmentHash ahac;
|
struct TALER_AgeCommitmentHashP ahac;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* How much did we say the coin contributed.
|
* How much did we say the coin contributed.
|
||||||
@ -240,7 +240,7 @@ handle_purse_deposit_finished (void *cls,
|
|||||||
struct TALER_CoinSpendPublicKeyP coin_pub;
|
struct TALER_CoinSpendPublicKeyP coin_pub;
|
||||||
struct TALER_CoinSpendSignatureP coin_sig;
|
struct TALER_CoinSpendSignatureP coin_sig;
|
||||||
struct TALER_DenominationHashP h_denom_pub;
|
struct TALER_DenominationHashP h_denom_pub;
|
||||||
struct TALER_AgeCommitmentHash phac;
|
struct TALER_AgeCommitmentHashP phac;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
if (GNUNET_OK !=
|
if (GNUNET_OK !=
|
||||||
@ -513,7 +513,7 @@ TALER_EXCHANGE_purse_deposit (
|
|||||||
const struct TALER_AgeCommitmentProof *acp = deposit->age_commitment_proof;
|
const struct TALER_AgeCommitmentProof *acp = deposit->age_commitment_proof;
|
||||||
struct Coin *coin = &pch->coins[i];
|
struct Coin *coin = &pch->coins[i];
|
||||||
json_t *jdeposit;
|
json_t *jdeposit;
|
||||||
struct TALER_AgeCommitmentHash *achp = NULL;
|
struct TALER_AgeCommitmentHashP *achp = NULL;
|
||||||
struct TALER_AgeAttestation attest;
|
struct TALER_AgeAttestation attest;
|
||||||
struct TALER_AgeAttestation *attestp = NULL;
|
struct TALER_AgeAttestation *attestp = NULL;
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ TALER_EXCHANGE_get_melt_data_ (
|
|||||||
union TALER_DenominationBlindingKeyP *bks = &fcd->bks[i];
|
union TALER_DenominationBlindingKeyP *bks = &fcd->bks[i];
|
||||||
struct TALER_PlanchetDetail pd;
|
struct TALER_PlanchetDetail pd;
|
||||||
struct TALER_CoinPubHashP c_hash;
|
struct TALER_CoinPubHashP c_hash;
|
||||||
struct TALER_AgeCommitmentHash *ach = NULL;
|
struct TALER_AgeCommitmentHashP *ach = NULL;
|
||||||
|
|
||||||
TALER_transfer_secret_to_planchet_secret (&trans_sec,
|
TALER_transfer_secret_to_planchet_secret (&trans_sec,
|
||||||
j,
|
j,
|
||||||
@ -187,7 +187,7 @@ TALER_EXCHANGE_get_melt_data_ (
|
|||||||
{
|
{
|
||||||
fcd->age_commitment_proof[i] = GNUNET_new (struct
|
fcd->age_commitment_proof[i] = GNUNET_new (struct
|
||||||
TALER_AgeCommitmentProof);
|
TALER_AgeCommitmentProof);
|
||||||
ach = GNUNET_new (struct TALER_AgeCommitmentHash);
|
ach = GNUNET_new (struct TALER_AgeCommitmentHashP);
|
||||||
|
|
||||||
GNUNET_assert (GNUNET_OK ==
|
GNUNET_assert (GNUNET_OK ==
|
||||||
TALER_age_commitment_derive (
|
TALER_age_commitment_derive (
|
||||||
|
@ -57,7 +57,7 @@ struct MeltedCoin
|
|||||||
* age commitment was set.
|
* age commitment was set.
|
||||||
*/
|
*/
|
||||||
const struct TALER_AgeCommitmentProof *age_commitment_proof;
|
const struct TALER_AgeCommitmentProof *age_commitment_proof;
|
||||||
const struct TALER_AgeCommitmentHash *h_age_commitment;
|
const struct TALER_AgeCommitmentHashP *h_age_commitment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Timestamp indicating when coins of this denomination become invalid.
|
* Timestamp indicating when coins of this denomination become invalid.
|
||||||
|
@ -168,7 +168,7 @@ refresh_reveal_ok (struct TALER_EXCHANGE_RefreshesRevealHandle *rrh,
|
|||||||
|
|
||||||
if (NULL != rci->age_commitment_proof)
|
if (NULL != rci->age_commitment_proof)
|
||||||
{
|
{
|
||||||
rci->h_age_commitment = GNUNET_new (struct TALER_AgeCommitmentHash);
|
rci->h_age_commitment = GNUNET_new (struct TALER_AgeCommitmentHashP);
|
||||||
TALER_age_commitment_hash (
|
TALER_age_commitment_hash (
|
||||||
&rci->age_commitment_proof->commitment,
|
&rci->age_commitment_proof->commitment,
|
||||||
rci->h_age_commitment);
|
rci->h_age_commitment);
|
||||||
|
@ -234,7 +234,7 @@ verify_conflict_history_ok (struct TALER_EXCHANGE_RefundHandle *rh,
|
|||||||
struct TALER_Amount deposit_fee;
|
struct TALER_Amount deposit_fee;
|
||||||
struct TALER_MerchantWireHashP h_wire;
|
struct TALER_MerchantWireHashP h_wire;
|
||||||
struct TALER_PrivateContractHashP h_contract_terms;
|
struct TALER_PrivateContractHashP h_contract_terms;
|
||||||
struct TALER_AgeCommitmentHash h_age_commitment;
|
struct TALER_AgeCommitmentHashP h_age_commitment;
|
||||||
bool no_hac;
|
bool no_hac;
|
||||||
struct TALER_ExtensionPolicyHashP h_policy;
|
struct TALER_ExtensionPolicyHashP h_policy;
|
||||||
bool no_h_policy;
|
bool no_h_policy;
|
||||||
|
@ -510,8 +510,8 @@ TALER_EXCHANGE_reserves_open (
|
|||||||
{
|
{
|
||||||
const struct TALER_EXCHANGE_PurseDeposit *pd = &coin_payments[i];
|
const struct TALER_EXCHANGE_PurseDeposit *pd = &coin_payments[i];
|
||||||
const struct TALER_AgeCommitmentProof *acp = pd->age_commitment_proof;
|
const struct TALER_AgeCommitmentProof *acp = pd->age_commitment_proof;
|
||||||
struct TALER_AgeCommitmentHash ahac;
|
struct TALER_AgeCommitmentHashP ahac;
|
||||||
struct TALER_AgeCommitmentHash *achp = NULL;
|
struct TALER_AgeCommitmentHashP *achp = NULL;
|
||||||
struct CoinData *cd = &roh->coins[i];
|
struct CoinData *cd = &roh->coins[i];
|
||||||
json_t *cp;
|
json_t *cp;
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ struct TALER_EXCHANGE_WithdrawHandle
|
|||||||
/**
|
/**
|
||||||
* Hash of the age commitment for this coin, if applicable. Maybe NULL
|
* Hash of the age commitment for this coin, if applicable. Maybe NULL
|
||||||
*/
|
*/
|
||||||
const struct TALER_AgeCommitmentHash *ach;
|
const struct TALER_AgeCommitmentHashP *ach;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Denomination key we are withdrawing.
|
* Denomination key we are withdrawing.
|
||||||
|
@ -82,7 +82,7 @@ struct CoinState
|
|||||||
* its hash, respectivelly, NULL otherwise.
|
* its hash, respectivelly, NULL otherwise.
|
||||||
*/
|
*/
|
||||||
struct TALER_AgeCommitmentProof *age_commitment_proof;
|
struct TALER_AgeCommitmentProof *age_commitment_proof;
|
||||||
struct TALER_AgeCommitmentHash *h_age_commitment;
|
struct TALER_AgeCommitmentHashP *h_age_commitment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reserve history entry that corresponds to this coin.
|
* Reserve history entry that corresponds to this coin.
|
||||||
@ -484,12 +484,12 @@ TALER_TESTING_cmd_batch_withdraw (const char *label,
|
|||||||
if (0 < age)
|
if (0 < age)
|
||||||
{
|
{
|
||||||
struct TALER_AgeCommitmentProof *acp;
|
struct TALER_AgeCommitmentProof *acp;
|
||||||
struct TALER_AgeCommitmentHash *hac;
|
struct TALER_AgeCommitmentHashP *hac;
|
||||||
struct GNUNET_HashCode seed;
|
struct GNUNET_HashCode seed;
|
||||||
struct TALER_AgeMask mask;
|
struct TALER_AgeMask mask;
|
||||||
|
|
||||||
acp = GNUNET_new (struct TALER_AgeCommitmentProof);
|
acp = GNUNET_new (struct TALER_AgeCommitmentProof);
|
||||||
hac = GNUNET_new (struct TALER_AgeCommitmentHash);
|
hac = GNUNET_new (struct TALER_AgeCommitmentHashP);
|
||||||
mask = TALER_extensions_get_age_restriction_mask ();
|
mask = TALER_extensions_get_age_restriction_mask ();
|
||||||
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
|
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
|
||||||
&seed,
|
&seed,
|
||||||
|
@ -289,7 +289,7 @@ deposit_run (void *cls,
|
|||||||
const struct TALER_CoinSpendPrivateKeyP *coin_priv;
|
const struct TALER_CoinSpendPrivateKeyP *coin_priv;
|
||||||
struct TALER_CoinSpendPublicKeyP coin_pub;
|
struct TALER_CoinSpendPublicKeyP coin_pub;
|
||||||
const struct TALER_AgeCommitmentProof *age_commitment_proof = NULL;
|
const struct TALER_AgeCommitmentProof *age_commitment_proof = NULL;
|
||||||
struct TALER_AgeCommitmentHash h_age_commitment = {0};
|
struct TALER_AgeCommitmentHashP h_age_commitment = {0};
|
||||||
const struct TALER_EXCHANGE_DenomPublicKey *denom_pub;
|
const struct TALER_EXCHANGE_DenomPublicKey *denom_pub;
|
||||||
const struct TALER_DenominationSignature *denom_pub_sig;
|
const struct TALER_DenominationSignature *denom_pub_sig;
|
||||||
struct TALER_CoinSpendSignatureP coin_sig;
|
struct TALER_CoinSpendSignatureP coin_sig;
|
||||||
|
@ -245,7 +245,7 @@ insert_deposit_run (void *cls,
|
|||||||
{
|
{
|
||||||
uint64_t known_coin_id;
|
uint64_t known_coin_id;
|
||||||
struct TALER_DenominationHashP dph;
|
struct TALER_DenominationHashP dph;
|
||||||
struct TALER_AgeCommitmentHash agh;
|
struct TALER_AgeCommitmentHashP agh;
|
||||||
|
|
||||||
if ( (GNUNET_OK !=
|
if ( (GNUNET_OK !=
|
||||||
ids->dbc->plugin->start (ids->dbc->plugin->cls,
|
ids->dbc->plugin->start (ids->dbc->plugin->cls,
|
||||||
|
@ -75,7 +75,7 @@ struct TALER_TESTING_FreshCoinData
|
|||||||
* applicable.
|
* applicable.
|
||||||
*/
|
*/
|
||||||
struct TALER_AgeCommitmentProof *age_commitment_proof;
|
struct TALER_AgeCommitmentProof *age_commitment_proof;
|
||||||
struct TALER_AgeCommitmentHash *h_age_commitment;
|
struct TALER_AgeCommitmentHashP *h_age_commitment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The blinding key (needed for recoup operations).
|
* The blinding key (needed for recoup operations).
|
||||||
@ -1027,7 +1027,7 @@ melt_run (void *cls,
|
|||||||
struct TALER_Amount melt_amount;
|
struct TALER_Amount melt_amount;
|
||||||
struct TALER_Amount fresh_amount;
|
struct TALER_Amount fresh_amount;
|
||||||
const struct TALER_AgeCommitmentProof *age_commitment_proof;
|
const struct TALER_AgeCommitmentProof *age_commitment_proof;
|
||||||
const struct TALER_AgeCommitmentHash *h_age_commitment;
|
const struct TALER_AgeCommitmentHashP *h_age_commitment;
|
||||||
const struct TALER_DenominationSignature *melt_sig;
|
const struct TALER_DenominationSignature *melt_sig;
|
||||||
const struct TALER_EXCHANGE_DenomPublicKey *melt_denom_pub;
|
const struct TALER_EXCHANGE_DenomPublicKey *melt_denom_pub;
|
||||||
const struct TALER_TESTING_Command *coin_command;
|
const struct TALER_TESTING_Command *coin_command;
|
||||||
|
@ -142,7 +142,7 @@ struct WithdrawState
|
|||||||
* its hash, respectivelly, NULL otherwise.
|
* its hash, respectivelly, NULL otherwise.
|
||||||
*/
|
*/
|
||||||
struct TALER_AgeCommitmentProof *age_commitment_proof;
|
struct TALER_AgeCommitmentProof *age_commitment_proof;
|
||||||
struct TALER_AgeCommitmentHash *h_age_commitment;
|
struct TALER_AgeCommitmentHashP *h_age_commitment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reserve history entry that corresponds to this operation.
|
* Reserve history entry that corresponds to this operation.
|
||||||
@ -581,12 +581,12 @@ TALER_TESTING_cmd_withdraw_amount (const char *label,
|
|||||||
if (0 < age)
|
if (0 < age)
|
||||||
{
|
{
|
||||||
struct TALER_AgeCommitmentProof *acp;
|
struct TALER_AgeCommitmentProof *acp;
|
||||||
struct TALER_AgeCommitmentHash *hac;
|
struct TALER_AgeCommitmentHashP *hac;
|
||||||
struct GNUNET_HashCode seed;
|
struct GNUNET_HashCode seed;
|
||||||
struct TALER_AgeMask mask;
|
struct TALER_AgeMask mask;
|
||||||
|
|
||||||
acp = GNUNET_new (struct TALER_AgeCommitmentProof);
|
acp = GNUNET_new (struct TALER_AgeCommitmentProof);
|
||||||
hac = GNUNET_new (struct TALER_AgeCommitmentHash);
|
hac = GNUNET_new (struct TALER_AgeCommitmentHashP);
|
||||||
mask = TALER_extensions_get_age_restriction_mask ();
|
mask = TALER_extensions_get_age_restriction_mask ();
|
||||||
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
|
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
|
||||||
&seed,
|
&seed,
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
void
|
void
|
||||||
TALER_age_commitment_hash (
|
TALER_age_commitment_hash (
|
||||||
const struct TALER_AgeCommitment *commitment,
|
const struct TALER_AgeCommitment *commitment,
|
||||||
struct TALER_AgeCommitmentHash *ahash)
|
struct TALER_AgeCommitmentHashP *ahash)
|
||||||
{
|
{
|
||||||
struct GNUNET_HashContext *hash_context;
|
struct GNUNET_HashContext *hash_context;
|
||||||
struct GNUNET_HashCode hash;
|
struct GNUNET_HashCode hash;
|
||||||
@ -35,7 +35,7 @@ TALER_age_commitment_hash (
|
|||||||
GNUNET_assert (NULL != ahash);
|
GNUNET_assert (NULL != ahash);
|
||||||
if (NULL == commitment)
|
if (NULL == commitment)
|
||||||
{
|
{
|
||||||
memset (ahash, 0, sizeof(struct TALER_AgeCommitmentHash));
|
memset (ahash, 0, sizeof(struct TALER_AgeCommitmentHashP));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
/**
|
/**
|
||||||
* Used in TALER_AgeCommitmentHash_isNullOrZero for comparison
|
* Used in TALER_AgeCommitmentHash_isNullOrZero for comparison
|
||||||
*/
|
*/
|
||||||
const struct TALER_AgeCommitmentHash TALER_ZeroAgeCommitmentHash = {0};
|
const struct TALER_AgeCommitmentHashP TALER_ZeroAgeCommitmentHash = {0};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function called by libgcrypt on serious errors.
|
* Function called by libgcrypt on serious errors.
|
||||||
@ -258,7 +258,7 @@ TALER_planchet_prepare (const struct TALER_DenominationPublicKey *dk,
|
|||||||
const struct TALER_ExchangeWithdrawValues *alg_values,
|
const struct TALER_ExchangeWithdrawValues *alg_values,
|
||||||
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_AgeCommitmentHash *ach,
|
const struct TALER_AgeCommitmentHashP *ach,
|
||||||
struct TALER_CoinPubHashP *c_hash,
|
struct TALER_CoinPubHashP *c_hash,
|
||||||
struct TALER_PlanchetDetail *pd
|
struct TALER_PlanchetDetail *pd
|
||||||
)
|
)
|
||||||
@ -299,7 +299,7 @@ TALER_planchet_to_coin (
|
|||||||
const struct 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_AgeCommitmentHash *ach,
|
const struct TALER_AgeCommitmentHashP *ach,
|
||||||
const struct TALER_CoinPubHashP *c_hash,
|
const struct TALER_CoinPubHashP *c_hash,
|
||||||
const struct TALER_ExchangeWithdrawValues *alg_values,
|
const struct TALER_ExchangeWithdrawValues *alg_values,
|
||||||
struct TALER_FreshCoin *coin)
|
struct TALER_FreshCoin *coin)
|
||||||
@ -412,7 +412,7 @@ TALER_refresh_get_commitment (struct TALER_RefreshCommitmentP *rc,
|
|||||||
|
|
||||||
void
|
void
|
||||||
TALER_coin_pub_hash (const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
TALER_coin_pub_hash (const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||||
const struct TALER_AgeCommitmentHash *ach,
|
const struct TALER_AgeCommitmentHashP *ach,
|
||||||
struct TALER_CoinPubHashP *coin_h)
|
struct TALER_CoinPubHashP *coin_h)
|
||||||
{
|
{
|
||||||
if (TALER_AgeCommitmentHash_isNullOrZero (ach))
|
if (TALER_AgeCommitmentHash_isNullOrZero (ach))
|
||||||
@ -427,7 +427,7 @@ TALER_coin_pub_hash (const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
|||||||
/* Coin comes with age commitment. Take the hash of the age commitment
|
/* Coin comes with age commitment. Take the hash of the age commitment
|
||||||
* into account */
|
* into account */
|
||||||
const size_t key_s = sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey);
|
const size_t key_s = sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey);
|
||||||
const size_t age_s = sizeof(struct TALER_AgeCommitmentHash);
|
const size_t age_s = sizeof(struct TALER_AgeCommitmentHashP);
|
||||||
char data[key_s + age_s];
|
char data[key_s + age_s];
|
||||||
|
|
||||||
GNUNET_memcpy (&data[0],
|
GNUNET_memcpy (&data[0],
|
||||||
|
@ -299,7 +299,7 @@ enum GNUNET_GenericReturnValue
|
|||||||
TALER_denom_blind (
|
TALER_denom_blind (
|
||||||
const struct TALER_DenominationPublicKey *dk,
|
const struct TALER_DenominationPublicKey *dk,
|
||||||
const union TALER_DenominationBlindingKeyP *coin_bks,
|
const union TALER_DenominationBlindingKeyP *coin_bks,
|
||||||
const struct TALER_AgeCommitmentHash *ach,
|
const struct TALER_AgeCommitmentHashP *ach,
|
||||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||||
const struct TALER_ExchangeWithdrawValues *alg_values,
|
const struct TALER_ExchangeWithdrawValues *alg_values,
|
||||||
struct TALER_CoinPubHashP *c_hash,
|
struct TALER_CoinPubHashP *c_hash,
|
||||||
|
@ -124,12 +124,12 @@ test_planchets_rsa (uint8_t age)
|
|||||||
struct TALER_BlindedDenominationSignature blind_sig;
|
struct TALER_BlindedDenominationSignature blind_sig;
|
||||||
struct TALER_FreshCoin coin;
|
struct TALER_FreshCoin coin;
|
||||||
struct TALER_CoinPubHashP c_hash;
|
struct TALER_CoinPubHashP c_hash;
|
||||||
struct TALER_AgeCommitmentHash *ach = NULL;
|
struct TALER_AgeCommitmentHashP *ach = NULL;
|
||||||
|
|
||||||
if (0 < age)
|
if (0 < age)
|
||||||
{
|
{
|
||||||
struct TALER_AgeCommitmentProof acp;
|
struct TALER_AgeCommitmentProof acp;
|
||||||
struct TALER_AgeCommitmentHash ah = {0};
|
struct TALER_AgeCommitmentHashP ah = {0};
|
||||||
struct GNUNET_HashCode seed;
|
struct GNUNET_HashCode seed;
|
||||||
|
|
||||||
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
|
GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
|
||||||
@ -256,11 +256,11 @@ test_planchets_cs (uint8_t age)
|
|||||||
struct TALER_BlindedDenominationSignature blind_sig;
|
struct TALER_BlindedDenominationSignature blind_sig;
|
||||||
struct TALER_FreshCoin coin;
|
struct TALER_FreshCoin coin;
|
||||||
struct TALER_ExchangeWithdrawValues alg_values;
|
struct TALER_ExchangeWithdrawValues alg_values;
|
||||||
struct TALER_AgeCommitmentHash *ach = NULL;
|
struct TALER_AgeCommitmentHashP *ach = NULL;
|
||||||
|
|
||||||
if (0 < age)
|
if (0 < age)
|
||||||
{
|
{
|
||||||
struct TALER_AgeCommitmentHash ah = {0};
|
struct TALER_AgeCommitmentHashP ah = {0};
|
||||||
struct TALER_AgeCommitmentProof acp;
|
struct TALER_AgeCommitmentProof acp;
|
||||||
struct GNUNET_HashCode seed;
|
struct GNUNET_HashCode seed;
|
||||||
|
|
||||||
|
@ -269,7 +269,7 @@ test_signing (struct TALER_CRYPTO_RsaDenominationHelper *dh)
|
|||||||
bool success = false;
|
bool success = false;
|
||||||
struct TALER_PlanchetMasterSecretP ps;
|
struct TALER_PlanchetMasterSecretP ps;
|
||||||
struct TALER_ExchangeWithdrawValues alg_values;
|
struct TALER_ExchangeWithdrawValues alg_values;
|
||||||
struct TALER_AgeCommitmentHash ach;
|
struct TALER_AgeCommitmentHashP ach;
|
||||||
struct TALER_CoinPubHashP c_hash;
|
struct TALER_CoinPubHashP c_hash;
|
||||||
struct TALER_CoinSpendPrivateKeyP coin_priv;
|
struct TALER_CoinSpendPrivateKeyP coin_priv;
|
||||||
union TALER_DenominationBlindingKeyP bks;
|
union TALER_DenominationBlindingKeyP bks;
|
||||||
@ -458,7 +458,7 @@ test_batch_signing (struct TALER_CRYPTO_RsaDenominationHelper *dh,
|
|||||||
bool success = false;
|
bool success = false;
|
||||||
struct TALER_PlanchetMasterSecretP ps[batch_size];
|
struct TALER_PlanchetMasterSecretP ps[batch_size];
|
||||||
struct TALER_ExchangeWithdrawValues alg_values[batch_size];
|
struct TALER_ExchangeWithdrawValues alg_values[batch_size];
|
||||||
struct TALER_AgeCommitmentHash ach[batch_size];
|
struct TALER_AgeCommitmentHashP ach[batch_size];
|
||||||
struct TALER_CoinPubHashP c_hash[batch_size];
|
struct TALER_CoinPubHashP c_hash[batch_size];
|
||||||
struct TALER_CoinSpendPrivateKeyP coin_priv[batch_size];
|
struct TALER_CoinSpendPrivateKeyP coin_priv[batch_size];
|
||||||
union TALER_DenominationBlindingKeyP bks[batch_size];
|
union TALER_DenominationBlindingKeyP bks[batch_size];
|
||||||
@ -672,7 +672,7 @@ perf_signing (struct TALER_CRYPTO_RsaDenominationHelper *dh,
|
|||||||
struct GNUNET_TIME_Relative duration;
|
struct GNUNET_TIME_Relative duration;
|
||||||
struct TALER_PlanchetMasterSecretP ps;
|
struct TALER_PlanchetMasterSecretP ps;
|
||||||
struct TALER_CoinSpendPrivateKeyP coin_priv;
|
struct TALER_CoinSpendPrivateKeyP coin_priv;
|
||||||
struct TALER_AgeCommitmentHash ach;
|
struct TALER_AgeCommitmentHashP ach;
|
||||||
union TALER_DenominationBlindingKeyP bks;
|
union TALER_DenominationBlindingKeyP bks;
|
||||||
struct TALER_ExchangeWithdrawValues alg_values;
|
struct TALER_ExchangeWithdrawValues alg_values;
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ cp_to_j (
|
|||||||
json_t *j_proof;
|
json_t *j_proof;
|
||||||
json_t *j_pubs;
|
json_t *j_pubs;
|
||||||
json_t *j_privs;
|
json_t *j_privs;
|
||||||
struct TALER_AgeCommitmentHash hac = {0};
|
struct TALER_AgeCommitmentHashP hac = {0};
|
||||||
char buf[256] = {0};
|
char buf[256] = {0};
|
||||||
|
|
||||||
TALER_age_commitment_hash (&acp->commitment, &hac);
|
TALER_age_commitment_hash (&acp->commitment, &hac);
|
||||||
|
@ -46,7 +46,7 @@ struct TALER_DepositRequestPS
|
|||||||
* Hash over the age commitment that went into the coin. Maybe all zero, if
|
* Hash over the age commitment that went into the coin. Maybe all zero, if
|
||||||
* age commitment isn't applicable to the denomination.
|
* age commitment isn't applicable to the denomination.
|
||||||
*/
|
*/
|
||||||
struct TALER_AgeCommitmentHash h_age_commitment GNUNET_PACKED;
|
struct TALER_AgeCommitmentHashP h_age_commitment GNUNET_PACKED;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hash over optional policy extension attributes shared with the exchange.
|
* Hash over optional policy extension attributes shared with the exchange.
|
||||||
@ -119,7 +119,7 @@ TALER_wallet_deposit_sign (
|
|||||||
const struct TALER_Amount *deposit_fee,
|
const struct TALER_Amount *deposit_fee,
|
||||||
const struct TALER_MerchantWireHashP *h_wire,
|
const struct TALER_MerchantWireHashP *h_wire,
|
||||||
const struct TALER_PrivateContractHashP *h_contract_terms,
|
const struct TALER_PrivateContractHashP *h_contract_terms,
|
||||||
const struct TALER_AgeCommitmentHash *h_age_commitment,
|
const struct TALER_AgeCommitmentHashP *h_age_commitment,
|
||||||
const struct TALER_ExtensionPolicyHashP *h_policy,
|
const struct TALER_ExtensionPolicyHashP *h_policy,
|
||||||
const struct TALER_DenominationHashP *h_denom_pub,
|
const struct TALER_DenominationHashP *h_denom_pub,
|
||||||
const struct GNUNET_TIME_Timestamp wallet_timestamp,
|
const struct GNUNET_TIME_Timestamp wallet_timestamp,
|
||||||
@ -159,7 +159,7 @@ TALER_wallet_deposit_verify (
|
|||||||
const struct TALER_Amount *deposit_fee,
|
const struct TALER_Amount *deposit_fee,
|
||||||
const struct TALER_MerchantWireHashP *h_wire,
|
const struct TALER_MerchantWireHashP *h_wire,
|
||||||
const struct TALER_PrivateContractHashP *h_contract_terms,
|
const struct TALER_PrivateContractHashP *h_contract_terms,
|
||||||
const struct TALER_AgeCommitmentHash *h_age_commitment,
|
const struct TALER_AgeCommitmentHashP *h_age_commitment,
|
||||||
const struct TALER_ExtensionPolicyHashP *h_policy,
|
const struct TALER_ExtensionPolicyHashP *h_policy,
|
||||||
const struct TALER_DenominationHashP *h_denom_pub,
|
const struct TALER_DenominationHashP *h_denom_pub,
|
||||||
struct GNUNET_TIME_Timestamp wallet_timestamp,
|
struct GNUNET_TIME_Timestamp wallet_timestamp,
|
||||||
@ -230,7 +230,7 @@ struct TALER_LinkDataPS
|
|||||||
/**
|
/**
|
||||||
* Hash of the age commitment, if applicable. Can be all zero
|
* Hash of the age commitment, if applicable. Can be all zero
|
||||||
*/
|
*/
|
||||||
struct TALER_AgeCommitmentHash h_age_commitment;
|
struct TALER_AgeCommitmentHashP h_age_commitment;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hash of the blinded new coin.
|
* Hash of the blinded new coin.
|
||||||
@ -426,7 +426,7 @@ struct TALER_RefreshMeltCoinAffirmationPS
|
|||||||
* the hash of the age commitment vector. It must be all zeroes if no age
|
* the hash of the age commitment vector. It must be all zeroes if no age
|
||||||
* commitment was provided.
|
* commitment was provided.
|
||||||
*/
|
*/
|
||||||
struct TALER_AgeCommitmentHash h_age_commitment GNUNET_PACKED;
|
struct TALER_AgeCommitmentHashP h_age_commitment GNUNET_PACKED;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* How much of the value of the coin should be melted? This amount
|
* How much of the value of the coin should be melted? This amount
|
||||||
@ -458,7 +458,7 @@ TALER_wallet_melt_sign (
|
|||||||
const struct TALER_Amount *melt_fee,
|
const struct TALER_Amount *melt_fee,
|
||||||
const struct TALER_RefreshCommitmentP *rc,
|
const struct TALER_RefreshCommitmentP *rc,
|
||||||
const struct TALER_DenominationHashP *h_denom_pub,
|
const struct TALER_DenominationHashP *h_denom_pub,
|
||||||
const struct TALER_AgeCommitmentHash *h_age_commitment,
|
const struct TALER_AgeCommitmentHashP *h_age_commitment,
|
||||||
const struct TALER_CoinSpendPrivateKeyP *coin_priv,
|
const struct TALER_CoinSpendPrivateKeyP *coin_priv,
|
||||||
struct TALER_CoinSpendSignatureP *coin_sig)
|
struct TALER_CoinSpendSignatureP *coin_sig)
|
||||||
{
|
{
|
||||||
@ -490,7 +490,7 @@ TALER_wallet_melt_verify (
|
|||||||
const struct TALER_Amount *melt_fee,
|
const struct TALER_Amount *melt_fee,
|
||||||
const struct TALER_RefreshCommitmentP *rc,
|
const struct TALER_RefreshCommitmentP *rc,
|
||||||
const struct TALER_DenominationHashP *h_denom_pub,
|
const struct TALER_DenominationHashP *h_denom_pub,
|
||||||
const struct TALER_AgeCommitmentHash *h_age_commitment,
|
const struct TALER_AgeCommitmentHashP *h_age_commitment,
|
||||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||||
const struct TALER_CoinSpendSignatureP *coin_sig)
|
const struct TALER_CoinSpendSignatureP *coin_sig)
|
||||||
{
|
{
|
||||||
@ -1021,7 +1021,7 @@ struct TALER_PurseDepositPS
|
|||||||
* Hash over the age commitment that went into the coin. Maybe all zero, if
|
* Hash over the age commitment that went into the coin. Maybe all zero, if
|
||||||
* age commitment isn't applicable to the denomination.
|
* age commitment isn't applicable to the denomination.
|
||||||
*/
|
*/
|
||||||
struct TALER_AgeCommitmentHash h_age_commitment GNUNET_PACKED;
|
struct TALER_AgeCommitmentHashP h_age_commitment GNUNET_PACKED;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Purse to deposit funds into.
|
* Purse to deposit funds into.
|
||||||
@ -1043,7 +1043,7 @@ TALER_wallet_purse_deposit_sign (
|
|||||||
const struct TALER_PurseContractPublicKeyP *purse_pub,
|
const struct TALER_PurseContractPublicKeyP *purse_pub,
|
||||||
const struct TALER_Amount *amount,
|
const struct TALER_Amount *amount,
|
||||||
const struct TALER_DenominationHashP *h_denom_pub,
|
const struct TALER_DenominationHashP *h_denom_pub,
|
||||||
const struct TALER_AgeCommitmentHash *h_age_commitment,
|
const struct TALER_AgeCommitmentHashP *h_age_commitment,
|
||||||
const struct TALER_CoinSpendPrivateKeyP *coin_priv,
|
const struct TALER_CoinSpendPrivateKeyP *coin_priv,
|
||||||
struct TALER_CoinSpendSignatureP *coin_sig)
|
struct TALER_CoinSpendSignatureP *coin_sig)
|
||||||
{
|
{
|
||||||
@ -1072,7 +1072,7 @@ TALER_wallet_purse_deposit_verify (
|
|||||||
const struct TALER_PurseContractPublicKeyP *purse_pub,
|
const struct TALER_PurseContractPublicKeyP *purse_pub,
|
||||||
const struct TALER_Amount *amount,
|
const struct TALER_Amount *amount,
|
||||||
const struct TALER_DenominationHashP *h_denom_pub,
|
const struct TALER_DenominationHashP *h_denom_pub,
|
||||||
const struct TALER_AgeCommitmentHash *h_age_commitment,
|
const struct TALER_AgeCommitmentHashP *h_age_commitment,
|
||||||
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
const struct TALER_CoinSpendPublicKeyP *coin_pub,
|
||||||
const struct TALER_CoinSpendSignatureP *coin_sig)
|
const struct TALER_CoinSpendSignatureP *coin_sig)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user