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 |> Jsont.Object.finish
end 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 module DenominationKey = struct
open DenominationKey open DenominationKey
let rsa v = Rsa v let rsa v = Rsa v
let cs v = CS v let cs _v = Fmt.failwith "CS denomination not implemented"
let jsont = let jsont =
let open Jsont.Object in let open Jsont.Object in
let rsa = Case.map "RSA" RsaDenominationKey.jsont ~dec:rsa 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 let enc_case = function
| Rsa v -> Case.value rsa v | Rsa v -> Case.value rsa v
| CS v -> Case.value cs v | CS v -> Case.value cs v

View file

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