This commit is contained in:
swrup 2025-10-17 17:14:27 +02:00
parent c68f7db1a6
commit bc9abec87a
2 changed files with 8 additions and 30 deletions

View file

@ -86,29 +86,16 @@ module RsaDenominationKey = struct
|> Jsont.Object.finish
end
module CSDenominationKey = struct
open CSDenominationKey
let jsont =
let make age_mask cs_pub = { age_mask; cs_pub } in
let age_mask v = v.age_mask in
let cs_pub v = v.cs_pub in
Jsont.Object.map ~kind:"CSDenominationKey" make
|> Jsont.Object.mem "age_mask" Jsont.int ~enc:age_mask
|> Jsont.Object.mem "cs_pub" Jsont.string ~enc:cs_pub
|> Jsont.Object.finish
end
module DenominationKey = struct
open DenominationKey
let rsa v = Rsa v
let cs v = CS v
let cs _v = Fmt.failwith "CS denomination not implemented"
let jsont =
let open Jsont.Object in
let rsa = Case.map "RSA" RsaDenominationKey.jsont ~dec:rsa in
let cs = Case.map "CS" CSDenominationKey.jsont ~dec:cs in
let cs = Case.map "CS" Jsont.string ~dec:cs in
let enc_case = function
| Rsa v -> Case.value rsa v
| CS v -> Case.value cs v

View file

@ -30,6 +30,10 @@ module Config_types = struct
end
end
module HashCode = struct
type t = string
end
(* https://docs.taler.net/core/api-common.html#tsref-type-ErrorDetail *)
module ErrorDetail = struct
(* TODO GANA error codes
@ -162,11 +166,6 @@ end = struct
let jsont = Jsont.of_of_string ~kind:"RsaSignature" of_b32 ~enc:to_b32
end
module HashCode = struct
(* 32-byte value representing a point on Curve25519. *)
type cs25519Point = string
end
module RsaDenominationKey = struct
type t = {
age_mask: int;
@ -174,19 +173,11 @@ module RsaDenominationKey = struct
}
end
(* not implemented *)
module CSDenominationKey = struct
(* Clause Schnorr *)
type t = {
age_mask: int;
cs_pub: string;
}
end
module DenominationKey = struct
type t =
| Rsa of RsaDenominationKey.t
| CS of CSDenominationKey.t
(* not implemented: *)
| CS of string
end
module FutureSignKey = struct