diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/taler_crypto_lib.h | 10 | ||||
-rw-r--r-- | src/include/taler_exchange_service.h | 12 | ||||
-rw-r--r-- | src/include/taler_exchangedb_plugin.h | 8 |
3 files changed, 17 insertions, 13 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index 20b9ff303..a49b9eb5f 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -2419,6 +2419,7 @@ TALER_wallet_deposit_verify ( * @param melt_fee the melt fee we expect to pay * @param rc refresh session we are committed to * @param h_denom_pub hash of the coin denomination's public key + * @param h_age_commitment hash of the age commitment (may be NULL) * @param coin_priv coin’s private key * @param[out] coin_sig set to the signature made with purpose #TALER_SIGNATURE_WALLET_COIN_MELT */ @@ -2428,6 +2429,7 @@ TALER_wallet_melt_sign ( const struct TALER_Amount *melt_fee, const struct TALER_RefreshCommitmentP *rc, const struct TALER_DenominationHashP *h_denom_pub, + const struct TALER_AgeCommitmentHash *h_age_commitment, const struct TALER_CoinSpendPrivateKeyP *coin_priv, struct TALER_CoinSpendSignatureP *coin_sig); @@ -3346,7 +3348,7 @@ TALER_age_commitment_hash ( * * @param mask The age mask the defines the age groups * @param age The actual age for which an age commitment is generated - * @param seed The seed that goes into the key generation. MUST be choosen uniformly random. + * @param salt The salt that goes into the key generation. MUST be choosen uniformly random. * @param commitment[out] The generated age commitment, ->priv and ->pub allocated via GNUNET_malloc on success * @return GNUNET_OK on success, GNUNET_SYSERR otherwise */ @@ -3354,21 +3356,21 @@ enum GNUNET_GenericReturnValue TALER_age_restriction_commit ( const struct TALER_AgeMask *mask, const uint8_t age, - const uint32_t seed, + const uint64_t salt, struct TALER_AgeCommitment *commitment); /* * @brief Derives another, equivalent age commitment for a given one. * * @param orig Original age commitment - * @param seed Used to move the points on the elliptic curve in order to generate another, equivalent commitment. + * @param salt Salt to randomly move the points on the elliptic curve in order to generate another, equivalent commitment. * @param derived[out] The resulting age commitment, ->priv and ->pub allocated via GNUNET_malloc on success. * @return GNUNET_OK on success, GNUNET_SYSERR otherwise */ enum GNUNET_GenericReturnValue TALER_age_commitment_derive ( const struct TALER_AgeCommitment *orig, - const uint32_t seed, + const uint64_t salt, struct TALER_AgeCommitment *derived); /* diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h index 92e841ef2..fcb0ab7fb 100644 --- a/src/include/taler_exchange_service.h +++ b/src/include/taler_exchange_service.h @@ -1682,9 +1682,11 @@ struct TALER_EXCHANGE_RefreshData struct TALER_CoinSpendPrivateKeyP melt_priv; /* - * age commitment that went into the original coin, might be NULL + * age commitment and its hash that went into the original coin, might be + * NULL */ - struct TALER_AgeCommitment *age_commitment; + struct TALER_AgeCommitment *melt_age_commitment; + struct TALER_AgeCommitmentHash *melt_h_age_commitment; /** * amount specifying how much the coin will contribute to the melt @@ -1998,6 +2000,12 @@ struct TALER_EXCHANGE_LinkedCoinInfo struct TALER_CoinSpendPrivateKeyP coin_priv; /** + * Age commitment and its hash, if applicable. Might be NULL. + */ + struct TALER_AgeCommitment *age_commitment; + struct TALER_AgeCommitmentHash *h_age_commitment; + + /** * Master secret of this coin. */ struct TALER_PlanchetMasterSecretP ps; diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h index 10ab1ac94..529d49431 100644 --- a/src/include/taler_exchangedb_plugin.h +++ b/src/include/taler_exchangedb_plugin.h @@ -309,6 +309,7 @@ struct TALER_EXCHANGEDB_TableData struct TALER_CoinSpendPublicKeyP old_coin_pub; struct TALER_CoinSpendSignatureP old_coin_sig; struct TALER_Amount amount_with_fee; + struct TALER_AgeCommitmentHash h_age_commitment; uint32_t noreveal_index; } refresh_commitments; @@ -1269,13 +1270,6 @@ struct TALER_EXCHANGEDB_Refresh struct TALER_CoinSpendSignatureP coin_sig; /** - * Hash of the age commitment used to sign the coin, if age restriction was - * applicable to the denomination. May be all zeroes if no age restriction - * applies. - */ - struct TALER_AgeCommitmentHash h_age_commitment; - - /** * Refresh commitment this coin is melted into. */ struct TALER_RefreshCommitmentP rc; |