diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2023-06-26 00:01:31 +0200 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2023-06-26 00:01:31 +0200 |
commit | ddedf03a816e5139b235a3ebdf5b600508c5ed5f (patch) | |
tree | a65179048fc764ec82ddf645a8982186b0157448 /src/util/wallet_signatures.c | |
parent | 70bfe0ed1b9a5dbb6cc487465ef3c3df4cdb0436 (diff) | |
download | exchange-ddedf03a816e5139b235a3ebdf5b600508c5ed5f.tar.xz |
[age-withdraw] age-withdraw commit- and reveal-handlers implemented, 12/n
The handlers for the commit- and reveal-phases of the age-withdraw
HTTP-endpoints are implemented, yet not active.
Still missing:
- support for age-withdraw is missing in lib/.
- tests
Diffstat (limited to 'src/util/wallet_signatures.c')
-rw-r--r-- | src/util/wallet_signatures.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/util/wallet_signatures.c b/src/util/wallet_signatures.c index 221865e73..0e5db2b51 100644 --- a/src/util/wallet_signatures.c +++ b/src/util/wallet_signatures.c @@ -634,9 +634,14 @@ struct TALER_AgeWithdrawRequestPS struct TALER_AmountNBO amount_with_fee; /** + * The mask that defines the age groups + */ + struct TALER_AgeMask mask; + + /** * Maximum age group that the coins are going to be restricted to. */ - uint32_t max_age_group; + uint8_t max_age_group; }; @@ -646,7 +651,8 @@ void TALER_wallet_age_withdraw_sign ( const struct TALER_AgeWithdrawCommitmentHashP *h_commitment, const struct TALER_Amount *amount_with_fee, - uint32_t max_age_group, + const struct TALER_AgeMask *mask, + uint8_t max_age, const struct TALER_ReservePrivateKeyP *reserve_priv, struct TALER_ReserveSignatureP *reserve_sig) { @@ -654,7 +660,8 @@ TALER_wallet_age_withdraw_sign ( .purpose.size = htonl (sizeof (req)), .purpose.purpose = htonl (TALER_SIGNATURE_WALLET_RESERVE_AGE_WITHDRAW), .h_commitment = *h_commitment, - .max_age_group = max_age_group + .mask = *mask, + .max_age_group = TALER_get_age_group (mask, max_age) }; TALER_amount_hton (&req.amount_with_fee, @@ -669,7 +676,8 @@ enum GNUNET_GenericReturnValue TALER_wallet_age_withdraw_verify ( const struct TALER_AgeWithdrawCommitmentHashP *h_commitment, const struct TALER_Amount *amount_with_fee, - uint32_t max_age_group, + const struct TALER_AgeMask *mask, + uint8_t max_age, const struct TALER_ReservePublicKeyP *reserve_pub, const struct TALER_ReserveSignatureP *reserve_sig) { @@ -677,7 +685,8 @@ TALER_wallet_age_withdraw_verify ( .purpose.size = htonl (sizeof (awsrd)), .purpose.purpose = htonl (TALER_SIGNATURE_WALLET_RESERVE_AGE_WITHDRAW), .h_commitment = *h_commitment, - .max_age_group = max_age_group + .mask = *mask, + .max_age_group = TALER_get_age_group (mask, max_age) }; TALER_amount_hton (&awsrd.amount_with_fee, |