This commit is contained in:
parent
f20bb80fc8
commit
ef6a208273
1 changed files with 27 additions and 55 deletions
|
|
@ -59,69 +59,41 @@ module Short_hash_code = struct
|
|||
record (fun hash -> { hash }) |+ field (bytes 32) (fun t -> t.hash) |> sealr
|
||||
end
|
||||
|
||||
module Denomination_hash = struct
|
||||
type t = { hash: Hash_code.t }
|
||||
module MAKE_H (H : sig
|
||||
type t
|
||||
|
||||
val bin : t Bin.t
|
||||
end) =
|
||||
struct
|
||||
type t = { hash: H.t }
|
||||
|
||||
let bin =
|
||||
let open Bin in
|
||||
record (fun hash -> { hash })
|
||||
|+ field Hash_code.bin (fun t -> t.hash)
|
||||
|> sealr
|
||||
record (fun hash -> { hash }) |+ field H.bin (fun t -> t.hash) |> sealr
|
||||
end
|
||||
|
||||
module Private_contract_hash = struct
|
||||
type t = { hash: Hash_code.t }
|
||||
module Denomination_hash = MAKE_H (Hash_code)
|
||||
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
|
||||
(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
|
||||
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 =
|
||||
let open Bin in
|
||||
record (fun hash -> { hash })
|
||||
|+ field Short_hash_code.bin (fun t -> t.hash)
|
||||
|> sealr
|
||||
end
|
||||
(* Hash over:
|
||||
a) the hash of the denomination's public key,
|
||||
b) an enum value identifying the cipher, and
|
||||
c) cipher-dependant blinded information.
|
||||
See implementation of `TALER_coin_ev_hash`
|
||||
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 -- *)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue