aboutsummaryrefslogtreecommitdiff
path: root/src/common/include.am
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-12-03 15:44:21 -0500
committerNick Mathewson <nickm@torproject.org>2013-01-02 14:10:48 -0500
commit89ec584805bfba76609a1191eb6789fc0e24bdae (patch)
tree4b05bf749b0388d35cf52bce3eca37b2ebbd9b03 /src/common/include.am
parentf06966023a4000de24feebaa2ca8438abb10c16c (diff)
downloadtor-89ec584805bfba76609a1191eb6789fc0e24bdae.tar.gz
tor-89ec584805bfba76609a1191eb6789fc0e24bdae.zip
Add a wrapper around, and test and build support for, curve25519.
We want to use donna-c64 when we have a GCC with support for 64x64->uint128_t multiplying. If not, we want to use libnacl if we can, unless it's giving us the unsafe "ref" implementation. And if that isn't going to work, we'd like to use the portable-and-safe-but-slow 32-bit "donna" implementation. We might need more library searching for the correct libnacl, especially once the next libnacl release is out -- it's likely to have bunches of better curve25519 implementations. I also define a set of curve25519 wrapper functions, though it really shouldn't be necessary. We should eventually make the -donna*.c files get build with -fomit-frame-pointer, since that can make a difference.
Diffstat (limited to 'src/common/include.am')
-rw-r--r--src/common/include.am20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/common/include.am b/src/common/include.am
index 0fdc72057f..f986ba66d3 100644
--- a/src/common/include.am
+++ b/src/common/include.am
@@ -14,6 +14,22 @@ else
libor_extra_source=
endif
+if BUILD_CURVE25519_DONNA
+libcrypto_extra_source= \
+ src/ext/curve25519_donna/curve25519-donna.c \
+ src/common/crypto_curve25519.c
+else
+if BUILD_CURVE25519_DONNA_C64
+libcrypto_extra_source= \
+ src/ext/curve25519_donna/curve25519-donna-c64.c \
+ src/common/crypto_curve25519.c
+else
+if CURVE25519_ENABLED
+libcrypto_extra_source=src/common/crypto_curve25519.c
+endif
+endif
+endif
+
src_common_libor_a_SOURCES = \
src/common/address.c \
src/common/compat.c \
@@ -31,7 +47,8 @@ src_common_libor_crypto_a_SOURCES = \
src/common/aes.c \
src/common/crypto.c \
src/common/torgzip.c \
- src/common/tortls.c
+ src/common/tortls.c \
+ $(libcrypto_extra_source)
src_common_libor_event_a_SOURCES = src/common/compat_libevent.c
@@ -43,6 +60,7 @@ COMMONHEADERS = \
src/common/compat_libevent.h \
src/common/container.h \
src/common/crypto.h \
+ src/common/crypto_curve25519.h \
src/common/di_ops.h \
src/common/memarea.h \
src/common/mempool.h \