From 258db38b5251dd54e4b884b69dacd8117e9d007a Mon Sep 17 00:00:00 2001 From: swrup Date: Thu, 5 Feb 2026 17:54:39 +0100 Subject: [PATCH] wip ~ --- src/hash.ml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/hash.ml b/src/hash.ml index 0fbdd01a..0776027b 100644 --- a/src/hash.ml +++ b/src/hash.ml @@ -8,7 +8,7 @@ open Digestif -module Hash_32 = struct +module H32 = struct type t = SHA256.t let hash s = SHA256.(digest_string s) @@ -38,7 +38,7 @@ module Hash_32 = struct Jsont.of_of_string ~kind:"Hash 32" of_b32 ~enc end -module Hash_64 = struct +module H64 = struct type t = SHA512.t let hash s = SHA512.(digest_string s) @@ -74,16 +74,16 @@ module Hash_64 = struct end (* Hash over string + '\0' *) -module Hash_32_cstr = struct - include Hash_32 +module H32_cstr = struct + include H32 let hash s = let s = s ^ "\x00" in SHA256.(digest_string s) end -module Hash_64_cstr = struct - include Hash_64 +module H64_cstr = struct + include H64 let hash s = let s = s ^ "\x00" in @@ -102,14 +102,14 @@ module type Hash_S = sig val of_b32 : B32.t -> (t, string) result end -module FullPaytoHash : Hash_S = Hash_32 -module NormalizedPaytoHash : Hash_S = Hash_32 -module DenominationHash : Hash_S = Hash_64 -module PrivateContractHash : Hash_S = Hash_64 -module ExtensionsPolicyHash : Hash_S = Hash_64 -module MerchantWireHash : Hash_S = Hash_64 -module AgeCommitmentHash : Hash_S = Hash_64 -module BlindedCoinHash : Hash_S = Hash_64 -module CoinPubHash : Hash_S = Hash_64 -module OutputCommitmentHash : Hash_S = Hash_64 -module HashPlanchetsP : Hash_S = Hash_64 +module FullPaytoHash : Hash_S = H32 +module NormalizedPaytoHash : Hash_S = H32 +module DenominationHash : Hash_S = H64 +module PrivateContractHash : Hash_S = H64 +module ExtensionsPolicyHash : Hash_S = H64 +module MerchantWireHash : Hash_S = H64 +module AgeCommitmentHash : Hash_S = H64 +module BlindedCoinHash : Hash_S = H64 +module CoinPubHash : Hash_S = H64 +module OutputCommitmentHash : Hash_S = H64 +module HashPlanchetsP : Hash_S = H64