Update to CryptoPP 8.6. This fixes a rare bug where CryptoPP 8.5 encrypts data wrongly, see https://github.com/weidai11/cryptopp/issues/1069
This commit is contained in:
parent
910c2e1f75
commit
e27190e05c
@ -2,6 +2,7 @@ Version 0.11.1 (unreleased)
|
||||
---------------
|
||||
Bugfix:
|
||||
* Fix building of the range-v3 dependency. The conan remote URL for this dependency changed and we have to use the new URL. See https://github.com/cryfs/cryfs/issues/398
|
||||
* Update to CryptoPP 8.6. This fixes a rare bug where CryptoPP 8.5 encrypts data wrongly, see https://github.com/weidai11/cryptopp/issues/1069
|
||||
|
||||
Version 0.11.0
|
||||
---------------
|
||||
|
5
vendor/README
vendored
5
vendor/README
vendored
@ -1,8 +1,7 @@
|
||||
This directory contains external projects, taken from the following locations:
|
||||
googletest: https://github.com/google/googletest/commit/eaf9a3fd77869cf95befb87455a2e2a2e85044ff
|
||||
- changed: In googletest/cmake/internal_utils.cmake, add cmake_policy(SET CMP0069 NEW) to silence a warning
|
||||
cryptopp: https://github.com/weidai11/cryptopp/tree/CRYPTOPP_8_5_0
|
||||
- changed: added CMakeLists.txt and cryptopp-config.cmake from https://github.com/noloader/cryptopp-cmake/tree/CRYPTOPP_8_5_0
|
||||
cryptopp: https://github.com/weidai11/cryptopp/releases/tag/CRYPTOPP_8_6_0
|
||||
- changed: added CMakeLists.txt and cryptopp-config.cmake from https://github.com/noloader/cryptopp-cmake/tree/675367754bf4bf2284910dcec24d068472c97990
|
||||
- changed: In CMakeLists.txt, rename BUILD_TESTING to CRYPTOPP_BUILD_TESTING so it doesn't clash with our BUILD_TESTING
|
||||
- changed: In CMakeLists.txt, add cmake_policy(SET CMP0069 NEW) to silence a warning
|
||||
- changed: In .gitignore, remove *.cxx entry so we don't miss checking in the test files, see https://github.com/noloader/cryptopp-cmake/issues/66
|
||||
|
73
vendor/cryptopp/CMakeLists.txt
vendored
73
vendor/cryptopp/CMakeLists.txt
vendored
@ -8,78 +8,9 @@ target_include_directories(cryptopp SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
target_compile_definitions(cryptopp INTERFACE $<$<CONFIG:Debug>:CRYPTOPP_DEBUG>) # add to all targets depending on this
|
||||
add_compile_options($<$<CONFIG:Debug>:-DCRYPTOPP_DEBUG>) # add to stuff built in subdirectories (like the actual library)
|
||||
|
||||
if(NOT DISABLE_OPENMP)
|
||||
find_package(OpenMP)
|
||||
|
||||
if (OPENMP_FOUND OR OPENMP_CXX_FOUND)
|
||||
message(STATUS "Found libomp without any special flags")
|
||||
endif()
|
||||
|
||||
# If OpenMP wasn't found, try if we can find it in the default Macports location
|
||||
if((NOT OPENMP_FOUND) AND (NOT OPENMP_CXX_FOUND) AND EXISTS "/opt/local/lib/libomp/libomp.dylib") # older cmake uses OPENMP_FOUND, newer cmake also sets OPENMP_CXX_FOUND, homebrew installations seem only to get the latter set.
|
||||
set(OpenMP_CXX_FLAGS "-Xpreprocessor -fopenmp -I/opt/local/include/libomp/")
|
||||
set(OpenMP_CXX_LIB_NAMES omp)
|
||||
set(OpenMP_omp_LIBRARY /opt/local/lib/libomp/libomp.dylib)
|
||||
|
||||
find_package(OpenMP)
|
||||
if (OPENMP_FOUND OR OPENMP_CXX_FOUND)
|
||||
message(STATUS "Found libomp in macports default location.")
|
||||
else()
|
||||
message(FATAL_ERROR "Didn't find libomp. Tried macports default location but also didn't find it.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# If OpenMP wasn't found, try if we can find it in the default Homebrew location
|
||||
if((NOT OPENMP_FOUND) AND (NOT OPENMP_CXX_FOUND) AND EXISTS "/usr/local/opt/libomp/lib/libomp.dylib")
|
||||
set(OpenMP_CXX_FLAGS "-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include")
|
||||
set(OpenMP_CXX_LIB_NAMES omp)
|
||||
set(OpenMP_omp_LIBRARY /usr/local/opt/libomp/lib/libomp.dylib)
|
||||
|
||||
find_package(OpenMP)
|
||||
if (OPENMP_FOUND OR OPENMP_CXX_FOUND)
|
||||
message(STATUS "Found libomp in homebrew default location.")
|
||||
else()
|
||||
message(FATAL_ERROR "Didn't find libomp. Tried homebrew default location but also didn't find it.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(Additional_OpenMP_Libraries_Workaround "")
|
||||
|
||||
# Workaround because older cmake on apple doesn't support FindOpenMP
|
||||
if((NOT OPENMP_FOUND) AND (NOT OPENMP_CXX_FOUND))
|
||||
if((APPLE AND ((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")))
|
||||
AND ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0") AND (CMAKE_VERSION VERSION_LESS "3.12.0")))
|
||||
message(STATUS "Applying workaround for OSX OpenMP with old cmake that doesn't have FindOpenMP")
|
||||
set(OpenMP_CXX_FLAGS "-Xclang -fopenmp")
|
||||
set(Additional_OpenMP_Libraries_Workaround "-lomp")
|
||||
else()
|
||||
message(FATAL_ERROR "Did not find OpenMP. Build with -DDISABLE_OPENMP=ON if you want to allow this and are willing to take the performance hit.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT TARGET OpenMP::OpenMP_CXX)
|
||||
# We're on cmake < 3.9, handle behavior of the old FindOpenMP implementation
|
||||
message(STATUS "Applying workaround for old CMake that doesn't define FindOpenMP using targets")
|
||||
add_library(OpenMP_TARGET INTERFACE)
|
||||
add_library(OpenMP::OpenMP_CXX ALIAS OpenMP_TARGET)
|
||||
target_compile_options(OpenMP_TARGET INTERFACE ${OpenMP_CXX_FLAGS}) # add to all targets depending on this
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(OpenMP_TARGET INTERFACE Threads::Threads)
|
||||
target_link_libraries(OpenMP_TARGET INTERFACE ${OpenMP_CXX_FLAGS} ${Additional_OpenMP_Libraries_Workaround})
|
||||
endif()
|
||||
|
||||
target_link_libraries(cryptopp INTERFACE ${OpenMP_CXX_FLAGS}) # Workaround for Ubuntu 18.04 that otherwise doesn't set -fopenmp for linking
|
||||
target_link_libraries(cryptopp INTERFACE OpenMP::OpenMP_CXX)
|
||||
|
||||
# also add these flags to the third party Crypto++ build setup that is built in a subdirectory
|
||||
message(STATUS "OpenMP flags: ${OpenMP_CXX_FLAGS}")
|
||||
string(REPLACE " " ";" REPLACED_FLAGS ${OpenMP_CXX_FLAGS})
|
||||
add_compile_options(${REPLACED_FLAGS})
|
||||
else()
|
||||
message(WARNING "OpenMP is disabled. This can cause degraded performance.")
|
||||
if (NOT DISABLE_OPENMP)
|
||||
set(USE_OPENMP ON CACHE BOOL "")
|
||||
endif()
|
||||
|
||||
|
||||
set(CRYPTOPP_BUILD_TESTING OFF CACHE BOOL "")
|
||||
set(BUILD_DOCUMENTATION OFF CACHE BOOL "")
|
||||
set(BUILD_SHARED OFF CACHE BOOL "")
|
||||
|
2
vendor/cryptopp/vendor_cryptopp/.gitignore
vendored
2
vendor/cryptopp/vendor_cryptopp/.gitignore
vendored
@ -3,7 +3,7 @@
|
||||
# Allows you to use test.cxx and
|
||||
# avoid getting in the way of things
|
||||
####################################
|
||||
#*.cxx
|
||||
*.cxx
|
||||
|
||||
####################
|
||||
## Crypto++ specific
|
||||
|
241
vendor/cryptopp/vendor_cryptopp/CMakeLists.txt
vendored
241
vendor/cryptopp/vendor_cryptopp/CMakeLists.txt
vendored
@ -12,10 +12,10 @@
|
||||
# SET(CMAKE_C_COMPILER ${CMAKE_CXX_COMPILER})
|
||||
# # error "The CMAKE_C_COMPILER is set to a C++ compiler"
|
||||
|
||||
if(NOT DEFINED cryptocpp_DISPLAY_CMAKE_SUPPORT_WARNING)
|
||||
set(cryptocpp_DISPLAY_CMAKE_SUPPORT_WARNING 1)
|
||||
if(NOT DEFINED cryptopp_DISPLAY_CMAKE_SUPPORT_WARNING)
|
||||
set(cryptopp_DISPLAY_CMAKE_SUPPORT_WARNING 1)
|
||||
endif()
|
||||
if(cryptocpp_DISPLAY_CMAKE_SUPPORT_WARNING)
|
||||
if(cryptopp_DISPLAY_CMAKE_SUPPORT_WARNING)
|
||||
message( STATUS
|
||||
"*************************************************************************\n"
|
||||
"The Crypto++ library does not officially support CMake. CMake support is a\n"
|
||||
@ -28,17 +28,19 @@ endif()
|
||||
|
||||
# Print useful information
|
||||
message( STATUS "CMake version ${CMAKE_VERSION}" )
|
||||
message( STATUS "System ${CMAKE_SYSTEM_NAME}" )
|
||||
message( STATUS "Processor ${CMAKE_SYSTEM_PROCESSOR}" )
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.6)
|
||||
cmake_policy(SET CMP0069 NEW)
|
||||
if (${CMAKE_VERSION} VERSION_LESS "3.0.0")
|
||||
project(cryptopp)
|
||||
set(cryptopp_VERSION_MAJOR 8)
|
||||
set(cryptopp_VERSION_MINOR 5)
|
||||
set(cryptopp_VERSION_MINOR 6)
|
||||
set(cryptopp_VERSION_PATCH 0)
|
||||
else ()
|
||||
cmake_policy(SET CMP0048 NEW)
|
||||
project(cryptopp VERSION 8.3.0)
|
||||
project(cryptopp VERSION 8.6.0)
|
||||
if (NOT ${CMAKE_VERSION} VERSION_LESS "3.1.0")
|
||||
cmake_policy(SET CMP0054 NEW)
|
||||
endif ()
|
||||
@ -61,10 +63,10 @@ endif ()
|
||||
include(GNUInstallDirs)
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
# We now carry around test programs. test_cxx.cxx is the default C++ one.
|
||||
# We now carry around test programs. test_cxx.cpp is the default C++ one.
|
||||
# Also see https://github.com/weidai11/cryptopp/issues/741.
|
||||
set(TEST_PROG_DIR ${SRC_DIR}/TestPrograms)
|
||||
set(TEST_CXX_FILE ${TEST_PROG_DIR}/test_cxx.cxx)
|
||||
set(TEST_CXX_FILE ${TEST_PROG_DIR}/test_cxx.cpp)
|
||||
|
||||
#============================================================================
|
||||
# Settable options
|
||||
@ -76,14 +78,36 @@ option(CRYPTOPP_BUILD_TESTING "Build library tests" ON)
|
||||
option(BUILD_DOCUMENTATION "Use Doxygen to create the HTML based API documentation" OFF)
|
||||
option(USE_INTERMEDIATE_OBJECTS_TARGET "Use a common intermediate objects target for the static and shared library targets" ON)
|
||||
|
||||
# These are IA-32 options. TODO: Add ARM A-32, Aarch64 and Power8 options.
|
||||
if (${CMAKE_VERSION} VERSION_GREATER "3.1")
|
||||
option(USE_OPENMP "Enable OpenMP to parallelize some of the algorithms. Note that this isn't always faster, see https://www.cryptopp.com/wiki/OpenMP" OFF)
|
||||
endif()
|
||||
|
||||
|
||||
# These are IA-32 options.
|
||||
option(DISABLE_ASM "Disable ASM" OFF)
|
||||
option(DISABLE_SSSE3 "Disable SSSE3" OFF)
|
||||
option(DISABLE_SSE4 "Disable SSE4" OFF)
|
||||
option(DISABLE_AESNI "Disable AES-NI" OFF)
|
||||
option(DISABLE_CLMUL "Disable CLMUL" OFF)
|
||||
option(DISABLE_SHA "Disable SHA" OFF)
|
||||
option(DISABLE_AVX "Disable AVX" OFF)
|
||||
option(DISABLE_AVX2 "Disable AVX2" OFF)
|
||||
|
||||
# These are ARM A-32 options
|
||||
option(DISABLE_ARM_NEON "Disable NEON" OFF)
|
||||
|
||||
# These are Aarch64 options
|
||||
option(DISABLE_ARM_AES "Disable ASIMD" OFF)
|
||||
option(DISABLE_ARM_AES "Disable AES" OFF)
|
||||
option(DISABLE_ARM_PMULL "Disable PMULL" OFF)
|
||||
option(DISABLE_ARM_SHA "Disable SHA" OFF)
|
||||
|
||||
# These are PowerPC options
|
||||
option(DISABLE_ALTIVEC "Disable Altivec" OFF)
|
||||
option(DISABLE_POWER7 "Disable POWER7" OFF)
|
||||
option(DISABLE_POWER8 "Disable POWER8" OFF)
|
||||
option(DISABLE_POWER9 "Disable POWER9" OFF)
|
||||
|
||||
set(CRYPTOPP_DATA_DIR "" CACHE PATH "Crypto++ test data directory")
|
||||
|
||||
#============================================================================
|
||||
@ -94,14 +118,16 @@ set(CRYPTOPP_COMPILE_DEFINITIONS)
|
||||
set(CRYPTOPP_COMPILE_OPTIONS)
|
||||
|
||||
# Stop hiding the damn output...
|
||||
# set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
# set(CMAKE_VERBOSE_MAKEFILE ON)
|
||||
|
||||
# Stop CMake complaining...
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
set(MACOSX_RPATH FALSE)
|
||||
endif()
|
||||
|
||||
# Always 1 ahead in Master. Also see http://groups.google.com/forum/#!topic/cryptopp-users/SFhqLDTQPG4
|
||||
set(LIB_VER ${cryptopp_VERSION_MAJOR}${cryptopp_VERSION_MINOR}${cryptopp_VERSION_PATCH})
|
||||
|
||||
# Don't use RPATH's. The resulting binary could fail a security audit.
|
||||
set(CMAKE_MACOSX_RPATH 0)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
list(APPEND CRYPTOPP_COMPILE_OPTIONS -wd68 -wd186 -wd279 -wd327 -wd161 -wd3180)
|
||||
endif ()
|
||||
@ -137,6 +163,21 @@ endif ()
|
||||
if (DISABLE_SHA)
|
||||
list(APPEND CRYPTOPP_COMPILE_DEFINITIONS CRYPTOPP_DISABLE_SHA)
|
||||
endif ()
|
||||
if (DISABLE_ARM_NEON)
|
||||
list(APPEND CRYPTOPP_COMPILE_DEFINITIONS CRYPTOPP_DISABLE_ARM_NEON)
|
||||
endif ()
|
||||
if (DISABLE_ARM_ASIMD)
|
||||
list(APPEND CRYPTOPP_COMPILE_DEFINITIONS CRYPTOPP_DISABLE_ARM_ASIMD)
|
||||
endif ()
|
||||
if (DISABLE_ARM_AES)
|
||||
list(APPEND CRYPTOPP_COMPILE_DEFINITIONS CRYPTOPP_DISABLE_ARM_AES)
|
||||
endif ()
|
||||
if (DISABLE_ARM_PMULL)
|
||||
list(APPEND CRYPTOPP_COMPILE_DEFINITIONS CRYPTOPP_DISABLE_ARM_PMULL)
|
||||
endif ()
|
||||
if (DISABLE_ARM_SHA)
|
||||
list(APPEND CRYPTOPP_COMPILE_DEFINITIONS CRYPTOPP_DISABLE_ARM_SHA)
|
||||
endif ()
|
||||
if (DISABLE_ALTIVEC)
|
||||
list(APPEND CRYPTOPP_COMPILE_DEFINITIONS CRYPTOPP_DISABLE_ALTIVEC)
|
||||
endif ()
|
||||
@ -295,12 +336,12 @@ function(DumpMachine output pattern)
|
||||
|
||||
endfunction(DumpMachine)
|
||||
|
||||
# Thansk to Anonimal for MinGW; see http://github.com/weidai11/cryptopp/issues/466
|
||||
# Thanks to Anonimal for MinGW; see http://github.com/weidai11/cryptopp/issues/466
|
||||
DumpMachine(CRYPTOPP_AMD64 "(x86_64|AMD64|amd64)")
|
||||
DumpMachine(CRYPTOPP_I386 "^i.86$")
|
||||
DumpMachine(CRYPTOPP_MINGW32 "^mingw32")
|
||||
DumpMachine(CRYPTOPP_MINGW64 "(w64-mingw32)|(mingw64)")
|
||||
DumpMachine(CRYPTOPP_ARMV8 "(armv8|aarch32|aarch64)")
|
||||
DumpMachine(CRYPTOPP_MINGW64 "(w64-mingw32|mingw64)")
|
||||
DumpMachine(CRYPTOPP_ARMV8 "(armv8|arm64|aarch32|aarch64)")
|
||||
DumpMachine(CRYPTOPP_ARM32 "(arm|armhf|arm7l|eabihf)")
|
||||
DumpMachine(CRYPTOPP_PPC32 "^(powerpc|ppc)")
|
||||
DumpMachine(CRYPTOPP_PPC64 "^ppc64")
|
||||
@ -549,30 +590,44 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU
|
||||
|
||||
if (CRYPTOPP_AMD64 OR CRYPTOPP_I386)
|
||||
|
||||
# For Darwin and a GCC port compiler, we need to check for -Wa,-q first. -Wa,-q
|
||||
# is a GCC option, and it tells GCC to use the Clang Integrated Assembler. We
|
||||
# need LLVM's assembler because GAS is too old on Apple platforms. GAS will
|
||||
# not assemble modern ISA, like AVX or AVX2.
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
CheckCompileLinkOption("-Wa,-q" CRYPTOPP_IA32_WAQ
|
||||
"${TEST_PROG_DIR}/test_x86_sse2.cpp")
|
||||
|
||||
if (CRYPTOPP_IA32_WAQ)
|
||||
list(APPEND CRYPTOPP_COMPILE_OPTIONS "-Wa,-q")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
# Now we can move on to normal feature testing.
|
||||
CheckCompileLinkOption("-msse2" CRYPTOPP_IA32_SSE2
|
||||
"${TEST_PROG_DIR}/test_x86_sse2.cxx")
|
||||
"${TEST_PROG_DIR}/test_x86_sse2.cpp")
|
||||
CheckCompileLinkOption("-mssse3" CRYPTOPP_IA32_SSSE3
|
||||
"${TEST_PROG_DIR}/test_x86_ssse3.cxx")
|
||||
"${TEST_PROG_DIR}/test_x86_ssse3.cpp")
|
||||
CheckCompileLinkOption("-msse4.1" CRYPTOPP_IA32_SSE41
|
||||
"${TEST_PROG_DIR}/test_x86_sse41.cxx")
|
||||
"${TEST_PROG_DIR}/test_x86_sse41.cpp")
|
||||
CheckCompileLinkOption("-msse4.2" CRYPTOPP_IA32_SSE42
|
||||
"${TEST_PROG_DIR}/test_x86_sse42.cxx")
|
||||
"${TEST_PROG_DIR}/test_x86_sse42.cpp")
|
||||
CheckCompileLinkOption("-mssse3 -mpclmul" CRYPTOPP_IA32_CLMUL
|
||||
"${TEST_PROG_DIR}/test_x86_clmul.cxx")
|
||||
"${TEST_PROG_DIR}/test_x86_clmul.cpp")
|
||||
CheckCompileLinkOption("-msse4.1 -maes" CRYPTOPP_IA32_AES
|
||||
"${TEST_PROG_DIR}/test_x86_aes.cxx")
|
||||
"${TEST_PROG_DIR}/test_x86_aes.cpp")
|
||||
CheckCompileLinkOption("-mavx" CRYPTOPP_IA32_AVX
|
||||
"${TEST_PROG_DIR}/test_x86_avx.cxx")
|
||||
"${TEST_PROG_DIR}/test_x86_avx.cpp")
|
||||
CheckCompileLinkOption("-mavx2" CRYPTOPP_IA32_AVX2
|
||||
"${TEST_PROG_DIR}/test_x86_avx2.cxx")
|
||||
"${TEST_PROG_DIR}/test_x86_avx2.cpp")
|
||||
CheckCompileLinkOption("-msse4.2 -msha" CRYPTOPP_IA32_SHA
|
||||
"${TEST_PROG_DIR}/test_x86_sha.cxx")
|
||||
if (EXISTS "${TEST_PROG_DIR}/test_asm_mixed.cxx")
|
||||
"${TEST_PROG_DIR}/test_x86_sha.cpp")
|
||||
if (EXISTS "${TEST_PROG_DIR}/test_asm_mixed.cpp")
|
||||
CheckCompileLinkOption("" CRYPTOPP_MIXED_ASM
|
||||
"${TEST_PROG_DIR}/test_asm_mixed.cxx")
|
||||
"${TEST_PROG_DIR}/test_asm_mixed.cpp")
|
||||
else ()
|
||||
CheckCompileLinkOption("" CRYPTOPP_MIXED_ASM
|
||||
"${TEST_PROG_DIR}/test_mixed_asm.cxx")
|
||||
"${TEST_PROG_DIR}/test_mixed_asm.cpp")
|
||||
endif ()
|
||||
|
||||
# https://github.com/weidai11/cryptopp/issues/756
|
||||
@ -594,6 +649,8 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU
|
||||
set_source_files_properties(${SRC_DIR}/cham_simd.cpp PROPERTIES COMPILE_FLAGS "-mssse3")
|
||||
set_source_files_properties(${SRC_DIR}/keccak_simd.cpp PROPERTIES COMPILE_FLAGS "-mssse3")
|
||||
set_source_files_properties(${SRC_DIR}/lea_simd.cpp PROPERTIES COMPILE_FLAGS "-mssse3")
|
||||
set_source_files_properties(${SRC_DIR}/lsh256_sse.cpp PROPERTIES COMPILE_FLAGS "-mssse3")
|
||||
set_source_files_properties(${SRC_DIR}/lsh512_sse.cpp PROPERTIES COMPILE_FLAGS "-mssse3")
|
||||
set_source_files_properties(${SRC_DIR}/simon128_simd.cpp PROPERTIES COMPILE_FLAGS "-mssse3")
|
||||
set_source_files_properties(${SRC_DIR}/speck128_simd.cpp PROPERTIES COMPILE_FLAGS "-mssse3")
|
||||
if (NOT CRYPTOPP_IA32_SSE41 AND NOT DISABLE_SSE4)
|
||||
@ -627,6 +684,8 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU
|
||||
list(APPEND CRYPTOPP_COMPILE_OPTIONS "-DCRYPTOPP_DISABLE_AVX2")
|
||||
elseif (CRYPTOPP_IA32_AVX2 AND NOT DISABLE_AVX2)
|
||||
set_source_files_properties(${SRC_DIR}/chacha_avx.cpp PROPERTIES COMPILE_FLAGS "-mavx2")
|
||||
set_source_files_properties(${SRC_DIR}/lsh256_avx.cpp PROPERTIES COMPILE_FLAGS "-mavx2")
|
||||
set_source_files_properties(${SRC_DIR}/lsh512_avx.cpp PROPERTIES COMPILE_FLAGS "-mavx2")
|
||||
endif ()
|
||||
if (NOT CRYPTOPP_IA32_SHA AND NOT DISABLE_SHA)
|
||||
list(APPEND CRYPTOPP_COMPILE_OPTIONS "-DCRYPTOPP_DISABLE_SHANI")
|
||||
@ -641,7 +700,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU
|
||||
|
||||
# This checks for <arm_acle.h>
|
||||
CheckCompileLinkOption("-march=armv8-a" CRYPTOPP_ARM_ACLE_HEADER
|
||||
"${TEST_PROG_DIR}/test_arm_acle_header.cxx")
|
||||
"${TEST_PROG_DIR}/test_arm_acle_header.cpp")
|
||||
|
||||
# Use <arm_acle.h> if available
|
||||
if (CRYPTOPP_ARM_NEON_HEADER)
|
||||
@ -664,9 +723,13 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU
|
||||
set_source_files_properties(${SRC_DIR}/neon_simd.cpp PROPERTIES COMPILE_FLAGS "-march=armv8-a")
|
||||
set_source_files_properties(${SRC_DIR}/simon128_simd.cpp PROPERTIES COMPILE_FLAGS "-march=armv8-a")
|
||||
set_source_files_properties(${SRC_DIR}/speck128_simd.cpp PROPERTIES COMPILE_FLAGS "-march=armv8-a")
|
||||
else ()
|
||||
list(APPEND CRYPTOPP_COMPILE_OPTIONS "-DCRYPTOPP_DISABLE_ARM_ASIMD")
|
||||
endif ()
|
||||
if (CRYPTOPP_ARMV8A_CRC)
|
||||
set_source_files_properties(${SRC_DIR}/crc_simd.cpp PROPERTIES COMPILE_FLAGS "-march=armv8-a+crc")
|
||||
else ()
|
||||
list(APPEND CRYPTOPP_COMPILE_OPTIONS "-DCRYPTOPP_DISABLE_ARM_CRC32")
|
||||
endif ()
|
||||
if (CRYPTOPP_ARMV8A_CRYPTO)
|
||||
set_source_files_properties(${SRC_DIR}/gcm_simd.cpp PROPERTIES COMPILE_FLAGS "-march=armv8-a+crypto")
|
||||
@ -674,21 +737,25 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU
|
||||
set_source_files_properties(${SRC_DIR}/rijndael_simd.cpp PROPERTIES COMPILE_FLAGS "-march=armv8-a+crypto")
|
||||
set_source_files_properties(${SRC_DIR}/sha_simd.cpp PROPERTIES COMPILE_FLAGS "-march=armv8-a+crypto")
|
||||
set_source_files_properties(${SRC_DIR}/shacal2_simd.cpp PROPERTIES COMPILE_FLAGS "-march=armv8-a+crypto")
|
||||
else ()
|
||||
list(APPEND CRYPTOPP_COMPILE_OPTIONS "-DCRYPTOPP_DISABLE_ARM_AES")
|
||||
list(APPEND CRYPTOPP_COMPILE_OPTIONS "-DCRYPTOPP_DISABLE_ARM_PMULL")
|
||||
list(APPEND CRYPTOPP_COMPILE_OPTIONS "-DCRYPTOPP_DISABLE_ARM_SHA")
|
||||
endif ()
|
||||
|
||||
elseif (CRYPTOPP_ARM32)
|
||||
|
||||
# This checks for <arm_neon.h>
|
||||
CheckCompileLinkOption("-march=armv7-a -mfpu=neon" CRYPTOPP_ARM_NEON_HEADER
|
||||
"${TEST_PROG_DIR}/test_arm_neon_header.cxx")
|
||||
"${TEST_PROG_DIR}/test_arm_neon_header.cpp")
|
||||
|
||||
# Use <arm_neon.h> if available
|
||||
if (CRYPTOPP_ARM_NEON_HEADER)
|
||||
CheckCompileLinkOption("-march=armv7-a -mfpu=neon -DCRYPTOPP_ARM_NEON_HEADER=1" CRYPTOPP_ARMV7A_NEON
|
||||
"${TEST_PROG_DIR}/test_arm_neon.cxx")
|
||||
"${TEST_PROG_DIR}/test_arm_neon.cpp")
|
||||
else ()
|
||||
CheckCompileLinkOption("-march=armv7-a -mfpu=neon" CRYPTOPP_ARMV7A_NEON
|
||||
"${TEST_PROG_DIR}/test_arm_neon.cxx")
|
||||
"${TEST_PROG_DIR}/test_arm_neon.cpp")
|
||||
endif ()
|
||||
|
||||
if (CRYPTOPP_ARMV7A_NEON)
|
||||
@ -732,7 +799,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU
|
||||
set_source_files_properties(${SRC_DIR}/speck128_simd.cpp PROPERTIES COMPILE_FLAGS "-march=armv7-a -mfpu=neon")
|
||||
set_source_files_properties(${SRC_DIR}/sm4_simd.cpp PROPERTIES COMPILE_FLAGS "-march=armv7-a -mfpu=neon")
|
||||
else ()
|
||||
list(APPEND CRYPTOPP_COMPILE_OPTIONS "-DCRYPTOPP_ARM_NEON_AVAILABLE=0")
|
||||
list(APPEND CRYPTOPP_COMPILE_OPTIONS "-DCRYPTOPP_DISABLE_ARM_NEON")
|
||||
endif ()
|
||||
|
||||
elseif (CRYPTOPP_PPC32 OR CRYPTOPP_PPC64)
|
||||
@ -757,13 +824,13 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU
|
||||
endif ()
|
||||
|
||||
CheckCompileLinkOption("${CRYPTOPP_ALTIVEC_FLAGS}" PPC_ALTIVEC_FLAG
|
||||
"${TEST_PROG_DIR}/test_ppc_altivec.cxx")
|
||||
"${TEST_PROG_DIR}/test_ppc_altivec.cpp")
|
||||
|
||||
# Hack for XLC. Find the lowest PWR architecture.
|
||||
if (CMAKE_CXX_COMPILER MATCHES "xlC")
|
||||
if (NOT PPC_ALTIVEC_FLAG)
|
||||
CheckCompileLinkOption("${CRYPTOPP_POWER4_FLAGS}" PPC_POWER4_FLAG
|
||||
"${TEST_PROG_DIR}/test_ppc_altivec.cxx")
|
||||
"${TEST_PROG_DIR}/test_ppc_altivec.cpp")
|
||||
if (PPC_POWER4_FLAG)
|
||||
set(PPC_ALTIVEC_FLAG 1)
|
||||
set(CRYPTOPP_ALTIVEC_FLAGS "${CRYPTOPP_POWER4_FLAGS}")
|
||||
@ -771,7 +838,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU
|
||||
endif ()
|
||||
if (NOT PPC_ALTIVEC_FLAG)
|
||||
CheckCompileLinkOption("${CRYPTOPP_POWER5_FLAGS}" PPC_POWER5_FLAG
|
||||
"${TEST_PROG_DIR}/test_ppc_altivec.cxx")
|
||||
"${TEST_PROG_DIR}/test_ppc_altivec.cpp")
|
||||
if (PPC_POWER5_FLAG)
|
||||
set(PPC_ALTIVEC_FLAG 1)
|
||||
set(CRYPTOPP_ALTIVEC_FLAGS "${CRYPTOPP_POWER5_FLAGS}")
|
||||
@ -779,7 +846,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU
|
||||
endif ()
|
||||
if (NOT PPC_ALTIVEC_FLAG)
|
||||
CheckCompileLinkOption("${CRYPTOPP_POWER6_FLAGS}" PPC_POWER6_FLAG
|
||||
"${TEST_PROG_DIR}/test_ppc_altivec.cxx")
|
||||
"${TEST_PROG_DIR}/test_ppc_altivec.cpp")
|
||||
if (PPC_POWER6_FLAG)
|
||||
set(PPC_ALTIVEC_FLAG 1)
|
||||
set(CRYPTOPP_ALTIVEC_FLAGS "${CRYPTOPP_POWER6_FLAGS}")
|
||||
@ -789,23 +856,23 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU
|
||||
|
||||
# Hack for XLC and GCC. Find the right combination for PWR7 and the VSX unit.
|
||||
CheckCompileLinkOption("${CRYPTOPP_POWER7_VSX_FLAGS}" PPC_POWER7_FLAG
|
||||
"${TEST_PROG_DIR}/test_ppc_power7.cxx")
|
||||
"${TEST_PROG_DIR}/test_ppc_power7.cpp")
|
||||
if (PPC_POWER7_FLAG)
|
||||
set (CRYPTOPP_POWER7_FLAGS "${CRYPTOPP_POWER7_VSX_FLAGS}")
|
||||
else ()
|
||||
CheckCompileLinkOption("${CRYPTOPP_POWER7_PWR_FLAGS}" PPC_POWER7_FLAG
|
||||
"${TEST_PROG_DIR}/test_ppc_power7.cxx")
|
||||
"${TEST_PROG_DIR}/test_ppc_power7.cpp")
|
||||
if (PPC_POWER7_FLAG)
|
||||
set (CRYPTOPP_POWER7_FLAGS "${CRYPTOPP_POWER7_PWR_FLAGS}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
CheckCompileLinkOption("${CRYPTOPP_POWER8_FLAGS}" PPC_POWER8_FLAG
|
||||
"${TEST_PROG_DIR}/test_ppc_power8.cxx")
|
||||
"${TEST_PROG_DIR}/test_ppc_power8.cpp")
|
||||
|
||||
# Disable POWER9 due to https://github.com/weidai11/cryptopp/issues/986.
|
||||
#CheckCompileLinkOption("${CRYPTOPP_POWER9_FLAGS}" PPC_POWER9_FLAG
|
||||
# "${TEST_PROG_DIR}/test_ppc_power9.cxx")
|
||||
# "${TEST_PROG_DIR}/test_ppc_power9.cpp")
|
||||
|
||||
#if (PPC_POWER9_FLAG AND NOT DISABLE_POWER9)
|
||||
# set_source_files_properties(${SRC_DIR}/ppc_power9.cpp PROPERTIES COMPILE_FLAGS ${CRYPTOPP_POWER9_FLAGS})
|
||||
@ -863,23 +930,23 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
|
||||
if (CRYPTOPP_AMD64 OR CRYPTOPP_I386)
|
||||
|
||||
CheckCompileLinkOption("-xarch=sse2" CRYPTOPP_IA32_SSE2
|
||||
"${TEST_PROG_DIR}/test_x86_sse2.cxx")
|
||||
"${TEST_PROG_DIR}/test_x86_sse2.cpp")
|
||||
CheckCompileLinkOption("-xarch=ssse3" CRYPTOPP_IA32_SSSE3
|
||||
"${TEST_PROG_DIR}/test_x86_ssse3.cxx")
|
||||
"${TEST_PROG_DIR}/test_x86_ssse3.cpp")
|
||||
CheckCompileLinkOption("-xarch=sse4_1" CRYPTOPP_IA32_SSE41
|
||||
"${TEST_PROG_DIR}/test_x86_sse41.cxx")
|
||||
"${TEST_PROG_DIR}/test_x86_sse41.cpp")
|
||||
CheckCompileLinkOption("-xarch=sse4_2" CRYPTOPP_IA32_SSE42
|
||||
"${TEST_PROG_DIR}/test_x86_sse42.cxx")
|
||||
"${TEST_PROG_DIR}/test_x86_sse42.cpp")
|
||||
CheckCompileLinkOption("-xarch=aes" CRYPTOPP_IA32_CLMUL
|
||||
"${TEST_PROG_DIR}/test_x86_clmul.cxx")
|
||||
"${TEST_PROG_DIR}/test_x86_clmul.cpp")
|
||||
CheckCompileLinkOption("-xarch=aes" CRYPTOPP_IA32_AES
|
||||
"${TEST_PROG_DIR}/test_x86_aes.cxx")
|
||||
"${TEST_PROG_DIR}/test_x86_aes.cpp")
|
||||
CheckCompileLinkOption("-xarch=avx" CRYPTOPP_IA32_AVX
|
||||
"${TEST_PROG_DIR}/test_x86_avx.cxx")
|
||||
"${TEST_PROG_DIR}/test_x86_avx.cpp")
|
||||
CheckCompileLinkOption("-xarch=avx2" CRYPTOPP_IA32_AVX2
|
||||
"${TEST_PROG_DIR}/test_x86_avx2.cxx")
|
||||
"${TEST_PROG_DIR}/test_x86_avx2.cpp")
|
||||
CheckCompileLinkOption("-xarch=sha" CRYPTOPP_IA32_SHA
|
||||
"${TEST_PROG_DIR}/test_x86_sha.cxx")
|
||||
"${TEST_PROG_DIR}/test_x86_sha.cpp")
|
||||
|
||||
# Each -xarch=XXX options must be added to LDFLAGS if the option is used during a compile.
|
||||
set(XARCH_LDFLAGS "")
|
||||
@ -1054,6 +1121,80 @@ if (BUILD_SHARED)
|
||||
target_link_libraries(cryptopp-shared ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif ()
|
||||
|
||||
|
||||
#============================================================================
|
||||
# Setup OpenMP
|
||||
#============================================================================
|
||||
if (${CMAKE_VERSION} VERSION_GREATER "3.1" AND USE_OPENMP)
|
||||
find_package(OpenMP)
|
||||
|
||||
if (OPENMP_FOUND OR OPENMP_CXX_FOUND)
|
||||
message(STATUS "OpenMP: Found libomp without any special flags")
|
||||
endif()
|
||||
|
||||
# If OpenMP wasn't found, try if we can find it in the default Macports location
|
||||
if((NOT OPENMP_FOUND) AND (NOT OPENMP_CXX_FOUND) AND EXISTS "/opt/local/lib/libomp/libomp.dylib") # older cmake uses OPENMP_FOUND, newer cmake also sets OPENMP_CXX_FOUND, homebrew installations seem only to get the latter set.
|
||||
set(OpenMP_CXX_FLAGS "-Xpreprocessor -fopenmp -I/opt/local/include/libomp/")
|
||||
set(OpenMP_CXX_LIB_NAMES omp)
|
||||
set(OpenMP_omp_LIBRARY /opt/local/lib/libomp/libomp.dylib)
|
||||
|
||||
find_package(OpenMP)
|
||||
if (OPENMP_FOUND OR OPENMP_CXX_FOUND)
|
||||
message(STATUS "OpenMP: Found libomp in macports default location.")
|
||||
else()
|
||||
message(FATAL_ERROR "OpenMP: Didn't find libomp. Tried macports default location but also didn't find it.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# If OpenMP wasn't found, try if we can find it in the default Homebrew location
|
||||
if((NOT OPENMP_FOUND) AND (NOT OPENMP_CXX_FOUND) AND EXISTS "/usr/local/opt/libomp/lib/libomp.dylib")
|
||||
set(OpenMP_CXX_FLAGS "-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include")
|
||||
set(OpenMP_CXX_LIB_NAMES omp)
|
||||
set(OpenMP_omp_LIBRARY /usr/local/opt/libomp/lib/libomp.dylib)
|
||||
|
||||
find_package(OpenMP)
|
||||
if (OPENMP_FOUND OR OPENMP_CXX_FOUND)
|
||||
message(STATUS "OpenMP: Found libomp in homebrew default location.")
|
||||
else()
|
||||
message(FATAL_ERROR "OpenMP: Didn't find libomp. Tried homebrew default location but also didn't find it.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(Additional_OpenMP_Libraries_Workaround "")
|
||||
|
||||
# Workaround because older cmake on apple doesn't support FindOpenMP
|
||||
if((NOT OPENMP_FOUND) AND (NOT OPENMP_CXX_FOUND))
|
||||
if((APPLE AND ((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")))
|
||||
AND ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0") AND (CMAKE_VERSION VERSION_LESS "3.12.0")))
|
||||
message(STATUS "OpenMP: Applying workaround for OSX OpenMP with old cmake that doesn't have FindOpenMP")
|
||||
set(OpenMP_CXX_FLAGS "-Xclang -fopenmp")
|
||||
set(Additional_OpenMP_Libraries_Workaround "-lomp")
|
||||
else()
|
||||
message(FATAL_ERROR "OpenMP: Did not find OpenMP. Build without USE_OPENMP if you want to allow this.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT TARGET OpenMP::OpenMP_CXX)
|
||||
# We're on cmake < 3.9, handle behavior of the old FindOpenMP implementation
|
||||
message(STATUS "OpenMP: Applying workaround for old CMake that doesn't define FindOpenMP using targets")
|
||||
add_library(OpenMP_TARGET INTERFACE)
|
||||
add_library(OpenMP::OpenMP_CXX ALIAS OpenMP_TARGET)
|
||||
target_compile_options(OpenMP_TARGET INTERFACE ${OpenMP_CXX_FLAGS}) # add to all targets depending on this
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(OpenMP_TARGET INTERFACE Threads::Threads)
|
||||
target_link_libraries(OpenMP_TARGET INTERFACE ${OpenMP_CXX_FLAGS} ${Additional_OpenMP_Libraries_Workaround})
|
||||
endif()
|
||||
|
||||
if (BUILD_STATIC)
|
||||
target_link_libraries(cryptopp-static ${OpenMP_CXX_FLAGS}) # Workaround for Ubuntu 18.04 that otherwise doesn't set -fopenmp for linking
|
||||
target_link_libraries(cryptopp-static OpenMP::OpenMP_CXX)
|
||||
endif()
|
||||
if (BUILD_SHARED)
|
||||
target_link_libraries(cryptopp-shared ${OpenMP_CXX_FLAGS}) # Workaround for Ubuntu 18.04 that otherwise doesn't set -fopenmp for linking
|
||||
target_link_libraries(cryptopp-shared OpenMP::OpenMP_CXX)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#============================================================================
|
||||
# Tests
|
||||
#============================================================================
|
||||
@ -1170,7 +1311,7 @@ elseif (CRYPTOPP_PPC64)
|
||||
message(STATUS "Platform: PowerPC-64")
|
||||
elseif (CRYPTOPP_MINGW32)
|
||||
message(STATUS "Platform: MinGW-32")
|
||||
elseif (CRYPTOPP_MINGW32)
|
||||
elseif (CRYPTOPP_MINGW64)
|
||||
message(STATUS "Platform: MinGW-64")
|
||||
endif ()
|
||||
if (CRYPTOPP_ARMV7A_NEON)
|
||||
|
2
vendor/cryptopp/vendor_cryptopp/Doxyfile
vendored
2
vendor/cryptopp/vendor_cryptopp/Doxyfile
vendored
@ -38,7 +38,7 @@ PROJECT_NAME = Crypto++
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 8.5
|
||||
PROJECT_NUMBER = 8.6
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
141
vendor/cryptopp/vendor_cryptopp/Filelist.txt
vendored
141
vendor/cryptopp/vendor_cryptopp/Filelist.txt
vendored
@ -204,6 +204,13 @@ lubyrack.h
|
||||
lea.cpp
|
||||
lea_simd.cpp
|
||||
lea.h
|
||||
lsh256.cpp
|
||||
lsh256_sse.cpp
|
||||
lsh256_avx.cpp
|
||||
lsh512.cpp
|
||||
lsh512_sse.cpp
|
||||
lsh512_avx.cpp
|
||||
lsh.h
|
||||
luc.cpp
|
||||
luc.h
|
||||
mars.cpp
|
||||
@ -525,6 +532,10 @@ TestVectors/hmac.txt
|
||||
TestVectors/kalyna.txt
|
||||
TestVectors/keccak.txt
|
||||
TestVectors/lea.txt
|
||||
TestVectors/lsh.txt
|
||||
TestVectors/lsh256.txt
|
||||
TestVectors/lsh512.txt
|
||||
TestVectors/lsh512_256.txt
|
||||
TestVectors/mars.txt
|
||||
TestVectors/nr.txt
|
||||
TestVectors/panama.txt
|
||||
@ -572,68 +583,68 @@ TestVectors/wake.txt
|
||||
TestVectors/whrlpool.txt
|
||||
TestVectors/xchacha.txt
|
||||
TestVectors/xts.txt
|
||||
TestPrograms/test_32bit.cxx
|
||||
TestPrograms/test_64bit.cxx
|
||||
TestPrograms/test_arm_acle_header.cxx
|
||||
TestPrograms/test_arm_aes.cxx
|
||||
TestPrograms/test_arm_asimd.cxx
|
||||
TestPrograms/test_arm_crc.cxx
|
||||
TestPrograms/test_arm_neon.cxx
|
||||
TestPrograms/test_arm_neon_header.cxx
|
||||
TestPrograms/test_arm_pmull.cxx
|
||||
TestPrograms/test_arm_sha1.cxx
|
||||
TestPrograms/test_arm_sha256.cxx
|
||||
TestPrograms/test_arm_sha3.cxx
|
||||
TestPrograms/test_arm_sha512.cxx
|
||||
TestPrograms/test_arm_sm3.cxx
|
||||
TestPrograms/test_arm_sm4.cxx
|
||||
TestPrograms/test_asm_mixed.cxx
|
||||
TestPrograms/test_cxx11_alignas.cxx
|
||||
TestPrograms/test_cxx11_alignof.cxx
|
||||
TestPrograms/test_cxx11_assert.cxx
|
||||
TestPrograms/test_cxx11_atomic.cxx
|
||||
TestPrograms/test_cxx11_auto.cxx
|
||||
TestPrograms/test_cxx11_constexpr.cxx
|
||||
TestPrograms/test_cxx11.cxx
|
||||
TestPrograms/test_cxx11_deletefn.cxx
|
||||
TestPrograms/test_cxx11_staticinit.cxx
|
||||
TestPrograms/test_cxx11_enumtype.cxx
|
||||
TestPrograms/test_cxx11_initializer.cxx
|
||||
TestPrograms/test_cxx11_lambda.cxx
|
||||
TestPrograms/test_cxx11_noexcept.cxx
|
||||
TestPrograms/test_cxx11_nullptr.cxx
|
||||
TestPrograms/test_cxx11_sync.cxx
|
||||
TestPrograms/test_cxx11_vartemplates.cxx
|
||||
TestPrograms/test_cxx14.cxx
|
||||
TestPrograms/test_cxx17_assert.cxx
|
||||
TestPrograms/test_cxx17.cxx
|
||||
TestPrograms/test_cxx17_exceptions.cxx
|
||||
TestPrograms/test_cxx98_exception.cxx
|
||||
TestPrograms/test_cxx.cxx
|
||||
TestPrograms/test_glibc.cxx
|
||||
TestPrograms/test_newlib.cxx
|
||||
TestPrograms/test_ppc_aes.cxx
|
||||
TestPrograms/test_ppc_altivec.cxx
|
||||
TestPrograms/test_ppc_power7.cxx
|
||||
TestPrograms/test_ppc_power8.cxx
|
||||
TestPrograms/test_ppc_power9.cxx
|
||||
TestPrograms/test_ppc_sha.cxx
|
||||
TestPrograms/test_ppc_vmull.cxx
|
||||
TestPrograms/test_pthreads.cxx
|
||||
TestPrograms/test_x86_aes.cxx
|
||||
TestPrograms/test_x86_avx2.cxx
|
||||
TestPrograms/test_x86_avx512.cxx
|
||||
TestPrograms/test_x86_avx.cxx
|
||||
TestPrograms/test_x86_clmul.cxx
|
||||
TestPrograms/test_x86_cpuid.cxx
|
||||
TestPrograms/test_x86_rdrand.cxx
|
||||
TestPrograms/test_x86_rdseed.cxx
|
||||
TestPrograms/test_x86_sha.cxx
|
||||
TestPrograms/test_x86_sse2.cxx
|
||||
TestPrograms/test_x86_sse3.cxx
|
||||
TestPrograms/test_x86_sse41.cxx
|
||||
TestPrograms/test_x86_sse42.cxx
|
||||
TestPrograms/test_x86_ssse3.cxx
|
||||
TestPrograms/test_x86_via_aes.cxx
|
||||
TestPrograms/test_x86_via_rng.cxx
|
||||
TestPrograms/test_x86_via_sha.cxx
|
||||
TestPrograms/test_32bit.cpp
|
||||
TestPrograms/test_64bit.cpp
|
||||
TestPrograms/test_arm_acle_header.cpp
|
||||
TestPrograms/test_arm_aes.cpp
|
||||
TestPrograms/test_arm_asimd.cpp
|
||||
TestPrograms/test_arm_crc.cpp
|
||||
TestPrograms/test_arm_neon.cpp
|
||||
TestPrograms/test_arm_neon_header.cpp
|
||||
TestPrograms/test_arm_pmull.cpp
|
||||
TestPrograms/test_arm_sha1.cpp
|
||||
TestPrograms/test_arm_sha256.cpp
|
||||
TestPrograms/test_arm_sha3.cpp
|
||||
TestPrograms/test_arm_sha512.cpp
|
||||
TestPrograms/test_arm_sm3.cpp
|
||||
TestPrograms/test_arm_sm4.cpp
|
||||
TestPrograms/test_asm_mixed.cpp
|
||||
TestPrograms/test_cxx11_alignas.cpp
|
||||
TestPrograms/test_cxx11_alignof.cpp
|
||||
TestPrograms/test_cxx11_assert.cpp
|
||||
TestPrograms/test_cxx11_atomic.cpp
|
||||
TestPrograms/test_cxx11_auto.cpp
|
||||
TestPrograms/test_cxx11_constexpr.cpp
|
||||
TestPrograms/test_cxx11.cpp
|
||||
TestPrograms/test_cxx11_deletefn.cpp
|
||||
TestPrograms/test_cxx11_staticinit.cpp
|
||||
TestPrograms/test_cxx11_enumtype.cpp
|
||||
TestPrograms/test_cxx11_initializer.cpp
|
||||
TestPrograms/test_cxx11_lambda.cpp
|
||||
TestPrograms/test_cxx11_noexcept.cpp
|
||||
TestPrograms/test_cxx11_nullptr.cpp
|
||||
TestPrograms/test_cxx11_sync.cpp
|
||||
TestPrograms/test_cxx11_vartemplates.cpp
|
||||
TestPrograms/test_cxx14.cpp
|
||||
TestPrograms/test_cxx17_assert.cpp
|
||||
TestPrograms/test_cxx17.cpp
|
||||
TestPrograms/test_cxx17_exceptions.cpp
|
||||
TestPrograms/test_cxx98_exception.cpp
|
||||
TestPrograms/test_cxx.cpp
|
||||
TestPrograms/test_glibc.cpp
|
||||
TestPrograms/test_newlib.cpp
|
||||
TestPrograms/test_ppc_aes.cpp
|
||||
TestPrograms/test_ppc_altivec.cpp
|
||||
TestPrograms/test_ppc_power7.cpp
|
||||
TestPrograms/test_ppc_power8.cpp
|
||||
TestPrograms/test_ppc_power9.cpp
|
||||
TestPrograms/test_ppc_sha.cpp
|
||||
TestPrograms/test_ppc_vmull.cpp
|
||||
TestPrograms/test_pthreads.cpp
|
||||
TestPrograms/test_x86_aes.cpp
|
||||
TestPrograms/test_x86_avx2.cpp
|
||||
TestPrograms/test_x86_avx512.cpp
|
||||
TestPrograms/test_x86_avx.cpp
|
||||
TestPrograms/test_x86_clmul.cpp
|
||||
TestPrograms/test_x86_cpuid.cpp
|
||||
TestPrograms/test_x86_rdrand.cpp
|
||||
TestPrograms/test_x86_rdseed.cpp
|
||||
TestPrograms/test_x86_sha.cpp
|
||||
TestPrograms/test_x86_sse2.cpp
|
||||
TestPrograms/test_x86_sse3.cpp
|
||||
TestPrograms/test_x86_sse41.cpp
|
||||
TestPrograms/test_x86_sse42.cpp
|
||||
TestPrograms/test_x86_ssse3.cpp
|
||||
TestPrograms/test_x86_via_aes.cpp
|
||||
TestPrograms/test_x86_via_rng.cpp
|
||||
TestPrograms/test_x86_via_sha.cpp
|
||||
|
594
vendor/cryptopp/vendor_cryptopp/GNUmakefile
vendored
594
vendor/cryptopp/vendor_cryptopp/GNUmakefile
vendored
@ -86,15 +86,6 @@ XLC_COMPILER := $(shell $(CXX) -qversion 2>/dev/null |$(GREP) -i -c "IBM XL")
|
||||
CLANG_COMPILER := $(shell $(CXX) --version 2>/dev/null | $(GREP) -i -c -E '(llvm|clang)')
|
||||
INTEL_COMPILER := $(shell $(CXX) --version 2>/dev/null | $(GREP) -i -c '\(icc\)')
|
||||
|
||||
# Various Port compilers on OS X
|
||||
MACPORTS_COMPILER := $(shell $(CXX) --version 2>/dev/null | $(GREP) -i -c "macports")
|
||||
HOMEBREW_COMPILER := $(shell $(CXX) --version 2>/dev/null | $(GREP) -i -c "homebrew")
|
||||
ifeq ($(IS_DARWIN),1)
|
||||
ifneq ($(MACPORTS_COMPILER)$(HOMEBREW_COMPILER),00)
|
||||
OSXPORT_COMPILER := 1
|
||||
endif
|
||||
endif
|
||||
|
||||
# Enable shared object versioning for Linux and Solaris
|
||||
HAS_SOLIB_VERSION ?= 0
|
||||
ifneq ($(IS_LINUX)$(IS_HURD)$(IS_SUN),000)
|
||||
@ -106,14 +97,6 @@ ifeq ($(wildcard adhoc.cpp),)
|
||||
$(shell cp adhoc.cpp.proto adhoc.cpp)
|
||||
endif
|
||||
|
||||
# Tell MacPorts and Homebrew GCC to use Clang integrated assembler (only on Intel-based Macs)
|
||||
# http://github.com/weidai11/cryptopp/issues/190
|
||||
ifeq ($(GCC_COMPILER)$(OSXPORT_COMPILER)$(IS_PPC32)$(IS_PPC64),1100)
|
||||
ifeq ($(findstring -Wa,-q,$(CXXFLAGS)),)
|
||||
CRYPTOPP_CXXFLAGS += -Wa,-q
|
||||
endif
|
||||
endif
|
||||
|
||||
# Hack to skip CPU feature tests for some recipes
|
||||
DETECT_FEATURES ?= 1
|
||||
ifeq ($(findstring -DCRYPTOPP_DISABLE_ASM,$(CXXFLAGS)),-DCRYPTOPP_DISABLE_ASM)
|
||||
@ -122,26 +105,29 @@ else ifeq ($(findstring clean,$(MAKECMDGOALS)),clean)
|
||||
DETECT_FEATURES := 0
|
||||
else ifeq ($(findstring distclean,$(MAKECMDGOALS)),distclean)
|
||||
DETECT_FEATURES := 0
|
||||
else ifeq ($(findstring distclean,$(MAKECMDGOALS)),trim)
|
||||
else ifeq ($(findstring trim,$(MAKECMDGOALS)),trim)
|
||||
DETECT_FEATURES := 0
|
||||
else ifeq ($(findstring zip,$(MAKECMDGOALS)),zip)
|
||||
DETECT_FEATURES := 0
|
||||
endif
|
||||
|
||||
# Strip out -Wall, -Wextra and friends for feature testing. FORTIFY_SOURCE is removed
|
||||
# because it requires -O1 or higher, but we use -O0 to tame the optimizer.
|
||||
ifeq ($(DETECT_FEATURES),1)
|
||||
TCXXFLAGS := $(filter-out -D_FORTIFY_SOURCE=% -M -MM -Wall -Wextra -Werror% -Wunused -Wconversion -Wp%, $(CXXFLAGS))
|
||||
ifneq ($(strip $(TCXXFLAGS)),)
|
||||
$(info Using testing flags: $(TCXXFLAGS))
|
||||
endif
|
||||
#TPROG = TestPrograms/test_cxx.cxx
|
||||
#$(info Testing compile... )
|
||||
#$(info $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 1>/dev/null))
|
||||
# Always print testing flags since some tests always happen, like 64-bit.
|
||||
TCXXFLAGS := $(filter-out -D_FORTIFY_SOURCE=% -M -MM -Wall -Wextra -Werror% -Wunused -Wconversion -Wp%, $(CPPFLAGS) $(CXXFLAGS))
|
||||
ifneq ($(strip $(TCXXFLAGS)),)
|
||||
$(info Using testing flags: $(TCXXFLAGS))
|
||||
endif
|
||||
|
||||
# TCOMMAND is used for just about all tests. Make will lazy-evaluate
|
||||
# the variables when executed by $(shell $(TCOMMAND) ...).
|
||||
TCOMMAND = $(CXX) $(TCXXFLAGS) $(TEXTRA) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT)
|
||||
|
||||
# Fixup AIX
|
||||
ifeq ($(IS_AIX),1)
|
||||
TPROG = TestPrograms/test_64bit.cxx
|
||||
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TPROG) -o $(TOUT) 2>&1 | wc -w)
|
||||
TPROG = TestPrograms/test_64bit.cpp
|
||||
TOPT =
|
||||
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
||||
ifeq ($(strip $(HAVE_OPT)),0)
|
||||
IS_PPC64=1
|
||||
else
|
||||
@ -149,15 +135,8 @@ ifeq ($(IS_AIX),1)
|
||||
endif
|
||||
endif
|
||||
|
||||
# libc++ is LLVM's standard C++ library. If we add libc++
|
||||
# here then all user programs must use it too. The open
|
||||
# question is, which choice is easier on users?
|
||||
ifneq ($(IS_DARWIN),0)
|
||||
CXX ?= c++
|
||||
# CRYPTOPP_CXXFLAGS += -stdlib=libc++
|
||||
AR = libtool
|
||||
ARFLAGS = -static -o
|
||||
endif
|
||||
# Uncomment for debugging
|
||||
# $(info Here's what we found... IS_X86: $(IS_X86), IS_X64: $(IS_X64), IS_ARM32: $(IS_ARM32), IS_ARMV8: $(IS_ARMV8))
|
||||
|
||||
###########################################################
|
||||
##### General Variables #####
|
||||
@ -188,31 +167,31 @@ endif
|
||||
|
||||
# http://www.gnu.org/prep/standards/html_node/Directory-Variables.html
|
||||
ifeq ($(PREFIX),)
|
||||
PREFIX = /usr/local
|
||||
PC_PREFIX = /usr/local
|
||||
PREFIX = /usr/local
|
||||
PC_PREFIX = /usr/local
|
||||
else
|
||||
PC_PREFIX = $(PREFIX)
|
||||
PC_PREFIX = $(PREFIX)
|
||||
endif
|
||||
ifeq ($(LIBDIR),)
|
||||
LIBDIR := $(PREFIX)/lib
|
||||
PC_LIBDIR = $${prefix}/lib
|
||||
LIBDIR := $(PREFIX)/lib
|
||||
PC_LIBDIR = $${prefix}/lib
|
||||
else
|
||||
PC_LIBDIR = $(LIBDIR)
|
||||
PC_LIBDIR = $(LIBDIR)
|
||||
endif
|
||||
ifeq ($(DATADIR),)
|
||||
DATADIR := $(PREFIX)/share
|
||||
PC_DATADIR = $${prefix}/share
|
||||
DATADIR := $(PREFIX)/share
|
||||
PC_DATADIR = $${prefix}/share
|
||||
else
|
||||
PC_DATADIR = $(DATADIR)
|
||||
PC_DATADIR = $(DATADIR)
|
||||
endif
|
||||
ifeq ($(INCLUDEDIR),)
|
||||
INCLUDEDIR := $(PREFIX)/include
|
||||
PC_INCLUDEDIR = $${prefix}/include
|
||||
INCLUDEDIR := $(PREFIX)/include
|
||||
PC_INCLUDEDIR = $${prefix}/include
|
||||
else
|
||||
PC_INCLUDEDIR = $(INCLUDEDIR)
|
||||
PC_INCLUDEDIR = $(INCLUDEDIR)
|
||||
endif
|
||||
ifeq ($(BINDIR),)
|
||||
BINDIR := $(PREFIX)/bin
|
||||
BINDIR := $(PREFIX)/bin
|
||||
endif
|
||||
|
||||
# We honor ARFLAGS, but the "v" option used by default causes a noisy make
|
||||
@ -235,8 +214,9 @@ endif # _WIN32_WINNT
|
||||
endif # IS_MINGW
|
||||
|
||||
# Newlib needs _XOPEN_SOURCE=600 for signals
|
||||
TPROG = TestPrograms/test_newlib.cxx
|
||||
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TPROG) -o $(TOUT) 2>&1 | wc -w)
|
||||
TPROG = TestPrograms/test_newlib.cpp
|
||||
TOPT =
|
||||
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
||||
ifeq ($(strip $(HAVE_OPT)),0)
|
||||
ifeq ($(findstring -D_XOPEN_SOURCE,$(CXXFLAGS)),)
|
||||
CRYPTOPP_CXXFLAGS += -D_XOPEN_SOURCE=600
|
||||
@ -274,159 +254,194 @@ ifeq ($(DETECT_FEATURES),1)
|
||||
SHANI_FLAG = -msha
|
||||
endif
|
||||
|
||||
TPROG = TestPrograms/test_x86_sse2.cxx
|
||||
# Tell MacPorts and Homebrew GCC to use Clang integrated assembler
|
||||
# Intel-based Macs. http://github.com/weidai11/cryptopp/issues/190
|
||||
ifneq ($(IS_DARWIN),0)
|
||||
ifeq ($(findstring -Wa,-q,$(CXXFLAGS)),)
|
||||
TPROG = TestPrograms/test_cxx.cpp
|
||||
TOPT = -Wa,-q
|
||||
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
||||
ifeq ($(strip $(HAVE_OPT)),0)
|
||||
TEXTRA += -Wa,-q
|
||||
CRYPTOPP_CXXFLAGS += -Wa,-q
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
TPROG = TestPrograms/test_x86_sse2.cpp
|
||||
TOPT = $(SSE2_FLAG)
|
||||
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | wc -w)
|
||||
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
||||
ifeq ($(strip $(HAVE_OPT)),0)
|
||||
CHACHA_FLAG = $(SSE2_FLAG)
|
||||
SUN_LDFLAGS += $(SSE2_FLAG)
|
||||
else
|
||||
# Make does not have useful debugging facilities. Show the user
|
||||
# what happened by compiling again without the pipe.
|
||||
$(info Running make again to see what failed)
|
||||
$(info $(shell $(TCOMMAND)))
|
||||
SSE2_FLAG =
|
||||
endif
|
||||
|
||||
TPROG = TestPrograms/test_x86_ssse3.cxx
|
||||
TOPT = $(SSSE3_FLAG)
|
||||
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | wc -w)
|
||||
ifeq ($(strip $(HAVE_OPT)),0)
|
||||
ARIA_FLAG = $(SSSE3_FLAG)
|
||||
CHAM_FLAG = $(SSSE3_FLAG)
|
||||
KECCAK_FLAG = $(SSSE3_FLAG)
|
||||
LEA_FLAG = $(SSSE3_FLAG)
|
||||
SIMON128_FLAG = $(SSSE3_FLAG)
|
||||
SPECK128_FLAG = $(SSSE3_FLAG)
|
||||
SUN_LDFLAGS += $(SSSE3_FLAG)
|
||||
else
|
||||
SSSE3_FLAG =
|
||||
endif
|
||||
|
||||
TPROG = TestPrograms/test_x86_sse41.cxx
|
||||
TOPT = $(SSE41_FLAG)
|
||||
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | wc -w)
|
||||
ifeq ($(strip $(HAVE_OPT)),0)
|
||||
BLAKE2B_FLAG = $(SSE41_FLAG)
|
||||
BLAKE2S_FLAG = $(SSE41_FLAG)
|
||||
SUN_LDFLAGS += $(SSE41_FLAG)
|
||||
else
|
||||
SSE41_FLAG =
|
||||
endif
|
||||
|
||||
TPROG = TestPrograms/test_x86_sse42.cxx
|
||||
TOPT = $(SSE42_FLAG)
|
||||
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | wc -w)
|
||||
ifeq ($(strip $(HAVE_OPT)),0)
|
||||
CRC_FLAG = $(SSE42_FLAG)
|
||||
SUN_LDFLAGS += $(SSE42_FLAG)
|
||||
else
|
||||
SSE42_FLAG =
|
||||
endif
|
||||
|
||||
TPROG = TestPrograms/test_x86_clmul.cxx
|
||||
TOPT = $(CLMUL_FLAG)
|
||||
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | wc -w)
|
||||
ifeq ($(strip $(HAVE_OPT)),0)
|
||||
GCM_FLAG = $(SSSE3_FLAG) $(CLMUL_FLAG)
|
||||
GF2N_FLAG = $(CLMUL_FLAG)
|
||||
SUN_LDFLAGS += $(CLMUL_FLAG)
|
||||
else
|
||||
CLMUL_FLAG =
|
||||
endif
|
||||
|
||||
TPROG = TestPrograms/test_x86_aes.cxx
|
||||
TOPT = $(AESNI_FLAG)
|
||||
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | wc -w)
|
||||
ifeq ($(strip $(HAVE_OPT)),0)
|
||||
AES_FLAG = $(SSE41_FLAG) $(AESNI_FLAG)
|
||||
SM4_FLAG = $(SSSE3_FLAG) $(AESNI_FLAG)
|
||||
SUN_LDFLAGS += $(AESNI_FLAG)
|
||||
else
|
||||
AESNI_FLAG =
|
||||
endif
|
||||
|
||||
TPROG = TestPrograms/test_x86_avx.cxx
|
||||
TOPT = $(AVX_FLAG)
|
||||
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | wc -w)
|
||||
ifeq ($(strip $(HAVE_OPT)),0)
|
||||
# XXX_FLAG = $(AVX_FLAG)
|
||||
SUN_LDFLAGS += $(AVX_FLAG)
|
||||
else
|
||||
AVX_FLAG =
|
||||
endif
|
||||
|
||||
TPROG = TestPrograms/test_x86_avx2.cxx
|
||||
TOPT = $(AVX2_FLAG)
|
||||
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | wc -w)
|
||||
ifeq ($(strip $(HAVE_OPT)),0)
|
||||
CHACHA_AVX2_FLAG = $(AVX2_FLAG)
|
||||
SUN_LDFLAGS += $(AVX2_FLAG)
|
||||
else
|
||||
AVX2_FLAG =
|
||||
endif
|
||||
|
||||
TPROG = TestPrograms/test_x86_sha.cxx
|
||||
TOPT = $(SHANI_FLAG)
|
||||
HAVE_OPT = $(shell $(CXX) $(TCXXFLAGS) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT) 2>&1 | wc -w)
|
||||
ifeq ($(strip $(HAVE_OPT)),0)
|
||||
SHA_FLAG = $(SSE42_FLAG) $(SHANI_FLAG)
|
||||
SUN_LDFLAGS += $(SHANI_FLAG)
|
||||
else
|
||||
SHANI_FLAG =
|
||||
endif
|
||||
|
||||
ifeq ($(SUN_COMPILER),1)
|
||||
CRYPTOPP_LDFLAGS += $(SUN_LDFLAGS)
|
||||
endif
|
||||
|
||||
ifeq ($(SSE2_FLAG),)
|
||||
CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_ASM
|
||||
else ifeq ($(SSE3_FLAG),)
|
||||
CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_SSE3
|
||||
else ifeq ($(SSSE3_FLAG),)
|
||||
CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_SSSE3
|
||||
else ifeq ($(SSE41_FLAG),)
|
||||
CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_SSE4
|
||||
else ifeq ($(SSE42_FLAG),)
|
||||
CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_SSE4
|
||||
endif
|
||||
|
||||
ifneq ($(SSE42_FLAG),)
|
||||
# Need SSE2 or higher for these tests
|
||||
ifneq ($(SSE2_FLAG),)
|
||||
|
||||
# Unusual GCC/Clang on Macports. It assembles AES, but not CLMUL.
|
||||
# test_x86_clmul.s:15: no such instruction: 'pclmulqdq $0, %xmm1,%xmm0'
|
||||
ifeq ($(CLMUL_FLAG),)
|
||||
CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_CLMUL
|
||||
endif
|
||||
ifeq ($(AESNI_FLAG),)
|
||||
CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_AESNI
|
||||
TPROG = TestPrograms/test_x86_ssse3.cpp
|
||||
TOPT = $(SSSE3_FLAG)
|
||||
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
||||
ifeq ($(strip $(HAVE_OPT)),0)
|
||||
ARIA_FLAG = $(SSSE3_FLAG)
|
||||
CHAM_FLAG = $(SSSE3_FLAG)
|
||||
KECCAK_FLAG = $(SSSE3_FLAG)
|
||||
LEA_FLAG = $(SSSE3_FLAG)
|
||||
LSH256_FLAG = $(SSSE3_FLAG)
|
||||
LSH512_FLAG = $(SSSE3_FLAG)
|
||||
SIMON128_FLAG = $(SSSE3_FLAG)
|
||||
SPECK128_FLAG = $(SSSE3_FLAG)
|
||||
SUN_LDFLAGS += $(SSSE3_FLAG)
|
||||
else
|
||||
SSSE3_FLAG =
|
||||
endif
|
||||
|
||||
ifeq ($(AVX_FLAG),)
|
||||
CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_AVX
|
||||
else ifeq ($(AVX2_FLAG),)
|
||||
CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_AVX2
|
||||
else ifeq ($(SHANI_FLAG),)
|
||||
CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_SHANI
|
||||
# The first Apple MacBooks were Core2's with SSE4.1
|
||||
ifneq ($(IS_DARWIN),0)
|
||||
# Add SSE2 algo's here as required
|
||||
# They get a free upgrade
|
||||
endif
|
||||
endif
|
||||
|
||||
# Drop to SSE2 if available
|
||||
ifeq ($(GCM_FLAG),)
|
||||
ifneq ($(SSE2_FLAG),)
|
||||
TPROG = TestPrograms/test_x86_sse41.cpp
|
||||
TOPT = $(SSE41_FLAG)
|
||||
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
||||
ifeq ($(strip $(HAVE_OPT)),0)
|
||||
BLAKE2B_FLAG = $(SSE41_FLAG)
|
||||
BLAKE2S_FLAG = $(SSE41_FLAG)
|
||||
SUN_LDFLAGS += $(SSE41_FLAG)
|
||||
else
|
||||
SSE41_FLAG =
|
||||
endif
|
||||
|
||||
TPROG = TestPrograms/test_x86_sse42.cpp
|
||||
TOPT = $(SSE42_FLAG)
|
||||
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
||||
ifeq ($(strip $(HAVE_OPT)),0)
|
||||
CRC_FLAG = $(SSE42_FLAG)
|
||||
SUN_LDFLAGS += $(SSE42_FLAG)
|
||||
else
|
||||
SSE42_FLAG =
|
||||
endif
|
||||
|
||||
TPROG = TestPrograms/test_x86_clmul.cpp
|
||||
TOPT = $(CLMUL_FLAG)
|
||||
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
||||
ifeq ($(strip $(HAVE_OPT)),0)
|
||||
GCM_FLAG = $(SSSE3_FLAG) $(CLMUL_FLAG)
|
||||
GF2N_FLAG = $(CLMUL_FLAG)
|
||||
SUN_LDFLAGS += $(CLMUL_FLAG)
|
||||
else
|
||||
CLMUL_FLAG =
|
||||
endif
|
||||
|
||||
TPROG = TestPrograms/test_x86_aes.cpp
|
||||
TOPT = $(AESNI_FLAG)
|
||||
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
||||
ifeq ($(strip $(HAVE_OPT)),0)
|
||||
AES_FLAG = $(SSE41_FLAG) $(AESNI_FLAG)
|
||||
SM4_FLAG = $(SSSE3_FLAG) $(AESNI_FLAG)
|
||||
SUN_LDFLAGS += $(AESNI_FLAG)
|
||||
else
|
||||
AESNI_FLAG =
|
||||
endif
|
||||
|
||||
TPROG = TestPrograms/test_x86_avx.cpp
|
||||
TOPT = $(AVX_FLAG)
|
||||
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
||||
ifeq ($(strip $(HAVE_OPT)),0)
|
||||
# XXX_FLAG = $(AVX_FLAG)
|
||||
SUN_LDFLAGS += $(AVX_FLAG)
|
||||
else
|
||||
AVX_FLAG =
|
||||
endif
|
||||
|
||||
TPROG = TestPrograms/test_x86_avx2.cpp
|
||||
TOPT = $(AVX2_FLAG)
|
||||
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
||||
ifeq ($(strip $(HAVE_OPT)),0)
|
||||
CHACHA_AVX2_FLAG = $(AVX2_FLAG)
|
||||
LSH256_AVX2_FLAG = $(AVX2_FLAG)
|
||||
LSH512_AVX2_FLAG = $(AVX2_FLAG)
|
||||
SUN_LDFLAGS += $(AVX2_FLAG)
|
||||
else
|
||||
AVX2_FLAG =
|
||||
endif
|
||||
|
||||
TPROG = TestPrograms/test_x86_sha.cpp
|
||||
TOPT = $(SHANI_FLAG)
|
||||
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
||||
ifeq ($(strip $(HAVE_OPT)),0)
|
||||
SHA_FLAG = $(SSE42_FLAG) $(SHANI_FLAG)
|
||||
SUN_LDFLAGS += $(SHANI_FLAG)
|
||||
else
|
||||
SHANI_FLAG =
|
||||
endif
|
||||
|
||||
ifeq ($(SUN_COMPILER),1)
|
||||
CRYPTOPP_LDFLAGS += $(SUN_LDFLAGS)
|
||||
endif
|
||||
|
||||
ifeq ($(SSE3_FLAG),)
|
||||
CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_SSE3
|
||||
else ifeq ($(SSSE3_FLAG),)
|
||||
CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_SSSE3
|
||||
else ifeq ($(SSE41_FLAG),)
|
||||
CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_SSE4
|
||||
else ifeq ($(SSE42_FLAG),)
|
||||
CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_SSE4
|
||||
endif
|
||||
|
||||
ifneq ($(SSE42_FLAG),)
|
||||
# Unusual GCC/Clang on Macports. It assembles AES, but not CLMUL.
|
||||
# test_x86_clmul.s:15: no such instruction: 'pclmulqdq $0, %xmm1,%xmm0'
|
||||
ifeq ($(CLMUL_FLAG),)
|
||||
CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_CLMUL
|
||||
endif
|
||||
ifeq ($(AESNI_FLAG),)
|
||||
CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_AESNI
|
||||
endif
|
||||
|
||||
ifeq ($(AVX_FLAG),)
|
||||
CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_AVX
|
||||
else ifeq ($(AVX2_FLAG),)
|
||||
CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_AVX2
|
||||
endif
|
||||
# SHANI independent of AVX per GH #1045
|
||||
ifeq ($(SHANI_FLAG),)
|
||||
CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_SHANI
|
||||
endif
|
||||
endif
|
||||
|
||||
# Drop to SSE2 if available
|
||||
ifeq ($(GCM_FLAG),)
|
||||
GCM_FLAG = $(SSE2_FLAG)
|
||||
endif
|
||||
|
||||
# Most Clang cannot handle mixed asm with positional arguments, where the
|
||||
# body is Intel style with no prefix and the templates are AT&T style.
|
||||
# Also see https://bugs.llvm.org/show_bug.cgi?id=39895 .
|
||||
|
||||
# CRYPTOPP_DISABLE_MIXED_ASM is now being added in config_asm.h for all
|
||||
# Clang compilers. This test will need to be re-enabled if Clang fixes it.
|
||||
#TPROG = TestPrograms/test_asm_mixed.cpp
|
||||
#TOPT =
|
||||
#HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
||||
#ifneq ($(strip $(HAVE_OPT)),0)
|
||||
# CRYPTOPP_CXXFLAGS += -DCRYPTOPP_DISABLE_MIXED_ASM
|
||||
#endif
|
||||
|
||||
# SSE2_FLAGS
|
||||
endif
|
||||
|
||||
# Most Clang cannot handle mixed asm with positional arguments, where the
|
||||
# body is Intel style with no prefix and the templates are AT&T style.
|
||||
# Also see https://bugs.llvm.org/show_bug.cgi?id=39895 .
|
||||
|
||||