use Jsont.Error for unsupported CS denom + wip type binary signature

This commit is contained in:
swrup 2025-11-30 22:44:36 +01:00
parent 4568b1bd4c
commit eb56150120
6 changed files with 66 additions and 45 deletions

View file

@ -19,20 +19,12 @@ let denom_signature ~master_key
(* TODO check sigs *)
denom_secmod_sig= _;
} =
let pub_octets =
let denom_pub =
match denom_pub with
| Rsa v -> v
| CS _ -> Fmt.failwith "CS key types are not supported."
in
let pub = denom_pub.RsaDenominationKey.rsa_pub in
RsaPublicKey.to_octets pub
in
let h_denom_pub = HashCode.hash pub_octets in
let octets = DenominationKey.to_octets denom_pub in
let h_denom_pub = HashCode.hash octets in
let master_sig =
let open Bin_signature.DenominationKeyValidityPS in
let master = EddsaPrivateKey.(pub_of_priv master_key) in
let denom_hash = DenominationHash.hash pub_octets in
let denom_hash = DenominationHash.hash octets in
{
master;
start= stamp_start;