diff --git a/src/pke/CMakeLists.txt b/src/pke/CMakeLists.txt index bad83a551..bf8eb34c4 100644 --- a/src/pke/CMakeLists.txt +++ b/src/pke/CMakeLists.txt @@ -63,8 +63,7 @@ if( BUILD_UNITTESTS ) endif() add_executable (pke_tests ${PKE_TEST_SRC_FILES} ${UNITTESTMAIN}) set_property(TARGET pke_tests PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/unittest) - target_include_directories(pke_tests PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/unittest") - target_include_directories(pke_tests PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/unittest/utils") + target_include_directories(pke_tests PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/unittest/utils") target_link_libraries ( pke_tests ${PKELIBS} ${ADDITIONAL_LIBS}) if (NOT ${WITH_OPENMP} ) target_link_libraries ( pke_tests PRIVATE Threads::Threads) @@ -80,7 +79,14 @@ if ( BUILD_EXAMPLES) file (GLOB PKE_EXAMPLES_SRC_FILES CONFIGURE_DEPENDS examples/*.cpp) foreach (app ${PKE_EXAMPLES_SRC_FILES}) get_filename_component ( exe ${app} NAME_WE ) - add_executable ( ${exe} ${app} ) + if(${exe} STREQUAL "scheme-switching-serial") + # add schemeswitching-data-serializer.cpp to link line and + # include the unittest/utils directory where schemeswitching-data-serializer.h is + add_executable ( ${exe} ${app} "${CMAKE_CURRENT_SOURCE_DIR}/unittest/utils/schemeswitching-data-serializer.cpp") + target_include_directories( ${exe} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/unittest/utils") + else() + add_executable ( ${exe} ${app} ) + endif() set_property(TARGET ${exe} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/examples/pke) set( PKEAPPS ${PKEAPPS} ${exe} ) target_link_libraries ( ${exe} ${PKELIBS} ${ADDITIONAL_LIBS}) diff --git a/src/pke/examples/scheme-switching-serial.cpp b/src/pke/examples/scheme-switching-serial.cpp index 478c5aa4f..e95cc7d69 100644 --- a/src/pke/examples/scheme-switching-serial.cpp +++ b/src/pke/examples/scheme-switching-serial.cpp @@ -35,19 +35,20 @@ 2 separate entities */ -#include -#include -#include - #include "openfhe.h" #include "binfhecontext.h" -#include "scheme/ckksrns/schemeswitching-data-serializer.h" // header files needed for serialization #include "ciphertext-ser.h" #include "cryptocontext-ser.h" #include "key/key-ser.h" #include "scheme/ckksrns/ckksrns-ser.h" +#include "schemeswitching-data-serializer.h" + +#include +#include +#include + using namespace lbcrypto; diff --git a/src/pke/unittest/utckksrns/UnitTestSchemeSwitch.cpp b/src/pke/unittest/utckksrns/UnitTestSchemeSwitch.cpp index e99eae2c1..061350d45 100644 --- a/src/pke/unittest/utckksrns/UnitTestSchemeSwitch.cpp +++ b/src/pke/unittest/utckksrns/UnitTestSchemeSwitch.cpp @@ -39,9 +39,9 @@ #include "scheme/ckksrns/ckksrns-utils.h" #include "cryptocontext-ser.h" #include "scheme/ckksrns/ckksrns-ser.h" -#include "scheme/ckksrns/schemeswitching-data-serializer.h" #include "ciphertext-ser.h" #include "key/key-ser.h" +#include "schemeswitching-data-serializer.h" #include #include diff --git a/src/pke/lib/scheme/ckksrns/schemeswitching-data-serializer.cpp b/src/pke/unittest/utils/schemeswitching-data-serializer.cpp similarity index 99% rename from src/pke/lib/scheme/ckksrns/schemeswitching-data-serializer.cpp rename to src/pke/unittest/utils/schemeswitching-data-serializer.cpp index ab2d05768..6298367ec 100644 --- a/src/pke/lib/scheme/ckksrns/schemeswitching-data-serializer.cpp +++ b/src/pke/unittest/utils/schemeswitching-data-serializer.cpp @@ -28,7 +28,7 @@ // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. //================================================================================== -#include "scheme/ckksrns/schemeswitching-data-serializer.h" +#include "schemeswitching-data-serializer.h" #include "ciphertext-ser.h" #include "cryptocontext-ser.h" diff --git a/src/pke/include/scheme/ckksrns/schemeswitching-data-serializer.h b/src/pke/unittest/utils/schemeswitching-data-serializer.h similarity index 100% rename from src/pke/include/scheme/ckksrns/schemeswitching-data-serializer.h rename to src/pke/unittest/utils/schemeswitching-data-serializer.h