functor for master sigs
This commit is contained in:
parent
77d10ee93c
commit
1e1e5719e5
5 changed files with 87 additions and 115 deletions
|
|
@ -160,7 +160,6 @@ module type SIGNATURE = sig
|
|||
val signf : (string -> EddsaSignature.t) -> r -> t
|
||||
|
||||
(* todo
|
||||
- could have another functor with `verify`'s key set to config's master_public_key
|
||||
- type for unknown/verified signatures? (nk/ok) *)
|
||||
val verify : EddsaPublicKey.t -> t -> r -> (unit, string) result
|
||||
val jsont : t Jsont.t
|
||||
|
|
@ -184,14 +183,9 @@ module MK (R : R) : SIGNATURE with type r := R.r = struct
|
|||
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)
|
||||
let verify = verify Config.Exchange.master_public_key
|
||||
end
|
||||
|
||||
(* ---- *)
|
||||
|
|
@ -315,7 +309,7 @@ module DenominationKeyValidity = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module ExchangeSigningKeyValidity = struct
|
||||
|
|
@ -342,7 +336,7 @@ module ExchangeSigningKeyValidity = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module MasterDenominationKeyRevocation = struct
|
||||
|
|
@ -360,7 +354,7 @@ module MasterDenominationKeyRevocation = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module MasterSigningKeyRevocation = struct
|
||||
|
|
@ -378,7 +372,7 @@ module MasterSigningKeyRevocation = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module MasterAddAuditor = struct
|
||||
|
|
@ -402,7 +396,7 @@ module MasterAddAuditor = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module MasterDelAuditor = struct
|
||||
|
|
@ -423,7 +417,7 @@ module MasterDelAuditor = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module GlobalFees = struct
|
||||
|
|
@ -478,7 +472,7 @@ module GlobalFees = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module MasterWireDetails = struct
|
||||
|
|
@ -516,7 +510,7 @@ module MasterWireDetails = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module MasterAddWire = struct
|
||||
|
|
@ -558,7 +552,7 @@ module MasterAddWire = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module MasterDelWire = struct
|
||||
|
|
@ -579,7 +573,7 @@ module MasterDelWire = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module MasterDrainProfit = struct
|
||||
|
|
@ -607,7 +601,7 @@ module MasterDrainProfit = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module MasterAmlOfficerStatus = struct
|
||||
|
|
@ -633,7 +627,7 @@ module MasterAmlOfficerStatus = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module PartnerConfiguration = struct
|
||||
|
|
@ -672,7 +666,7 @@ module PartnerConfiguration = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module WadPartnerSignature = struct
|
||||
|
|
@ -748,7 +742,7 @@ module MasterWireFee = struct
|
|||
|> sealr
|
||||
end
|
||||
|
||||
include MK (R)
|
||||
include MK_master_sig (R)
|
||||
end
|
||||
|
||||
module ExchangeKeyValidity = struct
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue