2018-04-05 19:35:35 +04:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* Copyright (c) 2014 - 2018. *)
|
|
|
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
|
|
|
type public_key_hash =
|
|
|
|
| Ed25519 of Ed25519.Public_key_hash.t
|
|
|
|
| Secp256k1 of Secp256k1.Public_key_hash.t
|
2018-06-05 21:27:58 +04:00
|
|
|
| P256 of P256.Public_key_hash.t
|
2018-04-05 19:35:35 +04:00
|
|
|
|
|
|
|
type public_key =
|
|
|
|
| Ed25519 of Ed25519.Public_key.t
|
|
|
|
| Secp256k1 of Secp256k1.Public_key.t
|
2018-06-05 21:27:58 +04:00
|
|
|
| P256 of P256.Public_key.t
|
2018-04-05 19:35:35 +04:00
|
|
|
|
|
|
|
type secret_key =
|
|
|
|
| Ed25519 of Ed25519.Secret_key.t
|
|
|
|
| Secp256k1 of Secp256k1.Secret_key.t
|
2018-06-05 21:27:58 +04:00
|
|
|
| P256 of P256.Secret_key.t
|
2018-04-05 19:35:35 +04:00
|
|
|
|
2018-05-25 17:50:31 +04:00
|
|
|
type watermark =
|
|
|
|
| Block_header
|
|
|
|
| Endorsement
|
|
|
|
| Generic_operation
|
|
|
|
| Custom of MBytes.t
|
|
|
|
|
|
|
|
val bytes_of_watermark: watermark -> MBytes.t
|
|
|
|
|
2018-04-05 19:35:35 +04:00
|
|
|
include S.SIGNATURE with type Public_key_hash.t = public_key_hash
|
|
|
|
and type Public_key.t = public_key
|
|
|
|
and type Secret_key.t = secret_key
|
2018-05-25 17:50:31 +04:00
|
|
|
and type watermark := watermark
|
2018-04-05 19:35:35 +04:00
|
|
|
|
2018-05-25 17:50:31 +04:00
|
|
|
val append : ?watermark:watermark -> secret_key -> MBytes.t -> MBytes.t
|
2018-04-20 13:27:13 +04:00
|
|
|
(** [append sk buf] is the concatenation of [buf] and the
|
|
|
|
serialization of the signature of [buf] signed by [sk]. *)
|
|
|
|
|
|
|
|
val concat : MBytes.t -> t -> MBytes.t
|
|
|
|
(** [concat buf t] is the concatenation of [buf] and the serialization
|
|
|
|
of [t]. *)
|
|
|
|
|
2018-04-05 19:35:35 +04:00
|
|
|
include S.RAW_DATA with type t := t
|
|
|
|
|
2018-05-30 20:03:23 +04:00
|
|
|
val of_secp256k1 : Secp256k1.t -> t
|
|
|
|
val of_ed25519 : Ed25519.t -> t
|
|
|
|
val of_p256 : P256.t -> t
|
|
|
|
|
2018-04-05 19:35:35 +04:00
|
|
|
type algo =
|
|
|
|
| Ed25519
|
|
|
|
| Secp256k1
|
2018-06-05 21:27:58 +04:00
|
|
|
| P256
|
2018-04-05 19:35:35 +04:00
|
|
|
|
|
|
|
val algo_param: unit -> (algo, 'a) Clic.parameter
|
|
|
|
|
|
|
|
val generate_key:
|
|
|
|
?algo:algo ->
|
2018-04-06 01:22:30 +04:00
|
|
|
?seed:MBytes.t ->
|
2018-04-05 19:35:35 +04:00
|
|
|
unit -> public_key_hash * public_key * secret_key
|