----------
Monocypher is an easy to use, easy to deploy, auditable crypto library
-written in portable C. It approches the size of [TweetNaCl][] and the
+written in portable C. It approaches the size of [TweetNaCl][] and the
speed of [Libsodium][].
[Official site.](https://monocypher.org/)
*Do not* use Monocypher without running those tests at least once.
+The same test suite can be run under clang sanitisers and valgrind, and
+be checked for code coverage:
-### More serious testing
-
-You can run the test suite under clang sanitizers or valgrind:
-
- $ make clean
- $ make test CC="clang -std=c99" CFLAGS="-fsanitize=address"
-
- $ make clean
- $ make test CC="clang -std=c99" CFLAGS="-fsanitize=memory"
-
- $ make clean
- $ make test CC="clang -std=c99" CFLAGS="-fsanitize=undefined"
-
- $ make clean
- $ make test.out
- $ valgrind ./test.out
-
-You can also check code coverage:
-
- $ make clean
- $ make test CC="clang -std=c99" CFLAGS="-fprofile-instr-generate -fcoverage-mapping"
+ $ tests/test.sh
$ tests/coverage.sh
$ make speed-sodium
$ make speed-tweetnacl
+You can also adjust the optimisation options for Monocypher and
+TweetNaCl (the default is `-O3 march=native`):
+
+ $ make speed CFLAGS="-O2"
+ $ make speed-tweetnacl CFLAGS="-O2"
+
+
Customisation
-------------
#! /bin/sh
+set -e
+
+make clean
+make test CC="clang -std=c99" CFLAGS="-fprofile-instr-generate -fcoverage-mapping"
llvm-profdata-3.8 merge default.profraw -o all.profdata
llvm-cov-3.8 show -instr-profile=all.profdata "./test.out"
--- /dev/null
+#! /bin/sh
+
+set -e
+
+make clean; make test
+make clean; make test CC="clang -std=c99" CFLAGS="-g -fsanitize=address"
+make clean; make test CC="clang -std=c99" CFLAGS="-g -fsanitize=memory"
+make clean; make test CC="clang -std=c99" CFLAGS="-g -fsanitize=undefined"
+make clean; make test.out; valgrind ./test.out
+
+echo "All sanitisers passed!"