monocypher: Initial import of package

Support for monocypher as crypto library. Blazing fast performance, but
double the flash requirement compared to TweetNaCl. Stack usage is
around 70% of TweetNaCl
This commit is contained in:
Koen Zandberg 2018-06-29 17:31:41 +02:00
parent e684f49037
commit 306731a790
No known key found for this signature in database
GPG Key ID: 0895A893E6D2985B
5 changed files with 92 additions and 0 deletions

11
pkg/monocypher/Makefile Normal file
View File

@ -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

View File

@ -0,0 +1 @@
USEMODULE += monocypher_sha512

View File

@ -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

40
pkg/monocypher/doc.txt Normal file
View File

@ -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/
*/

View File

@ -0,0 +1,33 @@
From a8f8636c0b72d32a931c743d611bba4291a10eb5 Mon Sep 17 00:00:00 2001
From: Koen Zandberg <koen@bergzand.net>
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