1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-11-21 17:09:53 +03:00

Cedar: Add "BLAKE2" submodule

OpenSSL provides BLAKE2s, but it only supports an output of 32 bytes. For WireGuard we need a 16 bytes output as well.

The minimum CMake version is bumped to 3.10 because it adds HAS_SSE2 to cmake_host_system_information(): https://cmake.org/cmake/help/v3.10/command/cmake_host_system_information.html
This commit is contained in:
Davide Beatrici 2021-03-01 02:37:00 +01:00
parent a39905c288
commit b339104f4f
4 changed files with 12 additions and 1 deletions

3
.gitmodules vendored
View File

@ -4,3 +4,6 @@
[submodule "3rdparty/tinydir"]
path = 3rdparty/tinydir
url = https://github.com/cxong/tinydir.git
[submodule "3rdparty/BLAKE2"]
path = 3rdparty/BLAKE2
url = https://github.com/BLAKE2/BLAKE2.git

1
3rdparty/BLAKE2 vendored Submodule

@ -0,0 +1 @@
Subproject commit b52178a376ca85a8ffe50492263c2a5bc0fa4f46

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.7)
cmake_minimum_required(VERSION 3.10)
set(BUILD_NUMBER CACHE STRING "The number of the current build.")

View File

@ -19,6 +19,13 @@ set_target_properties(cedar
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
)
cmake_host_system_information(RESULT HAS_SSE2 QUERY HAS_SSE2)
set(BLAKE2_SRC_PATH $<IF:$<BOOL:HAS_SSE2>,${TOP_DIRECTORY}/3rdparty/BLAKE2/sse,${TOP_DIRECTORY}/3rdparty/BLAKE2/ref>)
target_include_directories(cedar PUBLIC ${BLAKE2_SRC_PATH})
target_sources(cedar PRIVATE "${BLAKE2_SRC_PATH}/blake2s.c")
if(WIN32)
set_target_properties(cedar
PROPERTIES