crypto box
initial utility functions for encrypted communication using crypto box (X25519/XSalsa20-Poly1305)
This commit is contained in:
parent
1ac018188e
commit
dc0061c5d9
@ -106,6 +106,7 @@ UTILS_LIB_INTFS := \
|
|||||||
utils/hex_encode.mli \
|
utils/hex_encode.mli \
|
||||||
utils/utils.mli \
|
utils/utils.mli \
|
||||||
utils/cli_entries.mli \
|
utils/cli_entries.mli \
|
||||||
|
utils/crypto_box.mli \
|
||||||
utils/compare.mli \
|
utils/compare.mli \
|
||||||
utils/data_encoding.mli \
|
utils/data_encoding.mli \
|
||||||
utils/time.mli \
|
utils/time.mli \
|
||||||
@ -123,6 +124,7 @@ UTILS_LIB_IMPLS := \
|
|||||||
utils/utils.ml \
|
utils/utils.ml \
|
||||||
utils/cli_entries.ml \
|
utils/cli_entries.ml \
|
||||||
utils/compare.ml \
|
utils/compare.ml \
|
||||||
|
utils/crypto_box.ml \
|
||||||
utils/data_encoding.ml \
|
utils/data_encoding.ml \
|
||||||
utils/time.ml \
|
utils/time.ml \
|
||||||
utils/hash.ml \
|
utils/hash.ml \
|
||||||
|
21
src/utils/crypto_box.ml
Normal file
21
src/utils/crypto_box.ml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
(**************************************************************************)
|
||||||
|
(* *)
|
||||||
|
(* 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 = Sodium.Box.secret_key
|
||||||
|
type public_key = Sodium.Box.public_key
|
||||||
|
type channel_key = Sodium.Box.channel_key
|
||||||
|
type nonce = Sodium.Box.nonce
|
||||||
|
|
||||||
|
let random_keypair = Sodium.Box.random_keypair
|
||||||
|
let random_nonce = Sodium.Box.random_nonce
|
||||||
|
let increment_nonce = Sodium.Box.increment_nonce
|
||||||
|
let box = Sodium.Box.Bigbytes.box
|
||||||
|
let box_open = Sodium.Box.Bigbytes.box_open
|
20
src/utils/crypto_box.mli
Normal file
20
src/utils/crypto_box.mli
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
(**************************************************************************)
|
||||||
|
(* *)
|
||||||
|
(* 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
|
Loading…
Reference in New Issue
Block a user