+ wip add MK_master_sig
This commit is contained in:
parent
37ed47326a
commit
77d10ee93c
2 changed files with 25 additions and 28 deletions
|
|
@ -36,9 +36,9 @@ module Keys_post = struct
|
|||
let verify_dn (module Keys : Keys.S) fdn denom_hash master_sig =
|
||||
let open FutureDenom in
|
||||
let open Signatures.DenominationKeyValidity in
|
||||
let r : r =
|
||||
let r =
|
||||
{
|
||||
master= Config.master_public_key;
|
||||
R.master= Config.master_public_key;
|
||||
start= fdn.stamp_start;
|
||||
expire_withdraw= fdn.stamp_expire_withdraw;
|
||||
expire_spend= fdn.stamp_expire_deposit;
|
||||
|
|
@ -78,9 +78,9 @@ module Keys_post = struct
|
|||
{ key; stamp_start; stamp_expire; stamp_end; signkey_secmod_sig= _ }
|
||||
master_sig =
|
||||
let open Signatures.ExchangeSigningKeyValidity in
|
||||
let r : r =
|
||||
let r =
|
||||
{
|
||||
start= stamp_start;
|
||||
R.start= stamp_start;
|
||||
expire= stamp_expire;
|
||||
end_= stamp_end;
|
||||
signkey_pub= key;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue