Monocypher is an easy to use, easy to deploy, auditable crypto library
inspired by [libsodium][] and [TweetNaCl][], written in portable C.
-It means to eat libsodium's lunch.
+It means to eat Libsodium's lunch.
[Official site.](http://loup-vaillant.fr/projects/monocypher/)
[libsodium]: http://libsodium.org
[TweetNaCl]: http://tweetnacl.cr.yp.to/
+Manual
+------
+
+The `doc/man/` folder contains the man pages. You can install them in
+your system by running `make install-doc`.
+
+There is a html version in `doc/html/`, that you can regenerate by
+executing the `doc/man2html.sh` script (this requires mandoc).
+
Installation
------------
`src/monocypher.c` directly into your project. They compile as C99,
C11, C++98, C++11, C++14, and C++17.
-Alternatively, you can run
-
- $ make
-
-then grab `lib/libmonocypher.a` or `lib/libmonocypher.so`.
-
-If you're running a UNIX system, install Monocypher on your system
-(you need to be root):
+Alternatively, you can run `make`, then grab `lib/libmonocypher.a` or
+`lib/libmonocypher.so`. If you're running a UNIX system, you can even
+install Monocypher (you need to be root):
$ make install
This will install Monocypher in `/usr/local/` by default. Libraries
will go to `/usr/local/lib/`, the header in `/usr/local/include/`, and
-the man pages in `/usr/local/share/man/man3`. If you just want the
-man pages, run this:
+the man pages in `/usr/local/share/man/man3`. You can change those
+defaults with the `PREFIX` and `DESTDIR` variables thus:
+
+ $ make install PREFIX="/opt"
+
+Once installed, you can use `pkg-config` to compile and link your
+program. For instance, if you have a one file C project that uses
+Monocypher, you can compile it thus:
+
+ $ gcc -o myProgram myProgram.c \
+ $(pkg-config monocypher --cflags) \
+ $(pkg-config monocypher --libs)
- $ make install-doc
+The `cflags` line gives the include path for monocypher.h, and the
+`libs` line provides the link path and option required to find
+libmonocypher.a (or libmonocypher.so).
### Known language bindings
"OK". If you see "FAILURE" anywhere, something has gone very wrong
somewhere.
-*Do not* use Monocypher without running the self contained tests at
-least once.
+*Do not* use Monocypher without running those tests at least once.
### More serious testing
- Compile Monocypher.c with option -DED25519_SHA512.
- Link the final program with a suitable SHA-512 implementation. You
- can use the sha512.c and sha512.h files provided in `src/`.
+ can use the `sha512.c` and `sha512.h` files provided in `src/`.
Note that even though the default hash (Blake2b) is not "standard",
you can still upgrade to faster implementations if you really need to.
The Donna implementations of ed25519 for instance can use a custom
hash —one test does just that.
+
+
+Contributor notes
+-----------------
+
+If you just cloned the GitHub repository, you will miss a couple files
+that ship with the tarball releases:
+
+- The `test/vectors.h` header. Generating it requires libsodium. Go
+ to `test/gen/`, then run `make`.
+
+- The html version of the manual, generated by the `doc/man2html.sh`
+ script. You will need mandoc.
+
+To generate a tarball, simply type `make tarball`. By default, it
+will generate `../monocypher-master.tar.gz` (yes, in the parent
+directory). You can override those defaults thus:
+
+ make tarball TARBALL_VERSION=x.y.z TARBALL_DIR=../my_tarballs
+
+This will create a `../my_tarballs/monocypher-x.y.z.tar.gz`, archive
+that contains a single `monocypher-x.y.z` folder with everything in
+it.