This commit is contained in:
parent
dd0ca73005
commit
dc49bb3aaa
1 changed files with 24 additions and 75 deletions
|
|
@ -124,6 +124,8 @@ module DenominationBlindingKeyP = MK_64 ()
|
||||||
See implementation of `TALER_CoinEvHash`
|
See implementation of `TALER_CoinEvHash`
|
||||||
in libtalerexchange for details. *)
|
in libtalerexchange for details. *)
|
||||||
module BlindedCoinHash = MK_64 ()
|
module BlindedCoinHash = MK_64 ()
|
||||||
|
|
||||||
|
(* -- *)
|
||||||
module CoinPubHash = MK_64 ()
|
module CoinPubHash = MK_64 ()
|
||||||
module OutputCommitmentHash = MK_64 ()
|
module OutputCommitmentHash = MK_64 ()
|
||||||
module ReservePublicKeyP = MK_32 ()
|
module ReservePublicKeyP = MK_32 ()
|
||||||
|
|
@ -260,18 +262,6 @@ end
|
||||||
public key. *)
|
public key. *)
|
||||||
module HashPlanchetsP = MK_64 ()
|
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
|
module AgeMask = struct
|
||||||
type t = { mask: int32 }
|
type t = { mask: int32 }
|
||||||
|
|
||||||
|
|
@ -280,62 +270,20 @@ module AgeMask = struct
|
||||||
record (fun mask -> { mask }) |+ field beint32 (fun t -> t.mask) |> sealr
|
record (fun mask -> { mask }) |+ field beint32 (fun t -> t.mask) |> sealr
|
||||||
end
|
end
|
||||||
|
|
||||||
(* TODO TALER doc
|
(* TODO
|
||||||
should be in doc
|
- why is the non-NBO version only used in TALER_WithdrawRequestPS?
|
||||||
found in src/include/taler/taler_amount_lib.h
|
- 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?
|
Currency string, left adjusted and padded with zeros. All zeros
|
||||||
GNUNET_PACKED?
|
for "invalid" values. *)
|
||||||
|
|
||||||
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];
|
|
||||||
};
|
|
||||||
*)
|
|
||||||
let currency_len = 12
|
let currency_len = 12
|
||||||
|
|
||||||
|
(* TODO Taler doc: missing
|
||||||
|
found in src/include/taler/taler_amount_lib.h *)
|
||||||
module Amount = struct
|
module Amount = struct
|
||||||
type t = {
|
type t = {
|
||||||
value: int64;
|
value: int64;
|
||||||
|
|
@ -422,6 +370,17 @@ module WithdrawConfirmationPS = struct
|
||||||
|> sealr
|
|> sealr
|
||||||
end
|
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
|
module SingleWithdrawRequestPS = struct
|
||||||
(* purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW *)
|
(* purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW *)
|
||||||
type t = {
|
type t = {
|
||||||
|
|
@ -903,16 +862,6 @@ module CoinPurseRefundConfirmationPS = struct
|
||||||
}
|
}
|
||||||
end
|
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
|
module SigningKeyAnnouncementPS = struct
|
||||||
(* purpose.purpose = TALER_SIGNATURE_SM_SIGNING_KEY *)
|
(* purpose.purpose = TALER_SIGNATURE_SM_SIGNING_KEY *)
|
||||||
type t = {
|
type t = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue