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

@@ -34,9 +34,8 @@
#include "platform.hpp"
#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
@@ -49,7 +48,7 @@
|| crypto_secretbox_NONCEBYTES != 24 \
|| crypto_secretbox_ZEROBYTES != 32 \
|| crypto_secretbox_BOXZEROBYTES != 16
# error "libsodium not built properly"
# error "CURVE library not built properly"
#endif
#include "mechanism.hpp"