]> git.codecow.com Git - Monocypher.git/commitdiff
Added USE_ED25519 makefile option
authorLoup Vaillant <loup@loup-vaillant.fr>
Sun, 1 Dec 2019 14:56:34 +0000 (15:56 +0100)
committerLoup Vaillant <loup@loup-vaillant.fr>
Sun, 1 Dec 2019 14:56:34 +0000 (15:56 +0100)
README.md
makefile

index 3d31381f0c698645c6502f261bc65c74eb4910d4..2ae96d89365c1b62b43a6dfbff4c8c63ba0e9441 100644 (file)
--- a/README.md
+++ b/README.md
@@ -150,21 +150,16 @@ and c25519 (the default is `-O3 march=native`):
 Customisation
 -------------
 
-Monocypher has two preprocessor flags: `ED25519_SHA512` and
-`BLAKE2_NO_UNROLLING`, which are activated by compiling monocypher.c
-with the options `-DED25519_SHA512` and `-DBLAKE2_NO_UNROLLING`
-respectively.
-
-The `-DED25519_SHA512` option is a compatibility feature for public key
-signatures.  The default is EdDSA with Curve25519 and Blake2b.
-Activating the option replaces it by Ed25519 (EdDSA with Curve25519 and
-SHA-512).  When this option is activated, you will need to link the
-final program with a suitable SHA-512 implementation.  You can use the
-`sha512.c` and `sha512.h` files provided in `src/optional`.  The
-makefile does this linking automatically whenever the `$CFLAGS` variable
-contains the `-DED25519_SHA512` option. For instance:
-
-    $ make CFLAGS="-O2 -DED25519_SHA512"
+Monocypher has optional compatibility with Ed25519. To have that, add
+`ed25519.h` and `ed25519.h` provided in `src/optional` to your project.
+If you're using the makefile, define the `USE_ED25519` variable to link
+it to monocypher.a and monocypher.so:
+
+    $ make USE_ED25519=true
+
+Monocypher also has the `BLAKE2_NO_UNROLLING` preprocessor flag, which
+is activated by compiling monocypher.c with the `-DBLAKE2_NO_UNROLLING`
+option.
 
 The `-DBLAKE2_NO_UNROLLING` option is a performance tweak.  By default,
 Monocypher unrolls the Blake2b inner loop, because doing so is over 25%
index 58b9d0c7d74a67524a5ba5a00df46ba9addadd85..dc029f78a73187f1f2f4b69027066cef1786cbf3 100644 (file)
--- a/makefile
+++ b/makefile
@@ -8,8 +8,9 @@ SONAME=libmonocypher.so.3
 
 VERSION=__git__
 
-ifdef LINK_ED25519
+ifdef USE_ED25519
 LINK_ED25519=lib/ed25519.o
+INSTALL_ED25519=cp src/optional/ed25519.h $(DESTDIR)/$(PREFIX)/include
 endif
 
 .PHONY: all library static-library dynamic-library                     \
@@ -26,6 +27,7 @@ install: library src/monocypher.h install-doc
        mkdir -p $(PKGCONFIG)
        cp -P lib/libmonocypher.a lib/libmonocypher.so* $(DESTDIR)/$(PREFIX)/lib
        cp src/monocypher.h $(DESTDIR)/$(PREFIX)/include
+       $(INSTALL_ED25519)
        @echo "Creating $(PKGCONFIG)/monocypher.pc"
        @echo "prefix=/$(PREFIX)"                > $(PKGCONFIG)/monocypher.pc
        @echo 'exec_prefix=$${prefix}'          >> $(PKGCONFIG)/monocypher.pc