[ANN] Digestif 0.2 - Hashes functions

Hi all,

I’m happy to announce a new release of digestif.0.2. available for installation via OPAM.

Digestif is a library which contains some hashes function like:

  • SHA1
  • SHA224
  • SHA256
  • SHA384
  • SHA512
  • MD5

This library provides 2 implementations of these hashes. One in C and one in OCaml. To get the first one, you need to link with digestif.c, otherwise, you need to link with digestif.ocaml. These implementations share exactly the same interface. Obviously, this choice is about the performance and the portability. This library was thinked in the same way than mtime to allow the compilation in a Mirage/Unix/JavaScript back-end.

As you know, nocrypto and some others projects provides the same hashes functions. But nocrypto has a strong dependency with GMP and we decided to cut this part of nocrypto to avoid this strong dependency. So, digestif depends only on bigarray. It compiles with OCaml 4.03.0 or upper.

Then, we decided (for some others reasons) to implement the BLAKE2B hash function. This library is open to integrate others hashes functions. If you have a specific task, you can use the issue tracker.


Ah, too bad this didn’t exist already when I wrote ocp-sha !

Maybe opam could use this instead of relying on openssl for speed, when available. How does it compare in terms of speed ?

Honestly, I did not do any benchmark for the OCaml implementation and just follow the specification but I can put this request in my TODO :slight_smile:.

1 Like