This commit is contained in:
swrup 2025-10-07 01:02:50 +02:00
parent f20bb80fc8
commit ef6a208273

View file

@ -59,69 +59,41 @@ module Short_hash_code = struct
record (fun hash -> { hash }) |+ field (bytes 32) (fun t -> t.hash) |> sealr record (fun hash -> { hash }) |+ field (bytes 32) (fun t -> t.hash) |> sealr
end end
module Denomination_hash = struct module MAKE_H (H : sig
type t = { hash: Hash_code.t } type t
val bin : t Bin.t
end) =
struct
type t = { hash: H.t }
let bin = let bin =
let open Bin in let open Bin in
record (fun hash -> { hash }) record (fun hash -> { hash }) |+ field H.bin (fun t -> t.hash) |> sealr
|+ field Hash_code.bin (fun t -> t.hash)
|> sealr
end end
module Private_contract_hash = struct module Denomination_hash = MAKE_H (Hash_code)
type t = { hash: Hash_code.t } module Private_contract_hash = MAKE_H (Hash_code)
module Extensions_policy_hash = MAKE_H (Hash_code)
module Merchant_wire_hash = MAKE_H (Hash_code)
let bin =
let open Bin in
record (fun hash -> { hash })
|+ field Hash_code.bin (fun t -> t.hash)
|> sealr
end
module Extensions_policy_hash = struct
type t = { hash: Hash_code.t }
let bin =
let open Bin in
record (fun hash -> { hash })
|+ field Hash_code.bin (fun t -> t.hash)
|> sealr
end
module Merchant_wire_hash = struct
type t = { hash: Hash_code.t }
let bin =
let open Bin in
record (fun hash -> { hash })
|+ field Hash_code.bin (fun t -> t.hash)
|> sealr
end
module Full_payto_hash = struct
(* Hash over a full payto://-URI, including receiver-name (* Hash over a full payto://-URI, including receiver-name
(and possibly BIC and other optional fields). *) (and possibly BIC and other optional fields). *)
type t = { hash: Short_hash_code.t } module Full_payto_hash = MAKE_H (Short_hash_code)
let bin =
let open Bin in
record (fun hash -> { hash })
|+ field Short_hash_code.bin (fun t -> t.hash)
|> sealr
end
module Normalized_payto_hash = struct
(* Hash over a normalized payto://-URI, including all optional (* Hash over a normalized payto://-URI, including all optional
fields and also with account-part canonicalized (so no BIC). *) fields and also with account-part canonicalized (so no BIC). *)
type t = { hash: Short_hash_code.t } module Normalized_payto_hash = MAKE_H (Short_hash_code)
let bin = (* Hash over:
let open Bin in a) the hash of the denomination's public key,
record (fun hash -> { hash }) b) an enum value identifying the cipher, and
|+ field Short_hash_code.bin (fun t -> t.hash) c) cipher-dependant blinded information.
|> sealr See implementation of `TALER_coin_ev_hash`
end in libtalerexchange for details. *)
module Blinded_coin_hash = MAKE_H (Hash_code)
module Coin_pub_hash = MAKE_H (Hash_code)
module Output_commitment_hash = MAKE_H (Hash_code)
(* -- Signatures -- *) (* -- Signatures -- *)