ligo/src/environment/v1/ed25519.mli

78 lines
1.9 KiB
OCaml
Raw Normal View History

2017-11-14 03:32:46 +04:00
(**************************************************************************)
(* *)
2017-11-14 03:36:14 +04:00
(* Copyright (c) 2014 - 2017. *)
2017-11-14 03:32:46 +04:00
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
2016-09-08 21:13:10 +04:00
2017-11-14 03:32:46 +04:00
(** Tezos - Ed25519 cryptography *)
2016-09-08 21:13:10 +04:00
(** {2 Hashed public keys for user ID} ***************************************)
module Public_key_hash : Hash.HASH
2016-09-08 21:13:10 +04:00
(** {2 Signature} ************************************************************)
module Public_key : sig
2016-09-08 21:13:10 +04:00
include Compare.S
val encoding: t Data_encoding.t
2016-09-08 21:13:10 +04:00
val hash: t -> Public_key_hash.t
2016-09-08 21:13:10 +04:00
type Base58.data +=
| Public_key of t
2016-09-08 21:13:10 +04:00
val of_b58check_exn: string -> t
val of_b58check_opt: string -> t option
val to_b58check: t -> string
2016-09-08 21:13:10 +04:00
val of_bytes: Bytes.t -> t
2016-09-08 21:13:10 +04:00
end
module Secret_key : sig
type t
val encoding: t Data_encoding.t
type Base58.data +=
| Secret_key of t
val of_b58check_exn: string -> t
val of_b58check_opt: string -> t option
val to_b58check: t -> string
val of_bytes: Bytes.t -> t
end
module Signature : sig
type t
val encoding: t Data_encoding.t
type Base58.data +=
| Signature of t
val of_b58check_exn: string -> t
val of_b58check_opt: string -> t option
val to_b58check: t -> string
2016-09-08 21:13:10 +04:00
val of_bytes: Bytes.t -> t
2016-09-08 21:13:10 +04:00
(** Checks a signature *)
val check: Public_key.t -> t -> MBytes.t -> bool
2016-09-08 21:13:10 +04:00
(** Append a signature *)
val append: Secret_key.t -> MBytes.t -> MBytes.t
2016-09-08 21:13:10 +04:00
end
2016-09-08 21:13:10 +04:00
val sign: Secret_key.t -> MBytes.t -> Signature.t
2017-02-24 18:38:42 +04:00
val generate_key: unit -> (Public_key_hash.t * Public_key.t * Secret_key.t)