Problem: tweetnacl sources are a mess

- they have no copyright / license statement
- they are in some randomish directory structure
- they are a mix of postable and non-portable files
- they do not conform to conditional compile environment

Overall, it makes it rather more work than needed, in build scripts.

Solution: clean up tweetnacl sauce.

- merged code into single tweetnacl.c and .h
- standard copyright header, DJB to AUTHORS
- moved into src/ along with all other source files
- all system and conditional compilation hidden in these files
- thus, they can be compiled and packaged in all cases
- ZMQ_USE_TWEETNACL is set when we're using built-in tweetnacl
- HAVE_LIBSODIUM is set when we're using external libsodium
This commit is contained in:
Pieter Hintjens
2016-02-11 18:06:07 +01:00
parent e65367ea2d
commit f8ed793f76
18 changed files with 234 additions and 485 deletions

View File

@@ -38,14 +38,13 @@
#include <assert.h>
#if !defined ZMQ_HAVE_WINDOWS
#include <unistd.h>
# include <unistd.h>
#else
#include "windows.hpp"
# include "windows.hpp"
#endif
#if defined (HAVE_TWEETNACL)
# include "tweetnacl_base.h"
# include "randombytes.h"
#if defined (ZMQ_USE_TWEETNACL)
# include "tweetnacl.h"
#elif defined (HAVE_LIBSODIUM)
# include "sodium.h"
#endif