diff --git a/pkg/monocypher/Makefile b/pkg/monocypher/Makefile new file mode 100644 index 0000000000..c275565924 --- /dev/null +++ b/pkg/monocypher/Makefile @@ -0,0 +1,11 @@ +PKG_NAME=monocypher +PKG_URL=https://github.com/LoupVaillant/Monocypher +PKG_VERSION=6c2edbb48a61f43452c48c5f1e3ddabb19af3111 +PKG_LICENSE=CC-0 + +.PHONY: all + +all: git-download + $(Q)"$(MAKE)" -C $(PKG_BUILDDIR)/src + +include $(RIOTBASE)/pkg/pkg.mk diff --git a/pkg/monocypher/Makefile.dep b/pkg/monocypher/Makefile.dep new file mode 100644 index 0000000000..767f3cc1c7 --- /dev/null +++ b/pkg/monocypher/Makefile.dep @@ -0,0 +1 @@ +USEMODULE += monocypher_sha512 diff --git a/pkg/monocypher/Makefile.include b/pkg/monocypher/Makefile.include new file mode 100644 index 0000000000..a72d0d8d33 --- /dev/null +++ b/pkg/monocypher/Makefile.include @@ -0,0 +1,7 @@ +INCLUDES += -I$(PKGDIRBASE)/monocypher/src +INCLUDES += -I$(PKGDIRBASE)/monocypher/src/optional + +ifneq (,$(filter monocypher_sha512,$(USEMODULE))) + CFLAGS += -DED25519_SHA512 + DIRS += $(PKGDIRBASE)/monocypher/src/optional +endif diff --git a/pkg/monocypher/doc.txt b/pkg/monocypher/doc.txt new file mode 100644 index 0000000000..b2c39340e4 --- /dev/null +++ b/pkg/monocypher/doc.txt @@ -0,0 +1,40 @@ +/** + * @defgroup pkg_monocypher Monocypher cryptographic library + * @ingroup pkg + * @brief Provides the Monocypher cryptographic library. + * + * # Monocypher RIOT package + * + * Monocypher is a high performance cryptographic library. It provides functions + * for authenticated encryption, hashing, password key derivation, key + * exchange, and public key signatures. + * + * You can find the API and more information + * [here](https://monocypher.org/manual) + * + * ## Requirements + * + * @note Monocypher only supports 32bit platforms. + * + * Monocypher requires around 3K of stack space depending slightly on the + * platform, so beware that you're allocating at + * least `THREAD_STACKSIZE_DEFAULT + 3072` bytes. + * + * You can do it easily by adding: + * + * ```makefile + * CFLAGS += '-DTHREAD_STACKSIZE_MAIN=(THREAD_STACKSIZE_DEFAULT + 3072)' + * ``` + * + * to your makefile. + * + * ## Usage + * + * Just add it as a package in your application: + * + * ```makefile + * USEPKG += monocypher + * ``` + * + * @see https://monocypher.org/ + */ diff --git a/pkg/monocypher/patches/0001-Monocypher-add-riot-makefiles.patch b/pkg/monocypher/patches/0001-Monocypher-add-riot-makefiles.patch new file mode 100644 index 0000000000..cba5754d54 --- /dev/null +++ b/pkg/monocypher/patches/0001-Monocypher-add-riot-makefiles.patch @@ -0,0 +1,33 @@ +From a8f8636c0b72d32a931c743d611bba4291a10eb5 Mon Sep 17 00:00:00 2001 +From: Koen Zandberg +Date: Fri, 29 Jun 2018 15:33:52 +0200 +Subject: [PATCH] Monocypher: add riot makefiles + +--- + src/Makefile | 3 +++ + src/optional/Makefile | 3 +++ + 2 files changed, 6 insertions(+) + create mode 100644 src/Makefile + create mode 100644 src/optional/Makefile + +diff --git a/src/Makefile b/src/Makefile +new file mode 100644 +index 0000000..c0f8d6c +--- /dev/null ++++ b/src/Makefile +@@ -0,0 +1,3 @@ ++MODULE := monocypher ++ ++include $(RIOTBASE)/Makefile.base +diff --git a/src/optional/Makefile b/src/optional/Makefile +new file mode 100644 +index 0000000..784d588 +--- /dev/null ++++ b/src/optional/Makefile +@@ -0,0 +1,3 @@ ++MODULE := monocypher_sha512 ++ ++include $(RIOTBASE)/Makefile.base +-- +2.16.4 +