this repo has no description
1opam-version: "2.0"
2maintainer: [ "Eyyüb Sari <eyyub.sari@epitech.eu>"
3 "Romain Calascibetta <romain.calascibetta@gmail.com>" ]
4authors: [ "Eyyüb Sari <eyyub.sari@epitech.eu>"
5 "Romain Calascibetta <romain.calascibetta@gmail.com>" ]
6homepage: "https://github.com/mirage/digestif"
7bug-reports: "https://github.com/mirage/digestif/issues"
8dev-repo: "git+https://github.com/mirage/digestif.git"
9doc: "https://mirage.github.io/digestif/"
10license: "MIT"
11
12build: [ "ocaml" "pkg/pkg.ml" "build" "--pinned" "%{pinned}%" "--tests" "false" ]
13
14depends: [
15 "ocaml" {>= "4.03.0" & < "5.0"}
16 "ocamlbuild" {build & >= "0.11.0"}
17 "ocamlfind" {build}
18 "topkg" {build}
19 "base-bytes"
20]
21synopsis: "Hash algorithms in OCaml"
22description: """
23[](https://travis-ci.org/mirage/digestif)
24
25Digestif (and Rakia) provid some hashes functions in OCaml. Rakia provides
26theses functions by a C stub and Digestif is a pure implementation in OCaml of
27theses hashes. So these hashes functions can be used in an
28OCaml/Mirage/JavasScript world.
29
30Obviously, Rakia is more faster than Digestif (the hot loop was implemented in
31C) but it's possible than Rakia can't compile in your architecture. In this
32case, it's better to use Digestif or send a PR to fix Rakia.
33
34
35Documentation: http://mirage.github.io/digestif/api.docdir/
36
37
38## API
39
40We provide an interface with no dependancy (only with `Bigarray`, available by
41the OCaml distribution). You can choose between the `Bytes` module or the
42`Bigstring` module. You can't remove the dependancy with `Bigarray` because the
43context of the hash function is internally a `Bigarray.Array1.t`.
44
45We provide the same interface:
46
47```ocaml
48type t
49type ctx
50type buffer
51
52val init : unit -> ctx
53val feed : ctx -> buffer -> unit
54val get : ctx -> t
55
56val digest : buffer -> t
57val digestv : buffer list -> t
58val hmac : key:buffer -> buffer -> t
59val hmacv : key:buffer -> buffer list -> t
60
61val compare : t -> t -> int
62val eq : t -> t -> bool
63val neq : t -> t -> bool
64
65val pp : Format.formatter -> t -> unit
66val of_hex : buffer -> t
67val to_hex : t -> buffer
68```
69
70`buffer` can be a `Bytes.t` or a `Bigstring.t`. We have an imperative and a
71functionnal way to produce a hash. `t` is not equivalent between the module
72`Bytes` and the module `Bigstring`.
73
74## Hashes functions
75
76 At this time, we implemented these hashes:
77
78 * SHA1
79 * SHA224
80 * SHA256
81 * SHA384
82 * SHA512
83 * BLAKE2B
84
85If you want an other hash function, you can ask in the issue.
86
87## Build Requirements
88
89 * OCaml >= 4.03.0 (may be less but need test)
90 * `base-bytes` meta-package
91 * Bigarray module (provided by the standard library of OCaml)
92 * `topkg`, `ocamlbuild` and `ocamlfind` to build the project
93
94If you want to compile the test program, you need:
95
96 * `alcotest`
97
98## Credits
99
100This work is from the [nocrypto](https://github.com/mirleft/nocrypto) library
101and the Vincent hanquez's work
102in [ocaml-sha](https://github.com/vincenthz/ocaml-sha).
103
104All credits appear in the begin of files and this library is motivated by two reasons:
105
106 * delete the dependancy with `nocrypto` if you don't use the encryption (and common) part
107 * aggregate all hashes functions in one library
108
109We deleted the `cstruct` **hard** dependancy (from `nocrypto`) and provide a
110interface to compute with the `Bytes.t`. We add the `blake2b` implementation too
111and we have the plan to provide the hash function in pure OCaml and other hashes
112functions. Finally, you can use `nocrypto` _and_ `digestif` together (no clash
113name in the C stub, don't worry).
114
115So, yes, it's redundant but deal with it!"""
116url {
117 src:
118 "https://github.com/mirage/digestif/releases/download/v0.5/digestif-0.5.tbz"
119 checksum: [
120 "sha256=2dc3b99c57c9265a5fc80c629538eb458d6fdc332794ad241ff2047d4b745e3b"
121 "md5=0f75996930e35ff3fe5079152325f780"
122 ]
123}
124available: [ arch != "s390x" ]