ligo/src/utils/crypto_box.mli
Eitan Chatav 69bc2a33e2 encryption and decryption
I don’t think this is secure since the receiver decrypts the message
and then sends the clear message as a `Recv` event
2016-11-05 12:16:48 -07:00

27 lines
1.2 KiB
OCaml

(**************************************************************************)
(* *)
(* Copyright (c) 2014 - 2016. *)
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
(** Tezos - X25519/XSalsa20-Poly1305 cryptography *)
type secret_key
type public_key
type nonce
val random_keypair : unit -> secret_key * public_key
val random_nonce : unit -> nonce
val increment_nonce : ?step:int -> nonce -> nonce
val box : secret_key -> public_key -> MBytes.t -> nonce -> MBytes.t
val box_open : secret_key -> public_key -> MBytes.t -> nonce -> MBytes.t
val to_secret_key : MBytes.t -> secret_key
val of_secret_key : secret_key -> MBytes.t
val to_public_key : MBytes.t -> public_key
val of_public_key : public_key -> MBytes.t
val to_nonce : MBytes.t -> nonce
val of_nonce : nonce -> MBytes.t