ECDH: Include Everest Curve25519 in build scripts

This commit is contained in:
Christoph M. Wintersteiger 2018-10-25 12:47:03 +01:00 коммит произвёл Janos Follath
Родитель de4fcf2ae3
Коммит d5fd766c49
7 изменённых файлов: 30 добавлений и 3 удалений

1
3rdparty/everest/.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1 @@
*.o

Просмотреть файл

@ -176,7 +176,7 @@ else()
set(LIB_INSTALL_DIR lib)
endif()
include_directories(include/)
include_directories(include/ 3rdparty/everest/include/ 3rdparty/everest/include/everest/ 3rdparty/everest/include/everest/kremlin/ 3rdparty/everest/include/everest/kremlib/)
include_directories(library/)
add_subdirectory(library)

Просмотреть файл

@ -4,8 +4,9 @@ if(INSTALL_MBEDTLS_HEADERS)
file(GLOB headers "mbedtls/*.h")
file(GLOB psa_headers "psa/*.h")
file(GLOB everest_headers "../3rdparty/everest/include/*.h")
install(FILES ${headers}
install(FILES ${headers} ${everest_headers}
DESTINATION include/mbedtls
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)

Просмотреть файл

@ -94,6 +94,15 @@ set(src_crypto
)
endif()
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})
if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-declarations -Wmissing-prototypes")
endif(CMAKE_COMPILER_IS_GNUCC)

Просмотреть файл

@ -19,6 +19,9 @@ endif
# To compile on Plan9:
# 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
ifdef WINDOWS
WINDOWS_BUILD=1
@ -101,6 +104,13 @@ OBJS_CRYPTO += version.o
OBJS_CRYPTO += version_features.o
endif
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
.SILENT:
.PHONY: all static shared clean
@ -148,8 +158,10 @@ libmbedcrypto.dll: $(OBJS_CRYPTO)
clean:
ifndef WINDOWS
rm -f *.o libmbed*
rm -f *.o libmbed* $(OBJS_CRYPTO)
else
if exist *.o del /Q /F *.o
if exist libmbed* del /Q /F libmbed*
if exist $(OBJS_CRYPTO) del /Q /F $(OBJS_CRYPTO)
endif

Просмотреть файл

@ -11,6 +11,8 @@ LOCAL_CXXFLAGS = $(WARNING_CXXFLAGS) -I../include -D_FILE_OFFSET_BITS=64
LOCAL_LDFLAGS = -L../library \
-lmbedcrypto$(SHARED_SUFFIX)
LOCAL_CFLAGS+=-I../3rdparty/everest/include
ifndef SHARED
DEP=../library/libmbedcrypto.a
else

Просмотреть файл

@ -10,6 +10,8 @@ LOCAL_CFLAGS = $(WARNING_CFLAGS) $(CRYPTO_INCLUDES) -I../library -D_FILE_OFFSET_
LOCAL_LDFLAGS = -L../library \
-lmbedcrypto$(SHARED_SUFFIX)
LOCAL_CFLAGS+=-I../3rdparty/everest/include
# Enable definition of various functions used throughout the testsuite
# (gethostname, strdup, fileno...) even when compiling with -std=c99. Harmless
# on non-POSIX platforms.