From e9eb00e285c80f63cfc08fdd9ea6707d55162e60 Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Tue, 1 Mar 2022 17:02:37 +0100 Subject: Refactoring TALER_AgeCommitment Instead of a single struct TALER_AgeCommitment, we now use 1. TALER_AgeCommitment for the age mask and list public keys for age restriciton. 2. TALER_AgeProof for list of private keys for age restriction 3. TALER_AgeCommitmentProof for the aggregation of the former two. Also, we introduce TALER_AgeAttestation as the EDDSA signature to attest a particular age group, along with the function prototypes TALER_age_commitment_attest and TALER_age_commitment_verify. --- src/testing/testing_api_cmd_deposit.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/testing/testing_api_cmd_deposit.c') diff --git a/src/testing/testing_api_cmd_deposit.c b/src/testing/testing_api_cmd_deposit.c index 33c1db44..2b9486ca 100644 --- a/src/testing/testing_api_cmd_deposit.c +++ b/src/testing/testing_api_cmd_deposit.c @@ -287,7 +287,7 @@ deposit_run (void *cls, const struct TALER_TESTING_Command *coin_cmd; const struct TALER_CoinSpendPrivateKeyP *coin_priv; struct TALER_CoinSpendPublicKeyP coin_pub; - const struct TALER_AgeCommitment *age_commitment = NULL; + const struct TALER_AgeCommitmentProof *age_commitment_proof = NULL; struct TALER_AgeCommitmentHash h_age_commitment = {0}; const struct TALER_EXCHANGE_DenomPublicKey *denom_pub; const struct TALER_DenominationSignature *denom_pub_sig; @@ -385,9 +385,9 @@ deposit_run (void *cls, ds->coin_index, &coin_priv)) || (GNUNET_OK != - TALER_TESTING_get_trait_age_commitment (coin_cmd, - ds->coin_index, - &age_commitment)) || + TALER_TESTING_get_trait_age_commitment_proof (coin_cmd, + ds->coin_index, + &age_commitment_proof)) || (GNUNET_OK != TALER_TESTING_get_trait_denom_pub (coin_cmd, ds->coin_index, @@ -405,9 +405,10 @@ deposit_run (void *cls, return; } - if (NULL != age_commitment) + if (NULL != age_commitment_proof) { - TALER_age_commitment_hash (age_commitment, &h_age_commitment); + TALER_age_commitment_hash (&age_commitment_proof->commitment, + &h_age_commitment); } ds->deposit_fee = denom_pub->fees.deposit; GNUNET_CRYPTO_eddsa_key_get_public (&coin_priv->eddsa_priv, @@ -533,7 +534,7 @@ deposit_traits (void *cls, const struct TALER_TESTING_Command *coin_cmd; /* Will point to coin cmd internals. */ const struct TALER_CoinSpendPrivateKeyP *coin_spent_priv; - const struct TALER_AgeCommitment *age_commitment; + const struct TALER_AgeCommitmentProof *age_commitment_proof; if (GNUNET_YES != ds->command_initialized) { @@ -556,9 +557,9 @@ deposit_traits (void *cls, ds->coin_index, &coin_spent_priv) || (GNUNET_OK != - TALER_TESTING_get_trait_age_commitment (coin_cmd, - ds->coin_index, - &age_commitment))) + TALER_TESTING_get_trait_age_commitment_proof (coin_cmd, + ds->coin_index, + &age_commitment_proof))) { GNUNET_break (0); TALER_TESTING_interpreter_fail (ds->is); @@ -573,8 +574,8 @@ deposit_traits (void *cls, /* These traits are always available */ TALER_TESTING_make_trait_coin_priv (index, coin_spent_priv), - TALER_TESTING_make_trait_age_commitment (index, - age_commitment), + TALER_TESTING_make_trait_age_commitment_proof (index, + age_commitment_proof), TALER_TESTING_make_trait_wire_details (ds->wire_details), TALER_TESTING_make_trait_contract_terms (ds->contract_terms), TALER_TESTING_make_trait_merchant_priv (&ds->merchant_priv), -- cgit v1.2.3