]> git.codecow.com Git - Monocypher.git/commitdiff
Move everything back from the dist/ directory
authorLoup Vaillant <loup@loup-vaillant.fr>
Wed, 20 Sep 2017 07:11:39 +0000 (09:11 +0200)
committerLoup Vaillant <loup@loup-vaillant.fr>
Wed, 20 Sep 2017 07:11:39 +0000 (09:11 +0200)
Making a separate dist/ folder was stupid, we can use tar's exclusion
patterns to take care of clean archiving.  It's simpler for everyone
without the indirection.

46 files changed:
.gitignore
README.md
dist/README.md [deleted file]
doc/man/3monocypher/crypto_aead_lock.3monocypher [moved from dist/doc/man/3monocypher/crypto_aead_lock.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_aead_unlock.3monocypher [moved from dist/doc/man/3monocypher/crypto_aead_unlock.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_argon2i.3monocypher [moved from dist/doc/man/3monocypher/crypto_argon2i.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_blake2b.3monocypher [moved from dist/doc/man/3monocypher/crypto_blake2b.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_blake2b_final.3monocypher [moved from dist/doc/man/3monocypher/crypto_blake2b_final.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_blake2b_general.3monocypher [moved from dist/doc/man/3monocypher/crypto_blake2b_general.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_blake2b_general_init.3monocypher [moved from dist/doc/man/3monocypher/crypto_blake2b_general_init.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_blake2b_init.3monocypher [moved from dist/doc/man/3monocypher/crypto_blake2b_init.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_blake2b_update.3monocypher [moved from dist/doc/man/3monocypher/crypto_blake2b_update.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_chacha20_H.3monocypher [moved from dist/doc/man/3monocypher/crypto_chacha20_H.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_chacha20_encrypt.3monocypher [moved from dist/doc/man/3monocypher/crypto_chacha20_encrypt.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_chacha20_init.3monocypher [moved from dist/doc/man/3monocypher/crypto_chacha20_init.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_chacha20_set_ctr.3monocypher [moved from dist/doc/man/3monocypher/crypto_chacha20_set_ctr.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_chacha20_stream.3monocypher [moved from dist/doc/man/3monocypher/crypto_chacha20_stream.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_chacha20_x_init.3monocypher [moved from dist/doc/man/3monocypher/crypto_chacha20_x_init.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_check.3monocypher [moved from dist/doc/man/3monocypher/crypto_check.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_key_exchange.3monocypher [moved from dist/doc/man/3monocypher/crypto_key_exchange.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_lock.3monocypher [moved from dist/doc/man/3monocypher/crypto_lock.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_memcmp.3monocypher [moved from dist/doc/man/3monocypher/crypto_memcmp.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_poly1305_auth.3monocypher [moved from dist/doc/man/3monocypher/crypto_poly1305_auth.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_poly1305_final.3monocypher [moved from dist/doc/man/3monocypher/crypto_poly1305_final.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_poly1305_init.3monocypher [moved from dist/doc/man/3monocypher/crypto_poly1305_init.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_poly1305_update.3monocypher [moved from dist/doc/man/3monocypher/crypto_poly1305_update.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_sign.3monocypher [moved from dist/doc/man/3monocypher/crypto_sign.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_sign_public_key.3monocypher [moved from dist/doc/man/3monocypher/crypto_sign_public_key.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_unlock.3monocypher [moved from dist/doc/man/3monocypher/crypto_unlock.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_x25519.3monocypher [moved from dist/doc/man/3monocypher/crypto_x25519.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_x25519_public_key.3monocypher [moved from dist/doc/man/3monocypher/crypto_x25519_public_key.3monocypher with 100% similarity]
doc/man/3monocypher/crypto_zerocmp.3monocypher [moved from dist/doc/man/3monocypher/crypto_zerocmp.3monocypher with 100% similarity]
doc/man/3monocypher/intro.3monocypher [moved from dist/doc/man/3monocypher/intro.3monocypher with 100% similarity]
doc/man/3monocypher/style.css [moved from dist/doc/man/3monocypher/style.css with 100% similarity]
makefile [moved from dist/makefile with 100% similarity]
src/monocypher.c [moved from dist/src/monocypher.c with 100% similarity]
src/monocypher.h [moved from dist/src/monocypher.h with 100% similarity]
src/sha512.c [moved from dist/src/sha512.c with 100% similarity]
src/sha512.h [moved from dist/src/sha512.h with 100% similarity]
tests/coverage.sh [moved from dist/tests/coverage.sh with 100% similarity]
tests/frama-c.sh [moved from dist/tests/frama-c.sh with 100% similarity]
tests/gen/makefile
tests/speed.c [moved from dist/tests/speed.c with 100% similarity]
tests/test.c [moved from dist/tests/test.c with 100% similarity]
tests/utils.c [moved from dist/tests/utils.c with 100% similarity]
tests/utils.h [moved from dist/tests/utils.h with 100% similarity]

index 7ddd1d580660d42acce58c8d855b1ebf861a4b33..159de6bf59c7472e5cee596ff5c7e87dfc309339 100644 (file)
@@ -11,6 +11,4 @@
 *.profdata
 formal-analysis/*
 man/3monocypher/*.html
-dist/AUTHORS.md
-dist/LICENCE.md
-dist/tests/vectors.h
+tests/vectors.h
index fde07bcfb2e6c5a957661ab5ed5fb1578d0674cb..1b681194defda629f87580d5f2420a815dec6caa 100644 (file)
--- a/README.md
+++ b/README.md
@@ -4,29 +4,14 @@ 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/
 
 
-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
 ------------
 
@@ -34,8 +19,14 @@ 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 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
 
@@ -44,6 +35,7 @@ installation instructions there.
 * [Zig](https://bitbucket.org/mihailp/zig-monocypher/src/default)
   (http://ziglang.org/).
 
+
 ### Known alternate distributions
 
 * [AUR package](https://aur.archlinux.org/packages/monocypher/) for
@@ -51,3 +43,94 @@ installation instructions there.
 * 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.
diff --git a/dist/README.md b/dist/README.md
deleted file mode 100644 (file)
index 1b68119..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-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.
similarity index 100%
rename from dist/makefile
rename to makefile
similarity index 100%
rename from dist/src/monocypher.c
rename to src/monocypher.c
similarity index 100%
rename from dist/src/monocypher.h
rename to src/monocypher.h
similarity index 100%
rename from dist/src/sha512.c
rename to src/sha512.c
similarity index 100%
rename from dist/src/sha512.h
rename to src/sha512.h
similarity index 100%
rename from dist/tests/coverage.sh
rename to tests/coverage.sh
similarity index 100%
rename from dist/tests/frama-c.sh
rename to tests/frama-c.sh
index 1532b5070f86a07f85fdedd51f1439d5ab51d68e..e1bb1e46103ca5f3bbf113625ee93fea17d54d19 100644 (file)
@@ -10,7 +10,7 @@ VEC     = chacha20.vec xchacha20.vec poly1305.vec blake2b.vec \
           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)
@@ -22,33 +22,33 @@ clean:
 %.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 $@
similarity index 100%
rename from dist/tests/speed.c
rename to tests/speed.c
similarity index 100%
rename from dist/tests/test.c
rename to tests/test.c
similarity index 100%
rename from dist/tests/utils.c
rename to tests/utils.c
similarity index 100%
rename from dist/tests/utils.h
rename to tests/utils.h