Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,14 @@ set(OpenFHE_PACKAGE_LIBS ${OpenFHE_STATIC_LIBS} ${OpenFHE_SHARED_LIBS})
# Installation logic
#--------------------------------------------------------------------
### set up for install
# include(GNUInstallDirs)

set(INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries")
set(INSTALL_INCLUDE_DIR include/openfhe CACHE PATH "Installation directory for headers")
if(NOT IS_ABSOLUTE "${INSTALL_INCLUDE_DIR}")
set(INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDE_DIR}")
endif()

if(WIN32 AND NOT CYGWIN)
set(DEF_INSTALL_CMAKE_DIR CMake)
else()
Expand Down Expand Up @@ -717,19 +723,16 @@ export(EXPORT OpenFHETargets FILE "${PROJECT_BINARY_DIR}/OpenFHETargets.cmake")
export(PACKAGE OpenFHE)

# Create the OpenFHEConfig.cmake and OpenFHEConfigVersion files
file(RELATIVE_PATH REL_INCLUDE_DIR "${INSTALL_CMAKE_DIR}"
"${INSTALL_INCLUDE_DIR}")
file(RELATIVE_PATH REL_INCLUDE_DIR "${INSTALL_CMAKE_DIR}" "${INSTALL_INCLUDE_DIR}")
# ... for the build tree
set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}")
configure_file(OpenFHEConfig.cmake.in
"${PROJECT_BINARY_DIR}/OpenFHEConfig.cmake" @ONLY)
configure_file(OpenFHEConfig.cmake.in "${PROJECT_BINARY_DIR}/OpenFHEConfig.cmake" @ONLY)
# ... for the install tree
set(CONF_INCLUDE_DIRS "\${OpenFHE_CMAKE_DIR}/${REL_INCLUDE_DIR}")
configure_file(OpenFHEConfig.cmake.in
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/OpenFHEConfig.cmake" @ONLY)
# set(CONF_INCLUDE_DIRS "\${OpenFHE_CMAKE_DIR}/../../include/openfhe") # supposed to be relocatable?
configure_file(OpenFHEConfig.cmake.in "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/OpenFHEConfig.cmake" @ONLY)
# ... for both
configure_file(OpenFHEConfigVersion.cmake.in
"${PROJECT_BINARY_DIR}/OpenFHEConfigVersion.cmake" @ONLY)
configure_file(OpenFHEConfigVersion.cmake.in "${PROJECT_BINARY_DIR}/OpenFHEConfigVersion.cmake" @ONLY)

# Install the OpenFHEConfig.cmake and OpenFHEConfigVersion.cmake
install(FILES
Expand All @@ -738,5 +741,5 @@ install(FILES
DESTINATION "${INSTALL_CMAKE_DIR}" COMPONENT dev)

# Install the export set for use with the install-tree
install(EXPORT OpenFHETargets DESTINATION
"${INSTALL_CMAKE_DIR}" COMPONENT dev)
install(EXPORT OpenFHETargets DESTINATION "${INSTALL_CMAKE_DIR}" COMPONENT dev)
# install(EXPORT OpenFHETargets DESTINATION "${INSTALL_CMAKE_DIR}" NAMESPACE OpenFHE:: COMPONENT dev)
2 changes: 2 additions & 0 deletions OpenFHEConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ if(NOT OpenFHE_BINARY_DIR)
endif()

# These are IMPORTED targets created by OpenFHETargets.cmake
# set(OpenFHE_INCLUDE "${OpenFHE_CMAKE_DIR}/../../include/openfhe")
# set(OpenFHE_LIBDIR "${OpenFHE_CMAKE_DIR}/../../lib")
set(OpenFHE_INCLUDE "@INSTALL_INCLUDE_DIR@")
set(OpenFHE_LIBDIR "@INSTALL_LIB_DIR@")
set(OpenFHE_LIBRARIES @OpenFHE_PACKAGE_LIBS@ @THIRDPARTYLIBS@ @OpenMP_CXX_FLAGS@)
Expand Down
12 changes: 10 additions & 2 deletions src/pke/include/schemebase/base-cryptoparameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@
#define LBCRYPTO_CRYPTO_BASE_CRYPTOPARAMETERS_H

#include "utils/serializable.h"
#include "encoding/plaintext.h"

#include "encoding/encodings.h"
#include "encoding/plaintext.h"

#include <memory>
#include <string>
Expand Down Expand Up @@ -74,6 +73,10 @@ class CryptoParametersBase : public Serializable {
return m_encodingParams->GetPlaintextModulus();
}

uint32_t GetBatchSize() const {
return m_encodingParams->GetBatchSize();
}

/**
* Returns the reference to IL params
*
Expand Down Expand Up @@ -105,9 +108,14 @@ class CryptoParametersBase : public Serializable {
m_encodingParams->SetPlaintextModulus(plaintextModulus);
}

void SetBatchSize(uint32_t batchSize) {
m_encodingParams->SetBatchSize(batchSize);
}

bool operator==(const CryptoParametersBase<Element>& rhs) const {
return CompareTo(rhs);
}

bool operator!=(const CryptoParametersBase<Element>& rhs) const {
return !(*this == rhs);
}
Expand Down