package ttweetnacl

  1. Overview
  2. Docs

TweetNaCl cryptography.

The binding exposes two modules with the same signature except for the type used for storing bytes:

  • Bigcrypto uses bigbytes values which are managed by the C allocator. Calls to the C primitives may release the runtime system when deemed appropriate.
  • Crypto uses bytes values which are managed by the OCaml garbage collector and thus may be copied around in memory – you may care, or not. Calls to the C primitives never release the runtime system.

References.

Bytes

type bigbytes = (int, Stdlib.Bigarray.int8_unsigned_elt, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array1.t

The type for bigarrays of bytes.

module type BYTES = sig ... end

The module type for byte buffers.

Crypto

module type CRYPTO = sig ... end

The module type for NaCl cryptography.

module Bigcrypto : CRYPTO with type Bytes.t = bigbytes

Crypto on bigbytes.

module Crypto : CRYPTO with type Bytes.t = bytes

Crypto on bytes.