package chacha

All checked builds pass
  1. Overview
  2. Docs
The Chacha functions, in OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

1.1.0.tar.gz
md5=0c9cf7e83222b5feacc56edf657dfbd7
sha512=4a0cdf8649c6f03ee24534ec870d51920dfc37f5b64a6fd393114b810361eab27b2172b52d408275add3d2ca11808f0d85124594ff972fb2e73ba50c0bc0869c

Description

An OCaml implementation of ChaCha functions, both ChaCha20 and the reduced ChaCha8 and ChaCha12 functions. The hot loop is implemented in C for efficiency reasons.

Added to opam-repository:

README

docs Build Status

ChaCha family of encryption functions, in OCaml

An OCaml implementation of ChaCha functions, both ChaCha20 and the reduced ChaCha8 and ChaCha12 functions. The hot loop is implemented in C for efficiency reasons.

Installation

opam install chacha

Usage

utop[0]> #require "mirage-crypto";;
utop[1]> #require "mirage-crypto-rng.unix";;
utop[2]> Mirage_crypto_rng_unix.initialize ();;
- : unit = ()
utop[3]> let key = Mirage_crypto_rng.generate 32;;
val key : Cstruct.t = {Cstruct.buffer = <abstr>; off = 0; len = 32}
utop[4]> let nonce = Cstruct.create 8;;
val nonce : Cstruct.t = {Cstruct.buffer = <abstr>; off = 0; len = 8}
utop[5]> #require "chacha";;
utop[6]> let state = Chacha.create key nonce;;
val state : Chacha.t = <abstr>
utop[7]> Chacha.encrypt (Cstruct.of_string "My secret text") state |> Cstruct.to_string;;
- : string = "\026m.\\363\\026\\263\\207Xg\\256l\\262\\232F"
  • Key can either 32 (recommended) or 16 bytes
  • Chacha state may use a different hashing function, the recommended Chacha_core.chacha20 is used by default.

Dependencies (5)

  1. ocaml >= "4.02.0"
  2. mirage-crypto < "1.0.0"
  3. cstruct >= "6.0.0" & < "6.1.0"
  4. dune >= "1.8.0"
  5. conf-pkg-config build

Dev Dependencies (1)

  1. alcotest with-test

Used by

None

Conflicts (2)

  1. ocaml-freestanding < "0.4.1"
  2. mirage-xen-posix < "3.1.0"

Build status

Results of building chacha with each compiler on check.ci.ocaml.org, run of against opam-repository 78c202b. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
1.1.0 (this version) good good good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure