ECDH: Include Everest Curve25519 in build scripts

This commit is contained in:
Christoph M. Wintersteiger 2018-10-25 12:47:03 +01:00 committed by Janos Follath
parent 02b8048846
commit 977d89ab29
6 changed files with 32 additions and 5 deletions

View File

@ -181,6 +181,8 @@ else()
set(LIB_INSTALL_DIR lib) set(LIB_INSTALL_DIR lib)
endif() endif()
include_directories(include/ 3rdparty/everest/include/ 3rdparty/everest/include/everest/ 3rdparty/everest/include/everest/kremlin/ 3rdparty/everest/include/everest/kremlib/)
if(ENABLE_ZLIB_SUPPORT) if(ENABLE_ZLIB_SUPPORT)
find_package(ZLIB) find_package(ZLIB)

View File

@ -3,8 +3,9 @@ option(INSTALL_MBEDTLS_HEADERS "Install mbed TLS headers." ON)
if(INSTALL_MBEDTLS_HEADERS) if(INSTALL_MBEDTLS_HEADERS)
file(GLOB headers "mbedtls/*.h") file(GLOB headers "mbedtls/*.h")
file(GLOB headers_everest "../3rdparty/everest/include/*.h")
install(FILES ${headers} install(FILES ${headers} ${headers_everest}
DESTINATION include/mbedtls DESTINATION include/mbedtls
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)

View File

@ -66,6 +66,16 @@ set(src_crypto
xtea.c xtea.c
) )
set(src_everest
../3rdparty/everest/library/everest.c
../3rdparty/everest/library/Hacl_Curve25519.c
../3rdparty/everest/library/x25519.c
../3rdparty/everest/library/kremlib/fstar_uint128.c
../3rdparty/everest/library/kremlib/FStar_UInt64_FStar_UInt32_FStar_UInt16_FStar_UInt8.c
)
set(src_crypto ${src_crypto} ${src_everest})
set(src_x509 set(src_x509
certs.c certs.c
pkcs11.c pkcs11.c

View File

@ -18,6 +18,9 @@ endif
# To compile on Plan9: # To compile on Plan9:
# CFLAGS += -D_BSD_EXTENSION # CFLAGS += -D_BSD_EXTENSION
# Include directories for Everest code
CFLAGS+=-I../3rdparty/everest/include -I../3rdparty/everest/include/everest -I../3rdparty/everest/include/everest/kremlib
# if were running on Windows build for Windows # if were running on Windows build for Windows
ifdef WINDOWS ifdef WINDOWS
WINDOWS_BUILD=1 WINDOWS_BUILD=1
@ -70,6 +73,13 @@ LOCAL_LDFLAGS += -L../crypto/library
LOCAL_CFLAGS += -I../crypto/include LOCAL_CFLAGS += -I../crypto/include
CRYPTO := ../crypto/library/ CRYPTO := ../crypto/library/
OBJS_CRYPTO+= \
../3rdparty/everest/library/everest.o \
../3rdparty/everest/library/Hacl_Curve25519.o \
../3rdparty/everest/library/x25519.o \
../3rdparty/everest/library/kremlib/fstar_uint128.o \
../3rdparty/everest/library/kremlib/FStar_UInt64_FStar_UInt32_FStar_UInt16_FStar_UInt8.o
OBJS_X509= certs.o pkcs11.o x509.o \ OBJS_X509= certs.o pkcs11.o x509.o \
x509_create.o x509_crl.o x509_crt.o \ x509_create.o x509_crl.o x509_crt.o \
x509_csr.o x509write_crt.o x509write_csr.o x509_csr.o x509write_crt.o x509write_csr.o
@ -153,11 +163,12 @@ libmbedcrypto.%:
.c.o: .c.o:
echo " CC $<" echo " CC $<"
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) -c $< $(CC) $(LOCAL_CFLAGS) $(CFLAGS) -o $@ -c $<
clean: clean:
ifndef WINDOWS ifndef WINDOWS
rm -f *.o libmbed* rm -f *.o libmbed* $(OBJS_CRYPTO)
else else
del /Q /F *.o libmbed* del /Q /F *.o libmbed* $(OBJS_CRYPTO)
endif endif

View File

@ -18,6 +18,8 @@ LOCAL_LDFLAGS += -L../crypto/library
LOCAL_CFLAGS += -I../crypto/include LOCAL_CFLAGS += -I../crypto/include
LOCAL_CXXFLAGS += -I../crypto/include LOCAL_CXXFLAGS += -I../crypto/include
LOCAL_CFLAGS+=-I../3rdparty/everest/include
ifndef SHARED ifndef SHARED
DEP=../crypto/library/libmbedcrypto.a ../library/libmbedx509.a ../library/libmbedtls.a DEP=../crypto/library/libmbedcrypto.a ../library/libmbedx509.a ../library/libmbedtls.a
else else

View File

@ -16,6 +16,8 @@ LOCAL_LDFLAGS += -L../crypto/library
LOCAL_CFLAGS += -I../crypto/include LOCAL_CFLAGS += -I../crypto/include
CRYPTO := ../crypto/library/ CRYPTO := ../crypto/library/
LOCAL_CFLAGS+=-I../3rdparty/everest/include
# Enable definition of various functions used throughout the testsuite # Enable definition of various functions used throughout the testsuite
# (gethostname, strdup, fileno...) even when compiling with -std=c99. Harmless # (gethostname, strdup, fileno...) even when compiling with -std=c99. Harmless
# on non-POSIX platforms. # on non-POSIX platforms.
@ -185,4 +187,3 @@ $(EMBEDDED_TESTS): embedded_%: suites/$$(firstword $$(subst ., ,$$*)).function s
-o ./TESTS/mbedtls/$* -o ./TESTS/mbedtls/$*
generate-target-tests: $(EMBEDDED_TESTS) generate-target-tests: $(EMBEDDED_TESTS)