From 31f74059e0d710254397688aabc201b230ef27da Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Sun, 26 Jun 2022 16:59:27 +0200 Subject: [new /keys response] create and parse denomination implemented - /keys response now contains signed denomintations - hashes of denominations now XOR'ed per group into a single hash-code - final hash-code is now XOR of all group hash codes - final hash-code is signed - lib/exchange_api_handle support for new "denominations" implemented - parses array of denomation groups - creates running xor of hashes - verifies signature at the end - previous diff/merge logic for keys remains intact. --- src/include/taler_json_lib.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'src/include/taler_json_lib.h') diff --git a/src/include/taler_json_lib.h b/src/include/taler_json_lib.h index a8ad6f243..f0b105e98 100644 --- a/src/include/taler_json_lib.h +++ b/src/include/taler_json_lib.h @@ -359,6 +359,36 @@ TALER_JSON_spec_amount_any_nbo (const char *name, TALER_JSON_pack_amount ("account_fee", &(gfs)->account), \ TALER_JSON_pack_amount ("purse_fee", &(gfs)->purse) +/** + * 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 +{ + /* currency must be set prior to calling TALER_JSON_spec_denomination_group */ + const char *currency; + enum TALER_DenominationCipher cipher; + struct TALER_Amount value; + struct TALER_DenomFeeSet fees; + struct TALER_AgeMask age_mask; +}; + +/** + * Generate a parser for a group of denominations. + * NOTE: group.currency MUST have been set prior to calling this function. + * + * @param field name of the field, maybe NULL + * @param[out] group denomination group information + * @return corresponding field spec + */ +struct GNUNET_JSON_Specification +TALER_JSON_spec_denomination_group (const char *field, + struct TALER_DenominationGroup *group); /** * Generate line in parser specification for denomination public key. @@ -371,6 +401,20 @@ struct GNUNET_JSON_Specification TALER_JSON_spec_denom_pub (const char *field, struct TALER_DenominationPublicKey *pk); +/** + * Generate a parser specification for a denomination public key of a given + * cipher. + * + * @param field name of the field + * @parm cipher which cipher type to parse for + * @param[out] pk key to fill + * @return corresponding field spec + */ +struct GNUNET_JSON_Specification +TALER_JSON_spec_denom_pub_cipher (const char *field, + const enum TALER_DenominationCipher cipher, + struct TALER_DenominationPublicKey *pk); + /** * Generate line in parser specification for denomination signature. -- cgit v1.2.3