diff --git a/src/binary_formats.ml b/src/binary_formats.ml index 50e71f07..6a7dfdfd 100644 --- a/src/binary_formats.ml +++ b/src/binary_formats.ml @@ -95,6 +95,86 @@ module Blinded_coin_hash = MAKE_H (Hash_code) module Coin_pub_hash = MAKE_H (Hash_code) module Output_commitment_hash = MAKE_H (Hash_code) +module Ecdh_ephemeral_public_key_p = struct + type t = { ecdh_pub: string (* = uint8_t ecdh_pub[32] *) } + + let bin = + let open Bin in + record (fun ecdh_pub -> { ecdh_pub }) + |+ field (bytes 32) (fun t -> t.ecdh_pub) + |> sealr +end + +module Reserve_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 Reserve_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 Reserve_signature_p = struct + 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 -- *) module Purpose = struct