This commit is contained in:
swrup 2025-10-07 01:34:16 +02:00
parent f61be975ec
commit 514f40ffa4

View file

@ -95,6 +95,57 @@ module Blinded_coin_hash = MAKE_H (Hash_code)
module Coin_pub_hash = MAKE_H (Hash_code) module Coin_pub_hash = MAKE_H (Hash_code)
module Output_commitment_hash = MAKE_H (Hash_code) module Output_commitment_hash = MAKE_H (Hash_code)
module MAKE_EDDSA_PUB () = struct
type t = { eddsa_pub: string }
let bin =
let open Bin in
record (fun eddsa_pub -> { eddsa_pub })
|+ field (bytes 32) (fun t -> t.eddsa_pub)
|> sealr
end
module MAKE_EDDSA_PRIV () = struct
type t = { eddsa_priv: string }
let bin =
let open Bin in
record (fun eddsa_priv -> { eddsa_priv })
|+ field (bytes 32) (fun t -> t.eddsa_priv)
|> sealr
end
module MAKE_EDDSA_SIG () = struct
(* 64 bytes *)
type t = { eddsa_signature: string }
let bin =
let open Bin in
record (fun eddsa_signature -> { eddsa_signature })
|+ field (bytes 64) (fun t -> t.eddsa_signature)
|> sealr
end
module MAKE_ECDHE_PUB () = struct
type t = { ecdhe_pub: string }
let bin =
let open Bin in
record (fun ecdhe_pub -> { ecdhe_pub })
|+ field (bytes 32) (fun t -> t.ecdhe_pub)
|> sealr
end
module MAKE_ECDHE_PRIV () = struct
type t = { ecdhe_priv: string }
let bin =
let open Bin in
record (fun ecdhe_priv -> { ecdhe_priv })
|+ field (bytes 32) (fun t -> t.ecdhe_priv)
|> sealr
end
module Ecdh_ephemeral_public_key_p = struct module Ecdh_ephemeral_public_key_p = struct
type t = { ecdh_pub: string (* = uint8_t ecdh_pub[32] *) } type t = { ecdh_pub: string (* = uint8_t ecdh_pub[32] *) }
@ -105,75 +156,30 @@ module Ecdh_ephemeral_public_key_p = struct
|> sealr |> sealr
end end
module Reserve_public_key_p = struct module Reserve_public_key_p = MAKE_EDDSA_PUB ()
type t = { eddsa_pub: string } module Reserve_private_key_p = MAKE_EDDSA_PRIV ()
module Reserve_signature_p = MAKE_EDDSA_SIG ()
module Merchant_public_key_p = MAKE_EDDSA_PUB ()
module Merchant_private_key_p = MAKE_EDDSA_PRIV ()
(*module Merchant_signature_p = MAKE_EDDSA_SIG ()*)
let bin = module Transfert_public_key_p = MAKE_ECDHE_PUB ()
let open Bin in module Transfert_private_key_p = MAKE_ECDHE_PRIV ()
record (fun eddsa_pub -> { eddsa_pub })
|+ field (bytes 32) (fun t -> t.eddsa_pub)
|> sealr
end
module Reserve_private_key_p = struct (*
type t = { eddsa_priv: string } enum TALER_AmlDecisionState {
NORMAL, PENDING, FROZEN
};
*)
let bin = module Aml_officer_public_key_p = MAKE_EDDSA_PUB ()
let open Bin in module Aml_officer_private_key_p = MAKE_EDDSA_PRIV ()
record (fun eddsa_priv -> { eddsa_priv }) module Exchange_public_key_p = MAKE_EDDSA_PUB ()
|+ field (bytes 32) (fun t -> t.eddsa_priv) module Exchange_private_key_p = MAKE_EDDSA_PRIV ()
|> sealr module Exchange_signature_p = MAKE_EDDSA_SIG ()
end module Master_public_key_p = MAKE_EDDSA_PUB ()
module Master_private_key_p = MAKE_EDDSA_PRIV ()
module Reserve_signature_p = struct module Master_signature_p = MAKE_EDDSA_SIG ()
type t = { eddsa_signature: string }
let bin =
let open Bin in
record (fun eddsa_signature -> { eddsa_signature })
|+ field (bytes 64) (fun t -> t.eddsa_signature)
|> sealr
end
module Merchant_public_key_p = struct
type t = { eddsa_pub: string }
let bin =
let open Bin in
record (fun eddsa_pub -> { eddsa_pub })
|+ field (bytes 32) (fun t -> t.eddsa_pub)
|> sealr
end
module Merchant_private_key_p = struct
type t = { eddsa_priv: string }
let bin =
let open Bin in
record (fun eddsa_priv -> { eddsa_priv })
|+ field (bytes 32) (fun t -> t.eddsa_priv)
|> sealr
end
module Transfert_public_key_p = struct
type t = { ecdhe_pub: string }
let bin =
let open Bin in
record (fun ecdhe_pub -> { ecdhe_pub })
|+ field (bytes 32) (fun t -> t.ecdhe_pub)
|> sealr
end
module Transfert_private_key_p = struct
type t = { ecdhe_priv: string }
let bin =
let open Bin in
record (fun ecdhe_priv -> { ecdhe_priv })
|+ field (bytes 32) (fun t -> t.ecdhe_priv)
|> sealr
end
(* -- Signatures -- *) (* -- Signatures -- *)