+ wip add MK_master_sig

This commit is contained in:
swrup 2026-02-21 21:32:18 +01:00
parent 37ed47326a
commit 77d10ee93c
2 changed files with 25 additions and 28 deletions

View file

@ -145,14 +145,16 @@ end
(* --- Packed Signatures --- *)
module MK (R : sig
module type R = sig
type r
val bin : r Bin.t
end) : sig
end
module type SIGNATURE = sig
open Crypto
type r = R.r
type r
type t
val signf : (string -> EddsaSignature.t) -> r -> t
@ -166,10 +168,11 @@ end) : sig
(* escape hatch, only needed for /keys `exchange_sig` (signature over contatentation of all of the master_sigs) *)
val to_octets : t -> string
end = struct
end
module MK (R : R) : SIGNATURE with type r := R.r = struct
open Crypto
type r = R.r
type t = EddsaSignature.t
let to_string = Bin.to_string R.bin
@ -180,6 +183,19 @@ end = struct
let to_octets t = EddsaSignature.to_octets t
end
module MK_master_sig (R : R) = struct
open Crypto
include MK (R)
let to_string = Bin.to_string R.bin
let verify t r =
EddsaSignature.verify ~key:Config.Exchange.master_public_key t
~msg:(to_string r)
end
(* ---- *)
module DenominationKeyAnnouncement = struct
module R = struct
(* CS: use purpose TALER_SIGNATURE_SM_CS_DENOMINATION_KEY *)
@ -207,7 +223,6 @@ module DenominationKeyAnnouncement = struct
|> sealr
end
include R
include MK (R)
end
@ -232,7 +247,6 @@ module SigningKeyAnnouncement = struct
|> sealr
end
include R
include MK (R)
end
@ -301,7 +315,6 @@ module DenominationKeyValidity = struct
|> sealr
end
include R
include MK (R)
end
@ -329,7 +342,6 @@ module ExchangeSigningKeyValidity = struct
|> sealr
end
include R
include MK (R)
end
@ -348,7 +360,6 @@ module MasterDenominationKeyRevocation = struct
|> sealr
end
include R
include MK (R)
end
@ -367,7 +378,6 @@ module MasterSigningKeyRevocation = struct
|> sealr
end
include R
include MK (R)
end
@ -392,7 +402,6 @@ module MasterAddAuditor = struct
|> sealr
end
include R
include MK (R)
end
@ -414,7 +423,6 @@ module MasterDelAuditor = struct
|> sealr
end
include R
include MK (R)
end
@ -470,7 +478,6 @@ module GlobalFees = struct
|> sealr
end
include R
include MK (R)
end
@ -509,7 +516,6 @@ module MasterWireDetails = struct
|> sealr
end
include R
include MK (R)
end
@ -552,7 +558,6 @@ module MasterAddWire = struct
|> sealr
end
include R
include MK (R)
end
@ -574,7 +579,6 @@ module MasterDelWire = struct
|> sealr
end
include R
include MK (R)
end
@ -603,7 +607,6 @@ module MasterDrainProfit = struct
|> sealr
end
include R
include MK (R)
end
@ -630,7 +633,6 @@ module MasterAmlOfficerStatus = struct
|> sealr
end
include R
include MK (R)
end
@ -670,7 +672,6 @@ module PartnerConfiguration = struct
|> sealr
end
include R
include MK (R)
end
@ -718,7 +719,6 @@ module WadPartnerSignature = struct
|> sealr
end
include R
include MK (R)
end
@ -748,7 +748,6 @@ module MasterWireFee = struct
|> sealr
end
include R
include MK (R)
end
@ -815,7 +814,6 @@ module ExchangeKeyValidity = struct
|> sealr
end
include R
include MK (R)
end
@ -838,7 +836,6 @@ module ExchangeKeySet = struct
|> sealr
end
include R
include MK (R)
end