From e9eb00e285c80f63cfc08fdd9ea6707d55162e60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= 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/lib/exchange_api_refresh_common.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/lib/exchange_api_refresh_common.c') diff --git a/src/lib/exchange_api_refresh_common.c b/src/lib/exchange_api_refresh_common.c index 997d1fec8..94d0dc8cb 100644 --- a/src/lib/exchange_api_refresh_common.c +++ b/src/lib/exchange_api_refresh_common.c @@ -78,7 +78,7 @@ TALER_EXCHANGE_get_melt_data_ ( md->melted_coin.fee_melt = rd->melt_pk.fees.refresh; md->melted_coin.original_value = rd->melt_pk.value; md->melted_coin.expire_deposit = rd->melt_pk.expire_deposit; - md->melted_coin.age_commitment = rd->melt_age_commitment; + md->melted_coin.age_commitment_proof = rd->melt_age_commitment_proof; md->melted_coin.h_age_commitment = rd->melt_h_age_commitment; GNUNET_assert (GNUNET_OK == @@ -183,24 +183,25 @@ TALER_EXCHANGE_get_melt_data_ ( bks); /* Handle age commitment, if present */ - if (NULL != md->melted_coin.age_commitment) + if (NULL != md->melted_coin.age_commitment_proof) { /* We use the first 8 bytes of the trans_sec to generate a new age * commitment */ uint64_t age_seed = (uint64_t) trans_sec.key.bits[0] | (uint64_t) trans_sec.key.bits[1] << 32; - fcd->age_commitment[i] = GNUNET_new (struct TALER_AgeCommitment); + fcd->age_commitment_proof[i] = GNUNET_new (struct + TALER_AgeCommitmentProof); ach = GNUNET_new (struct TALER_AgeCommitmentHash); GNUNET_assert (GNUNET_OK == TALER_age_commitment_derive ( - md->melted_coin.age_commitment, + md->melted_coin.age_commitment_proof, age_seed, - fcd->age_commitment[i])); + fcd->age_commitment_proof[i])); TALER_age_commitment_hash ( - fcd->age_commitment[i], + &fcd->age_commitment_proof[i]->commitment, ach); } -- cgit v1.2.3