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_refreshes_reveal.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/lib/exchange_api_refreshes_reveal.c') diff --git a/src/lib/exchange_api_refreshes_reveal.c b/src/lib/exchange_api_refreshes_reveal.c index 881c7e731..6427c637b 100644 --- a/src/lib/exchange_api_refreshes_reveal.c +++ b/src/lib/exchange_api_refreshes_reveal.c @@ -156,21 +156,21 @@ refresh_reveal_ok (struct TALER_EXCHANGE_RefreshesRevealHandle *rrh, rci->ps = fcd->ps[rrh->noreveal_index]; rci->bks = fcd->bks[rrh->noreveal_index]; - rci->age_commitment = fcd->age_commitment[rrh->noreveal_index]; + rci->age_commitment_proof = fcd->age_commitment_proof[rrh->noreveal_index]; rci->h_age_commitment = NULL; pk = &fcd->fresh_pk; jsonai = json_array_get (jsona, i); GNUNET_assert (NULL != jsonai); GNUNET_assert ( - (NULL != rrh->md.melted_coin.age_commitment) == - (NULL != rci->age_commitment)); + (NULL != rrh->md.melted_coin.age_commitment_proof) == + (NULL != rci->age_commitment_proof)); - if (NULL != rci->age_commitment) + if (NULL != rci->age_commitment_proof) { rci->h_age_commitment = GNUNET_new (struct TALER_AgeCommitmentHash); TALER_age_commitment_hash ( - rci->age_commitment, + &rci->age_commitment_proof->commitment, rci->h_age_commitment); } @@ -429,18 +429,19 @@ TALER_EXCHANGE_refreshes_reveal ( } /* build array of old age commitment, if applicable */ - GNUNET_assert ((NULL == rd->melt_age_commitment) == + GNUNET_assert ((NULL == rd->melt_age_commitment_proof) == (NULL == rd->melt_h_age_commitment)); - if (NULL != rd->melt_age_commitment) + if (NULL != rd->melt_age_commitment_proof) { GNUNET_assert (NULL != (old_age_commitment = json_array ())); - for (size_t i = 0; i < rd->melt_age_commitment->num_pub; i++) + for (size_t i = 0; i < rd->melt_age_commitment_proof->commitment.num; i++) { GNUNET_assert (0 == json_array_append_new (old_age_commitment, GNUNET_JSON_from_data_auto ( - &rd->melt_age_commitment->pub[i]))); + &rd->melt_age_commitment_proof-> + commitment.pub[i]))); } } -- cgit v1.2.3