package digestif

  1. Overview
  2. Docs

Description

Build Status

Digestif is a toolbox which implements hashes:

  • SHA1
  • SHA224
  • SHA256
  • SHA384
  • SHA512
  • BLAKE2B
  • BLAKE2S
  • RIPEMD160

Digestif uses a trick about linking and let the end-user to choose which implementation he wants to use. We provide 2 implementations:

  • C implementation with digestif.c
  • OCaml implementation with digestif.ocaml

Both are well-tested. However, OCaml implementation is slower than the C implementation.

API

For each hash, we implement the same API which is referentially transparent. Then, on the top of these, we reflect functions (like digesti or hmaci) with GADT - however, conversion from GADT to hash type is not possible (but you can destruct GADT to a string).

Build Requirements

  • OCaml >= 4.03.0 (may be less but need test)
  • base-bytes meta-package
  • Bigarray module (provided by the standard library of OCaml)
  • dime to build the project

If you want to compile the test program, you need:

  • alcotest

Credits

This work is from the nocrypto library and the Vincent hanquez's work in ocaml-sha.

All credits appear in the begin of files and this library is motivated by two reasons:

  • delete the dependancy with nocrypto if you don't use the encryption (and common) part
  • aggregate all hashes functions in one library

Published: 24 Jul 2018

README

Digestif - Hash algorithms in C and OCaml

Digestif is a toolbox which implements hashes:

  • SHA1

  • SHA224

  • SHA256

  • SHA384

  • SHA512

  • BLAKE2B

  • BLAKE2S

  • RIPEMD160

Digestif uses a trick about linking and let the end-user to choose which implementation he wants to use. We provide 2 implementations:

  • C implementation with digestif.c

  • OCaml implementation with digestif.ocaml

Both are well-tested. However, OCaml implementation is slower than the C implementation.

Home page: http://din.osau.re/

Contact: Romain Calascibetta <romain.calascibet ta@gmail.com>

API

For each hash, we implement the same API which is referentially transparent. Then, on the top of these, we reflect functions (like digesti or hmaci) with GADT - however, conversion from GADT to hash type is not possible (but you can destruct GADT to a string).

Build Requirements

  • OCaml >= 4.03.0 (may be less but need test)

  • base-bytes meta-package

  • Bigarray module (provided by the standard library of OCaml)

  • dime to build the project

If you want to compile the test program, you need:

  • alcotest

Credits

This work is from the nocrypto library and the Vincent hanquez's work in ocaml-sha.

All credits appear in the begin of files and this library is motivated by two reasons:

  • delete the dependancy with nocrypto if you don't use the encryption (and common) part

  • aggregate all hashes functions in one library

Dependencies (4)

  1. base-bigarray
  2. base-bytes
  3. jbuilder >= "1.0+beta7"
  4. ocaml >= "4.03.0" & < "5.0"

Dev Dependencies

None

Used by (12)

  1. dkim-mirage >= "0.2.0"
  2. docfd >= "2.1.0"
  3. irmin = "2.2.0"
  4. irmin-http = "2.0.0"
  5. irmin-unix >= "2.0.0" & < "2.3.0"
  6. jupyter-kernel >= "0.4" & < "0.8"
  7. miou
  8. noise < "0.2.0"
  9. owi >= "0.2"
  10. swhid_compute
  11. webauthn >= "0.2.0"
  12. zeit

Conflicts

None

OCaml

Innovation. Community. Security.