diff --git a/src/dune b/src/dune index 5961ab2a..bdb188dd 100644 --- a/src/dune +++ b/src/dune @@ -61,11 +61,11 @@ denomination config_parser config - taler_signatures signatures api) (libraries (re_export b32) + (re_export taler_signature_purpose_codes) ; angstrom fmt diff --git a/src/include/dune b/src/include/dune new file mode 100644 index 00000000..72406e9a --- /dev/null +++ b/src/include/dune @@ -0,0 +1,4 @@ +(library + (name taler_signature_purpose_codes) + (modules taler_signature_purpose_codes) + (libraries)) diff --git a/src/taler_signatures.ml b/src/include/taler_signature_purpose_codes.ml similarity index 100% rename from src/taler_signatures.ml rename to src/include/taler_signature_purpose_codes.ml diff --git a/src/signatures.ml b/src/signatures.ml index 1bd22af7..ba45d7cc 100644 --- a/src/signatures.ml +++ b/src/signatures.ml @@ -1,3 +1,4 @@ +module Taler_purpose = Taler_signature_purpose_codes open Time open Hash @@ -231,8 +232,7 @@ module DenominationKeyAnnouncement = struct let bin = let open Bin in - Purpose.make_bin Taler_signatures.sm_rsa_denomination_key - @@ fun purpose -> + Purpose.make_bin Taler_purpose.sm_rsa_denomination_key @@ fun purpose -> record (fun _purpose h_denom_pub h_section_name anchor_time duration_withdraw -> @@ -259,7 +259,7 @@ module SigningKeyAnnouncement = struct let bin = let open Bin in - Purpose.make_bin Taler_signatures.sm_signing_key @@ fun purpose -> + Purpose.make_bin Taler_purpose.sm_signing_key @@ fun purpose -> record (fun _purpose exchange_pub anchor_time duration -> { exchange_pub; anchor_time; duration }) |+ Purpose.field purpose @@ -292,7 +292,7 @@ module DenominationKeyValidity = struct let bin = let open Bin in - Purpose.make_bin Taler_signatures.master_denomination_key_validity + Purpose.make_bin Taler_purpose.master_denomination_key_validity @@ fun purpose -> record (fun @@ -352,7 +352,7 @@ module ExchangeSigningKeyValidity = struct let bin = let open Bin in - Purpose.make_bin Taler_signatures.master_signing_key_validity + Purpose.make_bin Taler_purpose.master_signing_key_validity @@ fun purpose -> record (fun _purpose start expire end_ signkey_pub -> { start; expire; end_; signkey_pub }) @@ -374,7 +374,7 @@ module MasterDenominationKeyRevocation = struct let bin = let open Bin in - Purpose.make_bin Taler_signatures.master_denomination_key_revoked + Purpose.make_bin Taler_purpose.master_denomination_key_revoked @@ fun purpose -> record (fun _purpose h_denom_pub -> { h_denom_pub }) |+ Purpose.field purpose @@ -392,7 +392,7 @@ module MasterSigningKeyRevocation = struct let bin = let open Bin in - Purpose.make_bin Taler_signatures.master_signing_key_revoked + Purpose.make_bin Taler_purpose.master_signing_key_revoked @@ fun purpose -> record (fun _purpose exchange_pub -> { exchange_pub }) |+ Purpose.field purpose @@ -414,7 +414,7 @@ module MasterAddAuditor = struct let bin = let open Bin in - Purpose.make_bin Taler_signatures.master_add_auditor @@ fun purpose -> + Purpose.make_bin Taler_purpose.master_add_auditor @@ fun purpose -> record (fun _purpose start_date auditor_pub h_auditor_url -> { start_date; auditor_pub; h_auditor_url }) |+ Purpose.field purpose @@ -437,7 +437,7 @@ module MasterDelAuditor = struct let bin = let open Bin in - Purpose.make_bin Taler_signatures.master_del_auditor @@ fun purpose -> + Purpose.make_bin Taler_purpose.master_del_auditor @@ fun purpose -> record (fun _purpose end_date auditor_pub -> { end_date; auditor_pub }) |+ Purpose.field purpose |+ field Timestamp.bin (fun t -> t.end_date) @@ -465,7 +465,7 @@ module GlobalFees = struct let bin = let open Bin in - Purpose.make_bin Taler_signatures.master_global_fees @@ fun purpose -> + Purpose.make_bin Taler_purpose.master_global_fees @@ fun purpose -> record (fun _purpose @@ -515,7 +515,7 @@ module MasterWireDetails = struct let bin = let open Bin in - Purpose.make_bin Taler_signatures.master_wire_details @@ fun purpose -> + Purpose.make_bin Taler_purpose.master_wire_details @@ fun purpose -> record (fun _purpose @@ -554,7 +554,7 @@ module MasterAddWire = struct let bin = let open Bin in - Purpose.make_bin Taler_signatures.master_add_wire @@ fun _purpose -> + Purpose.make_bin Taler_purpose.master_add_wire @@ fun _purpose -> record (fun _purpose @@ -593,7 +593,7 @@ module MasterDelWire = struct let bin = let open Bin in - Purpose.make_bin Taler_signatures.master_del_wire @@ fun _purpose -> + Purpose.make_bin Taler_purpose.master_del_wire @@ fun _purpose -> record (fun _purpose end_date h_wire -> { end_date; h_wire }) |+ Purpose.field _purpose |+ field Timestamp.bin (fun t -> t.end_date) @@ -617,7 +617,7 @@ module MasterDrainProfit = struct let bin = let open Bin in - Purpose.make_bin Taler_signatures.master_drain_profit @@ fun _purpose -> + Purpose.make_bin Taler_purpose.master_drain_profit @@ fun _purpose -> record (fun _purpose wtid date amount h_section h_payto -> { wtid; date; amount; h_section; h_payto }) |+ Purpose.field _purpose @@ -644,7 +644,7 @@ module MasterAmlOfficerStatus = struct let bin = let open Bin in - Purpose.make_bin Taler_signatures.master_aml_key @@ fun _purpose -> + Purpose.make_bin Taler_purpose.master_aml_key @@ fun _purpose -> record (fun _purpose change_date officer_pub h_officer_name is_active -> { change_date; officer_pub; h_officer_name; is_active }) |+ Purpose.field _purpose @@ -672,8 +672,7 @@ module PartnerConfiguration = struct let bin = let open Bin in - Purpose.make_bin Taler_signatures.master_partner_details - @@ fun _purpose -> + Purpose.make_bin Taler_purpose.master_partner_details @@ fun _purpose -> record (fun _purpose @@ -711,8 +710,7 @@ module WadPartnerSignature = struct let bin = let open Bin in - Purpose.make_bin Taler_signatures.master_partner_details - @@ fun _purpose -> + Purpose.make_bin Taler_purpose.master_partner_details @@ fun _purpose -> record (fun _purpose @@ -757,7 +755,7 @@ module MasterWireFee = struct let bin = let open Bin in - Purpose.make_bin Taler_signatures.master_wire_fees @@ fun _purpose -> + Purpose.make_bin Taler_purpose.master_wire_fees @@ fun _purpose -> record (fun _purpose h_wire_method start_date end_date wire_fee closing_fee -> { h_wire_method; start_date; end_date; wire_fee; closing_fee }) @@ -792,7 +790,7 @@ module ExchangeKeyValidity = struct let bin = let open Bin in - Purpose.make_bin Taler_signatures.auditor_exchange_keys @@ fun _purpose -> + Purpose.make_bin Taler_purpose.auditor_exchange_keys @@ fun _purpose -> record (fun _purpose @@ -850,7 +848,7 @@ module ExchangeKeySet = struct let bin = let open Bin in - Purpose.make_bin Taler_signatures.exchange_key_set @@ fun _purpose -> + Purpose.make_bin Taler_purpose.exchange_key_set @@ fun _purpose -> record (fun _purpose list_issue_date hc -> { list_issue_date; hc }) |+ Purpose.field _purpose |+ field Timestamp.bin (fun t -> t.list_issue_date) @@ -876,7 +874,7 @@ module WithdrawRequest = struct let bin = let open Bin in - Purpose.make_bin Taler_signatures.wallet_reserve_withdraw @@ fun purpose -> + Purpose.make_bin Taler_purpose.wallet_reserve_withdraw @@ fun purpose -> record (fun _purpose amount fee h_planchets blinding_seed max_age_group mask -> { amount; fee; h_planchets; blinding_seed; max_age_group; mask }) @@ -899,8 +897,7 @@ module WithdrawConfirmation = struct let bin = let open Bin in - Purpose.make_bin Taler_signatures.exchange_confirm_withdraw - @@ fun purpose -> + Purpose.make_bin Taler_purpose.exchange_confirm_withdraw @@ fun purpose -> record (fun _purpose h_planchets noreveal_index -> { h_planchets; noreveal_index }) |+ Purpose.field purpose