diff --git a/src/binary_formats.ml b/src/binary_formats.ml index 8b1a7f7d..120f6839 100644 --- a/src/binary_formats.ml +++ b/src/binary_formats.ml @@ -124,6 +124,8 @@ module DenominationBlindingKeyP = MK_64 () See implementation of `TALER_CoinEvHash` in libtalerexchange for details. *) module BlindedCoinHash = MK_64 () + +(* -- *) module CoinPubHash = MK_64 () module OutputCommitmentHash = MK_64 () module ReservePublicKeyP = MK_32 () @@ -260,18 +262,6 @@ end public key. *) module HashPlanchetsP = MK_64 () -(* Binary representation of the age groups. - The bits set in the mask mark the edges at the beginning of a next age - group. F.e. for the age groups - 0-7, 8-9, 10-11, 12-13, 14-15, 16-17, 18-20, 21-* - the following bits are set: - - 31 24 16 8 0 - | | | | | - oooooooo oo1oo1o1 o1o1o1o1 ooooooo1 - - A value of 0 means that the exchange does not support the extension for - age-restriction. *) module AgeMask = struct type t = { mask: int32 } @@ -280,62 +270,20 @@ module AgeMask = struct record (fun mask -> { mask }) |+ field beint32 (fun t -> t.mask) |> sealr end -(* TODO TALER doc - should be in doc - found in src/include/taler/taler_amount_lib.h +(* TODO + - why is the non-NBO version only used in TALER_WithdrawRequestPS? + - GNUNET_PACKED? *) +(* Number of characters (plus 1 for 0-termination) for currency names. + typically an ISO 4217 currency code when an alphanumeric 3-digit code is used. + For regional currencies, the first character should be a "*" followed + by a region-specific name (i.e. "*BRETAGNEFR"). - why is the non-NBO version only used in TALER_WithdrawRequestPS? - GNUNET_PACKED? - - can be set to "invalid" if currency = all 0 *) -(* -/** - * @brief Number of characters (plus 1 for 0-termination) we use to - * represent currency names (i.e. EUR, USD, etc.). We use 8+4 for - * alignment in the `struct TALER_Amount`. The amount is typically an - * ISO 4217 currency code when an alphanumeric 3-digit code is used. - * For regional currencies, the first character should be a "*" followed - * by a region-specific name (i.e. "*BRETAGNEFR"). - */ -struct TALER_AmountNBO -{ - /** - * Value in the main currency, in NBO. - */ - uint64t value GNUNET_PACKED; - - /** - * Fraction (integer multiples of #TALER_AMOUNT_FRAC_BASE), in NBO. - */ - uint32t fraction GNUNET_PACKED; - - /** - * Type of the currency being represented. - */ - char currency[TALER_CURRENCY_LEN]; -}; - -struct TALER_Amount -{ - /** - * Value (numerator of fraction) - */ - uint64t value; - - /** - * Fraction (integer multiples of #TALER_AMOUNT_FRAC_BASE). - */ - uint32t fraction; - - /** - * Currency string, left adjusted and padded with zeros. All zeros - * for "invalid" values. - */ - char currency[TALER_CURRENCY_LEN]; -}; -*) + Currency string, left adjusted and padded with zeros. All zeros + for "invalid" values. *) let currency_len = 12 +(* TODO Taler doc: missing + found in src/include/taler/taler_amount_lib.h *) module Amount = struct type t = { value: int64; @@ -422,6 +370,17 @@ module WithdrawConfirmationPS = struct |> sealr end +module DenominationKeyAnnouncementPS = struct + (* purpose.purpose = TALER_SIGNATURE_SM_DENOMINATION_KEY *) + type t = { + h_denom_pub: DenominationHash.t; + h_section_name: HashCode.t; + anchor_time: TimeAbsoluteNBO.t; + duration_withdraw: TimeRelativeNBO.t; + } + (* TODO management *) +end + module SingleWithdrawRequestPS = struct (* purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW *) type t = { @@ -903,16 +862,6 @@ module CoinPurseRefundConfirmationPS = struct } end -module DenominationKeyAnnouncementPS = struct - (* purpose.purpose = TALER_SIGNATURE_SM_DENOMINATION_KEY *) - type t = { - h_denom_pub: DenominationHash.t; - h_section_name: HashCode.t; - anchor_time: TimeAbsoluteNBO.t; - duration_withdraw: TimeRelativeNBO.t; - } -end - module SigningKeyAnnouncementPS = struct (* purpose.purpose = TALER_SIGNATURE_SM_SIGNING_KEY *) type t = {