diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/taler_crypto_lib.h | 33 | ||||
| -rw-r--r-- | src/include/taler_exchange_service.h | 9 | ||||
| -rw-r--r-- | src/include/taler_util.h | 7 | 
3 files changed, 37 insertions, 12 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index 3ad441cb..373fc5c2 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -5947,34 +5947,55 @@ TALER_age_commitment_verify (  /**   * @brief helper function to free memory of a struct TALER_AgeCommitment   * - * @param p the commitment from which all memory should be freed. + * @param ac the commitment from which all memory should be freed.   */  void  TALER_age_commitment_free ( -  struct TALER_AgeCommitment *p); +  struct TALER_AgeCommitment *ac);  /**   * @brief helper function to free memory of a struct TALER_AgeProof   * - * @param p the proof of commitment from which all memory should be freed. + * @param ap the proof of commitment from which all memory should be freed.   */  void  TALER_age_proof_free ( -  struct TALER_AgeProof *p); +  struct TALER_AgeProof *ap);  /**   * @brief helper function to free memory of a struct TALER_AgeCommitmentProof   * - * @param p the commitment and its proof from which all memory should be freed. + * @param acp the commitment and its proof from which all memory should be freed.   */  void  TALER_age_commitment_proof_free ( -  struct TALER_AgeCommitmentProof *p); +  struct TALER_AgeCommitmentProof *acp);  /** + * @brief helper function to allocate and copy a struct TALER_AgeCommitmentProof + * + * @param[in] acp The original age commitment proof + * @return The deep copy of @e acp, allocated + */ +struct TALER_AgeCommitmentProof * +TALER_age_commitment_proof_duplicate ( +  const struct TALER_AgeCommitmentProof *acp); + +/** + * @brief helper function to copy a struct TALER_AgeCommitmentProof + * + * @param[in] acp The original age commitment proof + * @param[out] nacp The struct to copy the data into, with freshly allocated and copied keys. + */ +void +TALER_age_commitment_proof_deep_copy ( +  const struct TALER_AgeCommitmentProof *acp, +  struct TALER_AgeCommitmentProof *nacp); + +/**   * @brief For age-withdraw, clients have to prove that the public keys for all   * age groups larger than the allowed maximum age group are derived by scalar   * multiplication from this Edx25519 public key (in Crockford Base32 encoding): diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h index 35a68872..aedd2fcf 100644 --- a/src/include/taler_exchange_service.h +++ b/src/include/taler_exchange_service.h @@ -3043,7 +3043,7 @@ struct TALER_EXCHANGE_RevealedCoinInfo     * Age commitment and its hash of the coin, might be NULL.     */    struct TALER_AgeCommitmentProof *age_commitment_proof; -  struct TALER_AgeCommitmentHash *h_age_commitment; +  struct TALER_AgeCommitmentHash h_age_commitment;    /**     * Blinding keys used to blind the fresh coin. @@ -3187,10 +3187,11 @@ struct TALER_EXCHANGE_LinkedCoinInfo    struct TALER_CoinSpendPrivateKeyP coin_priv;    /** -   * Age commitment and its hash, if applicable.  Might be NULL. +   * Age commitment and its hash, if applicable.     */ -  struct TALER_AgeCommitmentProof *age_commitment_proof; -  struct TALER_AgeCommitmentHash *h_age_commitment; +  bool has_age_commitment; +  struct TALER_AgeCommitmentProof age_commitment_proof; +  struct TALER_AgeCommitmentHash h_age_commitment;    /**     * Master secret of this coin. diff --git a/src/include/taler_util.h b/src/include/taler_util.h index e0473bff..8762f7dc 100644 --- a/src/include/taler_util.h +++ b/src/include/taler_util.h @@ -578,11 +578,14 @@ TALER_parse_age_group_string (  /**   * @brief Encodes the age mask into a string, like "8:10:12:14:16:18:21"   * + * NOTE: This function uses a static buffer.  It is not safe to call this + * function concurrently. + *   * @param mask Age mask - * @return String representation of the age mask, allocated by GNUNET_malloc. + * @return String representation of the age mask.   *         Can be used as value in the TALER config.   */ -char * +const char *  TALER_age_mask_to_string (    const struct TALER_AgeMask *mask);  | 
