aboutsummaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_refresh_common.c
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2022-03-01 17:02:37 +0100
committerÖzgür Kesim <oec-taler@kesim.org>2022-03-01 17:02:37 +0100
commite9eb00e285c80f63cfc08fdd9ea6707d55162e60 (patch)
tree82868974066e473a7905ae3e91c230e2eb96d5d3 /src/lib/exchange_api_refresh_common.c
parent3716592addcac5e31d092a83cf02a0fec57d8743 (diff)
downloadexchange-e9eb00e285c80f63cfc08fdd9ea6707d55162e60.tar.xz
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.
Diffstat (limited to 'src/lib/exchange_api_refresh_common.c')
-rw-r--r--src/lib/exchange_api_refresh_common.c13
1 files changed, 7 insertions, 6 deletions
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);
}