aboutsummaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_refreshes_reveal.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_refreshes_reveal.c
parent3716592addcac5e31d092a83cf02a0fec57d8743 (diff)
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_refreshes_reveal.c')
-rw-r--r--src/lib/exchange_api_refreshes_reveal.c19
1 files changed, 10 insertions, 9 deletions
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])));
}
}