This commit is contained in:
parent
cf20d60bb6
commit
85e6bdc9ed
2 changed files with 4 additions and 11 deletions
|
|
@ -69,14 +69,12 @@ module HashCode : sig
|
||||||
type t
|
type t
|
||||||
|
|
||||||
val hash : string -> t
|
val hash : string -> t
|
||||||
val to_octets : t -> string
|
val to_denomination_hash : t -> Bin_type.DenominationHash.t
|
||||||
val jsont : t Jsont.t
|
val jsont : t Jsont.t
|
||||||
end = struct
|
end = struct
|
||||||
type t = B32.t
|
type t = B32.t
|
||||||
|
|
||||||
(* TODO rm
|
let to_denomination_hash s = Bin_type.DenominationHash.of_octets s
|
||||||
for convertion to DenominationHash *)
|
|
||||||
let to_octets s = s
|
|
||||||
|
|
||||||
let hash s =
|
let hash s =
|
||||||
let open Digestif.SHA512 in
|
let open Digestif.SHA512 in
|
||||||
|
|
|
||||||
|
|
@ -99,9 +99,7 @@ let mk_future_keys_response ~(sm_signkey : Secmod_signkey.t)
|
||||||
let verify_denom_signature ~sm_denom DenomSignature.{ h_denom_pub; master_sig }
|
let verify_denom_signature ~sm_denom DenomSignature.{ h_denom_pub; master_sig }
|
||||||
=
|
=
|
||||||
let open Syntax in
|
let open Syntax in
|
||||||
let denom_hash =
|
let denom_hash = HashCode.to_denomination_hash h_denom_pub in
|
||||||
Bin_type.DenominationHash.of_octets (HashCode.to_octets h_denom_pub)
|
|
||||||
in
|
|
||||||
let* denom =
|
let* denom =
|
||||||
Secmod_denom.get_denoms sm_denom
|
Secmod_denom.get_denoms sm_denom
|
||||||
|> List.find_opt (fun (denom : Denomination.t) -> denom.h_pub = denom_hash)
|
|> List.find_opt (fun (denom : Denomination.t) -> denom.h_pub = denom_hash)
|
||||||
|
|
@ -172,10 +170,7 @@ let update_master_signatures ~db_conn ~sm_signkey ~sm_denom
|
||||||
let* () =
|
let* () =
|
||||||
denom_sigs
|
denom_sigs
|
||||||
|> List.map (fun DenomSignature.{ h_denom_pub; master_sig } ->
|
|> List.map (fun DenomSignature.{ h_denom_pub; master_sig } ->
|
||||||
(* TODO better denomination-hash type *)
|
let h_denom_pub = HashCode.to_denomination_hash h_denom_pub in
|
||||||
let h_denom_pub =
|
|
||||||
Bin_type.DenominationHash.of_octets (HashCode.to_octets h_denom_pub)
|
|
||||||
in
|
|
||||||
(h_denom_pub, master_sig))
|
(h_denom_pub, master_sig))
|
||||||
|> Secmod_denom.add_master_signatures db_conn sm_denom
|
|> Secmod_denom.add_master_signatures db_conn sm_denom
|
||||||
in
|
in
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue