*.profdata
formal-analysis/*
man/3monocypher/*.html
-dist/AUTHORS.md
-dist/LICENCE.md
-dist/tests/vectors.h
+tests/vectors.h
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.
+
[Official site.](http://loup-vaillant.fr/projects/monocypher/)
[libsodium]: http://libsodium.org
[TweetNaCl]: http://tweetnacl.cr.yp.to/
-Generating the test vectors
----------------------------
-
-You are currently using the source repository, meant for developers.
-You need to generate the test vectors before you can run the test
-suite. This requires requires Libsodium 1.0.12 or later:
-
- $ cd tests/gen/
- $ make
- $ cd ../..
-
-This will generate `dist/tests/vectors.h`, which contains all the test
-vectors. You can now go to the `dist/` directory, then compile and
-test Monocypher like end users. There's also a
-[README.md](dist/README.md) there.
-
-
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 go to the `dist` directory, and follow the
-installation instructions there.
+Alternatively, you can run
+
+ $ make
+
+then grab `lib/libmonocypher.a` or `lib/libmonocypher.so`.
+
+_TODO: make install_
+
### Known language bindings
* [Zig](https://bitbucket.org/mihailp/zig-monocypher/src/default)
(http://ziglang.org/).
+
### Known alternate distributions
* [AUR package](https://aur.archlinux.org/packages/monocypher/) for
* If you are using [Buck Build](https://buckbuild.com) and
[Buckaroo](https://buckaroo.pm), then there is a Buck port
maintained at [njlr/Monocypher](https://github.com/njlr/Monocypher).
+
+
+Test suite
+----------
+
+ $ make test
+
+It should display a nice printout of all the tests, all starting with
+"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.
+
+
+### More serious testing
+
+_TODO: This section is obsolete._
+
+The makefile may be modified to activate sanitising. Just run the
+previous tests under the various sanitisers. If you compile for
+coverage mapping, the `coverage.sh` mapping can generate a report.
+Just run one of those (make sure the makefile is set up accordingly):
+
+ $ ./coverage.sh test.out
+
+You can also run the tests under Valgrind:
+
+ $ valgrind ./test.out
+
+### Serious auditing
+
+_TODO: This section is obsolete._
+
+The code may be analysed more formally with [Frama-c][] and the
+[TIS interpreter][TIS]. To analyse the code with Frama-c, run:
+
+ $ make formal-analysis
+ $ ./frama-c.sh
+
+This will have Frama-c parse, and analyse the code, then launch a GUI.
+You must have Frama-c installed. See `frama-c.sh` for the recommended
+settings. To run the code under the TIS interpreter, run
+
+ $ make formal-analysis
+ $ cd formal-analysis
+ $ tis-interpreter.sh *.c
+
+(Note: `tis-interpreter.sh` is part of TIS. If it is not in your
+path, adjust the command accordingly.)
+
+[Frama-c]:http://frama-c.com/
+[TIS]: http://trust-in-soft.com/tis-interpreter/
+
+
+Speed benchmark
+---------------
+
+_TODO: The speed benchmark don't run yet._
+
+ $ make speed
+
+This will give you an idea how fast Monocypher is on your machine.
+Make sure you run it on the target platform if performance is a
+concern. If Monocypher is too slow, try libsodium or NaCl. If you're
+not sure, you can always switch later.
+
+Note: the speed benchmark currently requires the POSIX
+`clock_gettime()` function.
+
+
+Customisation
+-------------
+
+_TODO: the test suite doesn't support the customisation yet._
+
+For simplicity, compactness, and performance reasons, Monocypher
+signatures default to EdDSA with curve25519 and Blake2b. This is
+different from the more mainstream Ed25519, which uses SHA-512
+instead.
+
+If you need Ed25519 compatibility, you need to do the following:
+
+- 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/`.
+
+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.
+++ /dev/null
-Monocypher
-----------
-
-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.
-
-[Official site.](http://loup-vaillant.fr/projects/monocypher/)
-
-[libsodium]: http://libsodium.org
-[TweetNaCl]: http://tweetnacl.cr.yp.to/
-
-
-Installation
-------------
-
-The easiest way to use Monocypher is to include `src/monocypher.h` and
-`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`.
-
-_TODO: make install_
-
-
-### Known language bindings
-
-* [Crystal](https://github.com/konovod/monocypher.cr)
-* [Lua](https://github.com/philanc/luanacha)
-* [Zig](https://bitbucket.org/mihailp/zig-monocypher/src/default)
- (http://ziglang.org/).
-
-
-### Known alternate distributions
-
-* [AUR package](https://aur.archlinux.org/packages/monocypher/) for
- Arch Linux.
-* If you are using [Buck Build](https://buckbuild.com) and
- [Buckaroo](https://buckaroo.pm), then there is a Buck port
- maintained at [njlr/Monocypher](https://github.com/njlr/Monocypher).
-
-
-Test suite
-----------
-
- $ make test
-
-It should display a nice printout of all the tests, all starting with
-"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.
-
-
-### More serious testing
-
-_TODO: This section is obsolete._
-
-The makefile may be modified to activate sanitising. Just run the
-previous tests under the various sanitisers. If you compile for
-coverage mapping, the `coverage.sh` mapping can generate a report.
-Just run one of those (make sure the makefile is set up accordingly):
-
- $ ./coverage.sh test.out
-
-You can also run the tests under Valgrind:
-
- $ valgrind ./test.out
-
-### Serious auditing
-
-_TODO: This section is obsolete._
-
-The code may be analysed more formally with [Frama-c][] and the
-[TIS interpreter][TIS]. To analyse the code with Frama-c, run:
-
- $ make formal-analysis
- $ ./frama-c.sh
-
-This will have Frama-c parse, and analyse the code, then launch a GUI.
-You must have Frama-c installed. See `frama-c.sh` for the recommended
-settings. To run the code under the TIS interpreter, run
-
- $ make formal-analysis
- $ cd formal-analysis
- $ tis-interpreter.sh *.c
-
-(Note: `tis-interpreter.sh` is part of TIS. If it is not in your
-path, adjust the command accordingly.)
-
-[Frama-c]:http://frama-c.com/
-[TIS]: http://trust-in-soft.com/tis-interpreter/
-
-
-Speed benchmark
----------------
-
-_TODO: The speed benchmark don't run yet._
-
- $ make speed
-
-This will give you an idea how fast Monocypher is on your machine.
-Make sure you run it on the target platform if performance is a
-concern. If Monocypher is too slow, try libsodium or NaCl. If you're
-not sure, you can always switch later.
-
-Note: the speed benchmark currently requires the POSIX
-`clock_gettime()` function.
-
-
-Customisation
--------------
-
-_TODO: the test suite doesn't support the customisation yet._
-
-For simplicity, compactness, and performance reasons, Monocypher
-signatures default to EdDSA with curve25519 and Blake2b. This is
-different from the more mainstream Ed25519, which uses SHA-512
-instead.
-
-If you need Ed25519 compatibility, you need to do the following:
-
-- 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/`.
-
-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.
sha512.vec argon2i.vec edDSA.vec x25519.vec
VEC2 = $(patsubst %.vec, %.all.vec, $(VEC)) key_exchange.all.vec
HEADERS = $(patsubst %.all.vec, %.h.vec, $(VEC2))
-VECTORS = ../../dist/tests/vectors.h
+VECTORS = ../vectors.h
all: $(VECTORS)
%.vec: %.out
./$< > $@
-%.o: %.c ../../dist/tests/utils.h ../ed25519-donna/ed25519.h
- $(CC) $(CFLAGS) -c $< \
- -I ../../dist/tests \
+%.o: %.c ../utils.h ../ed25519-donna/ed25519.h
+ $(CC) $(CFLAGS) -c $< \
+ -I .. \
-I ../ed25519-donna \
- -I ../../dist/src \
+ -I ../../src \
$$(pkg-config --cflags libsodium)
%.out: %.o monocypher.o utils.o ed25519.o
$(CC) $(CFLAGS) -o $@ $^ \
$$(pkg-config --libs libsodium)
-utils.o: ../../dist/tests/utils.c ../../dist/tests/utils.h
- $(CC) $(CFLAGS) -c $< -I ../../dist/tests -I ../../dist/src
+utils.o: ../utils.c ../utils.h
+ $(CC) $(CFLAGS) -c $< -I .. -I ../../src
ed25519.o: ../ed25519-donna/ed25519.c $(wildcard ../ed25519-donna/*.h)
$(CC) $(CFLAGS) -c $< \
- -I ../../dist/src \
+ -I ../../src \
$(HASH) \
-DED25519_CUSTOMHASH \
-DED25519_TEST \
-DED25519_NO_INLINE_ASM \
-DED25519_FORCE_32BIT
-monocypher.o: ../../dist/src/monocypher.c ../../dist/src/monocypher.h
-m_sha512.o : ../../dist/src/sha512.c ../../dist/src/sha512.h
+monocypher.o: ../../src/monocypher.c ../../src/monocypher.h
+m_sha512.o : ../../src/sha512.c ../../src/sha512.h
monocypher.o m_sha512.o:
- $(CC) $(CFLAGS) -c $< -I ../../dist/src
+ $(CC) $(CFLAGS) -c $< -I ../../src
vector_to_header.out: ../vector_to_header.c
$(CC) $(CFLAGS) $< -o $@