From 6a483b51ec6b857982a45d5215834c99a827066f Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 10 Jul 2023 16:34:01 +0200 Subject: fix alignment issue, ensure we hash over packed structure to avoid non-determinism --- src/include/taler_crypto_lib.h | 52 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'src/include/taler_crypto_lib.h') diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index 9b0cb604..ee06f631 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -6032,4 +6032,56 @@ TALER_age_restriction_from_secret ( struct TALER_AgeCommitmentProof *comm_proof); +/** + * Group of Denominations. These are the common fields of an array of + * denominations. + * + * The corresponding JSON-blob will also contain an array of particular + * denominations with only the timestamps, cipher-specific public key and the + * master signature. + */ +struct TALER_DenominationGroup +{ + + /** + * XOR of all SHA-512 hashes of the public keys in this + * group. + */ + struct GNUNET_HashCode hash; + + /** + * Value of coins in this denomination group. + */ + struct TALER_Amount value; + + /** + * Fee structure for all coins in the group. + */ + struct TALER_DenomFeeSet fees; + + /** + * Cipher used for the denomination. + */ + enum TALER_DenominationCipher cipher; + + /** + * Age mask for the denomiation. + */ + struct TALER_AgeMask age_mask; + +}; + + +/** + * Compute a unique key for the meta data of a denomination group. + * + * @param dg denomination group to evaluate + * @param[out] key key to set + */ +void +TALER_denomination_group_get_key ( + const struct TALER_DenominationGroup *dg, + struct GNUNET_HashCode *key); + + #endif -- cgit v1.2.3