$(LIBKECCAK_TINY) \
$(LIBDONNA)
+if BUILD_MODULE_POW
+TOR_CRYPTO_LIBS += $(EQUIX_LIBS)
+endif
+
# Variants of the above for linking the testing variant of tor (for coverage
# and tests)
if UNITTESTS_ENABLED
src/lib/libtor-tls-testing.a \
src/lib/libtor-crypt-ops-testing.a \
$(LIBKECCAK_TINY) \
- $(LIBDONNA)
+ $(LIBDONNA) \
+ $(EQUIX_LIBS)
endif
-EQUIX_LIBS = \
- src/ext/equix/build/libequix.a \
- src/ext/equix/build/hashx/libhashx.a
-
# All static libraries used to link tor.
TOR_INTERNAL_LIBS = \
src/core/libtor-app.a \
$(TOR_CRYPTO_LIBS) \
$(TOR_UTIL_LIBS) \
src/trunnel/libor-trunnel.a \
- src/lib/libtor-trace.a \
- $(EQUIX_LIBS)
+ src/lib/libtor-trace.a
libtor.a: $(TOR_INTERNAL_LIBS)
$(AM_V_AR) export AR="$(AR)"; \
$(TOR_CRYPTO_TESTING_LIBS) \
$(TOR_UTIL_TESTING_LIBS) \
src/trunnel/libor-trunnel-testing.a \
- src/lib/libtor-trace.a \
- $(EQUIX_LIBS)
+ src/lib/libtor-trace.a
src/test/libtor-testing.a: $(TOR_INTERNAL_TESTING_LIBS)
$(AM_V_AR) export AR="$(AR)"; \
tor_ac_n_warnings=`expr $tor_ac_n_warnings + 1`
}
-AC_CONFIG_COMMANDS([equix], [./src/ext/equix/build.sh])
-
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_HEADERS([orconfig.h])
esac
fi
+# These HashX parameter definitions are needed in CPPFLAGS when compiling
+# the equix and hashx ext modules, but elsewhere in tor we can use orconfig.h
+
+m4_define([equix_hashx_size], [8])
+[HASHX_SIZE=]equix_hashx_size
+AC_SUBST([HASHX_SIZE])
+AC_DEFINE([HASHX_SIZE], equix_hashx_size,
+ [Output size in bytes for the internal customization of HashX])
+AC_DEFINE([HASHX_STATIC], [1], [We statically link with HashX])
+AC_DEFINE([EQUIX_STATIC], [1], [We statically link with EquiX])
+
CPPFLAGS="$CPPFLAGS $TOR_CPPFLAGS_libevent $TOR_CPPFLAGS_openssl $TOR_CPPFLAGS_zlib"
AC_CONFIG_FILES([
AM_CPPFLAGS += \
-I$(srcdir)/src/ext/ \
- -I$(srcdir)/src/ext/equix/include/ \
-I$(srcdir)/src/ext/equix/hashx/include/
-# TODO: put this with other equix/hashx ext defs when those happen,
-# and also add it to the autoconf config header. For now this is here
-# just for test_crypto's benefit.
-AM_CPPFLAGS += -DHASHX_SIZE=8
-
EXTRA_DIST += src/ext/ext.md
EXTHEADERS = \
LIBED25519_DONNA=src/ext/ed25519/donna/libed25519_donna.a
noinst_LIBRARIES += $(LIBED25519_DONNA)
+src_ext_equix_libhashx_a_CPPFLAGS = \
+ -I$(srcdir)/src/ext/equix/hashx/include/ \
+ -I$(srcdir)/src/ext/equix/hashx/src/ \
+ -DHASHX_SIZE=@HASHX_SIZE@ \
+ -DEQUIX_STATIC=1 -DHASHX_STATIC=1
+
+src_ext_equix_libhashx_a_SOURCES = \
+ src/ext/equix/hashx/src/blake2.c \
+ src/ext/equix/hashx/src/compiler.c \
+ src/ext/equix/hashx/src/compiler_a64.c \
+ src/ext/equix/hashx/src/compiler_x86.c \
+ src/ext/equix/hashx/src/context.c \
+ src/ext/equix/hashx/src/hashx.c \
+ src/ext/equix/hashx/src/program.c \
+ src/ext/equix/hashx/src/program_exec.c \
+ src/ext/equix/hashx/src/siphash.c \
+ src/ext/equix/hashx/src/siphash_rng.c \
+ src/ext/equix/hashx/src/virtual_memory.c
+
+src_ext_equix_libequix_a_CPPFLAGS = \
+ -I$(srcdir)/src/ext/equix/include/ \
+ -I$(srcdir)/src/ext/equix/src/ \
+ $(src_ext_equix_libhashx_a_CPPFLAGS)
+
+src_ext_equix_libequix_a_SOURCES = \
+ src/ext/equix/src/context.c \
+ src/ext/equix/src/equix.c \
+ src/ext/equix/src/solver.c
+
+EQUIX_HDRS = \
+ src/ext/equix/hashx/include/hashx.h \
+ src/ext/equix/hashx/src/blake2.h \
+ src/ext/equix/hashx/src/compiler.h \
+ src/ext/equix/hashx/src/context.h \
+ src/ext/equix/hashx/src/force_inline.h \
+ src/ext/equix/hashx/src/hashx_endian.h \
+ src/ext/equix/hashx/src/instruction.h \
+ src/ext/equix/hashx/src/program.h \
+ src/ext/equix/hashx/src/siphash_rng.h \
+ src/ext/equix/hashx/src/siphash.h \
+ src/ext/equix/hashx/src/unreachable.h \
+ src/ext/equix/hashx/src/virtual_memory.h \
+ src/ext/equix/include/equix.h \
+ src/ext/equix/src/context.h \
+ src/ext/equix/src/solver_heap.h \
+ src/ext/equix/src/solver.h
+
+EQUIX_LIBS = \
+ src/ext/equix/libhashx.a \
+ src/ext/equix/libequix.a
+
+noinst_HEADERS += $(EQUIX_HDRS)
+noinst_LIBRARIES += $(EQUIX_LIBS)
+
if BUILD_KECCAK_TINY
src_ext_keccak_tiny_libkeccak_tiny_a_CFLAGS=\
@CFLAGS_CONSTTIME@