Index: head/security/palisade/Makefile =================================================================== --- head/security/palisade/Makefile (revision 526600) +++ head/security/palisade/Makefile (revision 526601) @@ -1,42 +1,46 @@ # $FreeBSD$ PORTNAME= palisade DISTVERSIONPREFIX= v DISTVERSION= 1.8.0 +PORTREVISION= 1 CATEGORIES= security math MAINTAINER= yuri@FreeBSD.org -COMMENT= PALISADE lattice cryptography library +COMMENT= PALISADE lattice cryptography library for Fully Homomorphic Encryption LICENSE= BSD2CLAUSE LICENSE_FILE= ${WRKSRC}/License.md BROKEN_i386= fails to build: a declaration of 'Mul128' must be available BROKEN_powerpc64= fails to build: math/native_int/binint.h:510:11: error: Architecture not supported for MultD() BUILD_DEPENDS= autoconf:devel/autoconf # possibly a mistake in the project +LIB_DEPENDS= libntl.so:math/ntl USES= cmake:noninja compiler:c++11-lang localbase USE_GITLAB= yes USE_GITHUB= nodefault GL_PROJECT= palisade-development # there's also palisade-release GL_COMMIT= e00817a14c1d58b064cb0584e23b703a083e4908 GH_TUPLE= \ JerryRyan:cereal:a384b101:cereal/third-party/cereal \ google:benchmark:daff5fea:benchmark/third-party/google-benchmark \ google:googletest:8b4817e3:google_test/third-party/google-test \ gperftools:gperftools:c1d546d7:gperftools/third-party/gperftools -USE_GCC= any # clang fails: fatal error: 'quadmath.h' file not found USE_LDCONFIG= yes CMAKE_OFF= BUILD_UNITTESTS +CMAKE_ARGS= -DWITH_NTL=Y + +LDFLAGS+= ${LOCALBASE}/lib/libntl.so # libntl is optional in palisade but is necessary in FreeBSD because is has an equivalent of quadmath.h that is missing in FreeBSD. -DWITH_NTL should be added by users to the compiler command lines. CXXFLAGS+= -I${WRKSRC}/third-party/google-test/googletest do-test: @cd ${BUILD_WRKSRC} && \ ${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} -DBUILD_UNITTESTS:BOOL=ON ${CMAKE_SOURCE_PATH} && \ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${ALL_TARGET} && \ ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} testall .include Index: head/security/palisade/files/patch-CMakeLists.txt =================================================================== --- head/security/palisade/files/patch-CMakeLists.txt (revision 526600) +++ head/security/palisade/files/patch-CMakeLists.txt (revision 526601) @@ -1,11 +1,61 @@ ---- CMakeLists.txt.orig 2019-12-27 18:44:46 UTC +--- CMakeLists.txt.orig 2020-01-30 18:15:11 UTC +++ CMakeLists.txt -@@ -183,7 +183,7 @@ set(COMPILEFLAGS "-Wall -Werror -O3 -DPALISADE_VERSION - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILEFLAGS}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILEFLAGS}") +@@ -185,7 +185,7 @@ set(CXXCOMPILEFLAGS "-Wall -Werror -O3 -DPALISADE_VERS + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CCOMPILEFLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXXCOMPILEFLAGS}") -find_package (Git REQUIRED) +find_package (Git) find_package (Doxygen QUIET COMPONENTS dot) if (DOXYGEN_FOUND) +@@ -262,7 +262,7 @@ else() + set_target_properties(gmp PROPERTIES IMPORTED_LOCATION ${GMPLIBFILE}) + endif() + +-if("${WITH_NTL}" STREQUAL "Y") ++if(FALSE AND "${WITH_NTL}" STREQUAL "Y") + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/third-party/lib/ DESTINATION lib + FILES_MATCHING PATTERN "libgmp.*" ) + # also copies the gmp dll file +@@ -389,15 +389,15 @@ if("${WITH_TCM}" STREQUAL "Y") + endif() + + if("${WITH_NTL}" STREQUAL "Y") +- set(THIRDPARTYLIBS "${THIRDPARTYLIBS}" PUBLIC ntl PUBLIC gmp ) +- set(THIRDPARTYSTATICLIBS "${THIRDPARTYSTATICLIBS}" PUBLIC ntl PUBLIC gmp ) ++ #set(THIRDPARTYLIBS "${THIRDPARTYLIBS}" PUBLIC ntl PUBLIC gmp ) ++ #set(THIRDPARTYSTATICLIBS "${THIRDPARTYSTATICLIBS}" PUBLIC ntl PUBLIC gmp ) + add_definitions(-DWITH_NTL) + else() + set(THIRDPARTYLIBS "${THIRDPARTYLIBS}" "${QUADMATHLIB}") + set(THIRDPARTYSTATICLIBS "${THIRDPARTYSTATICLIBS}" "${QUADMATHLIB}") + endif() + +-if("${WITH_NTL}" STREQUAL "Y" OR "${WITH_TCM}" STREQUAL "Y") ++if(FALSE AND "${WITH_NTL}" STREQUAL "Y" OR "${WITH_TCM}" STREQUAL "Y") + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/third-party/include/ DESTINATION include/palisade) + endif() + +@@ -406,7 +406,7 @@ set(BINDEMODATAPATH ${CMAKE_CURRENT_BINARY_DIR}/demoDa + + # copies demoData folder from the root of the repo to build/demoData if the folder does not exist + # also checks whether NTL and GMP have been installed if the user chose to use NTL by setting WITH_NTL=Y +-if("${WITH_NTL}" STREQUAL "Y") ++if(FALSE AND "${WITH_NTL}" STREQUAL "Y") + add_custom_target(third-party ALL + COMMAND [ ! -f ${GMPLIBFILE} ] && echo ***ERROR*** Be sure to run \"make gmp_unpack\" and \"make gmp_all\" || [ ! -f ${NTLLIBFILE} ] && echo ***ERROR*** Be sure to run \"make ntl_unpack\" and \"make ntl_all\" || echo "-- NTL/GMP is already installed" + COMMAND [ ! -d ${BINDEMODATAPATH} ] && cp -R ${DEMODATAPATH} ${BINDEMODATAPATH} && echo "-- Copied demoData files" || echo "-- demoData folder already exists" +@@ -438,9 +438,11 @@ endif() + set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Enable testing of the benchmark library." FORCE) + set(BENCHMARK_ENABLE_INSTALL OFF CACHE BOOL "Enable installation of benchmark. (Projects embedding benchmark may want to turn this OFF.)" FORCE) + set(BENCHMARK_ENABLE_GTEST_TESTS OFF CACHE BOOL "Enable building the unit tests which depend on gtest" FORCE) +-add_subdirectory(third-party/google-benchmark EXCLUDE_FROM_ALL) ++#add_subdirectory(third-party/google-benchmark EXCLUDE_FROM_ALL) + ++if (BUILD_TESTING) + add_subdirectory(benchmark) ++endif() + + ## clobber cleans AND cleans the third-party stuff + add_custom_target( clobber DEPENDS gmp_clobber ntl_clobber Index: head/security/palisade/pkg-descr =================================================================== --- head/security/palisade/pkg-descr (revision 526600) +++ head/security/palisade/pkg-descr (revision 526601) @@ -1,11 +1,11 @@ PALISADE is a general lattice cryptography library that currently includes efficient implementations of the following lattice cryptography capabilities: * Homomorphic Encryption (HE): Brakerski/Fan-Vercauteren (3 variants), Brakerski-Gentry-Vaikuntanathan, and Stehle-Steinfeld schemes * Proxy Re-Encryption for all HE schemes * Digital Signature * Identity-Based Encryption * Ciphertext-Policy Attribute-Based Encryption -WWW: https://gitlab.com/palisade/palisade-release +WWW: https://palisade-crypto.org