diff options
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 |
commit | e9eb00e285c80f63cfc08fdd9ea6707d55162e60 (patch) | |
tree | 82868974066e473a7905ae3e91c230e2eb96d5d3 /src/exchange/taler-exchange-httpd_refreshes_reveal.c | |
parent | 3716592addcac5e31d092a83cf02a0fec57d8743 (diff) | |
download | exchange-e9eb00e285c80f63cfc08fdd9ea6707d55162e60.tar.gz exchange-e9eb00e285c80f63cfc08fdd9ea6707d55162e60.tar.bz2 exchange-e9eb00e285c80f63cfc08fdd9ea6707d55162e60.zip |
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/exchange/taler-exchange-httpd_refreshes_reveal.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_refreshes_reveal.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/exchange/taler-exchange-httpd_refreshes_reveal.c b/src/exchange/taler-exchange-httpd_refreshes_reveal.c index 23620f87a..caba557c5 100644 --- a/src/exchange/taler-exchange-httpd_refreshes_reveal.c +++ b/src/exchange/taler-exchange-httpd_refreshes_reveal.c @@ -296,18 +296,23 @@ check_commitment (struct RevealContext *rctx, * the transfer_secret and the old age commitment. */ if (NULL != rctx->old_age_commitment) { - struct TALER_AgeCommitment ac = {0}; - struct TALER_AgeCommitmentHash h = {0}; uint64_t seed = (uint64_t) ts.key.bits[0] | (uint64_t) ts.key.bits[1] << 32; + struct TALER_AgeCommitmentProof acp = { + /* we only need the commitment, not the proof, for the call to + * TALER_age_commitment_derive. */ + .commitment = *(rctx->old_age_commitment) + }; + struct TALER_AgeCommitmentProof nacp = {0}; + struct TALER_AgeCommitmentHash h = {0}; GNUNET_assert (GNUNET_OK == TALER_age_commitment_derive ( - rctx->old_age_commitment, + &acp, seed, - &ac)); + &nacp)); - TALER_age_commitment_hash (&ac, &h); + TALER_age_commitment_hash (&nacp.commitment, &h); hac = &h; } @@ -614,8 +619,7 @@ resolve_refreshes_reveal_denominations (struct MHD_Connection *connection, rctx->old_age_commitment = GNUNET_new (struct TALER_AgeCommitment); oac = rctx->old_age_commitment; oac->mask = TEH_age_mask; - oac->num_pub = ng; - oac->num_priv = 0; /* no private keys are needed for the reveal phase */ + oac->num = ng; oac->pub = GNUNET_new_array (ng, struct TALER_AgeCommitmentPublicKeyP); /* Extract old age commitment */ |