Browse Source

Merge pull request #25 from XPIR-team/feature/dbhandler-in-library

moved dbhandler files to the pir directory
Kirija 8 years ago
parent
commit
475910d63f

+ 1 - 1
apps/server/CMakeLists.txt

@@ -5,7 +5,7 @@ include_directories(.)
 include_directories(..)
 include_directories(../..)
 
-add_executable(pir_server DBDirectoryProcessor.cpp DBGenerator.cpp PIRServer.cpp PIRSession.cpp ServerService.cpp main.cpp)
+add_executable(pir_server PIRServer.cpp PIRSession.cpp ServerService.cpp main.cpp)
 
 target_link_libraries(pir_server pir ${Boost_LIBRARIES} ${GMP_LIBRARIES} pthread )
 

+ 3 - 3
apps/server/PIRServer.hpp

@@ -22,9 +22,9 @@
 
 #include "PIRSession.hpp"
 #include "ServerService.hpp"
-#include "../server/DBHandler.hpp"
-#include "../server/DBDirectoryProcessor.hpp"
-#include "../server/DBGenerator.hpp"
+#include "pir/dbhandlers/DBHandler.hpp"
+#include "pir/dbhandlers/DBDirectoryProcessor.hpp"
+#include "pir/dbhandlers/DBGenerator.hpp"
 
 #define DEFAULT_PORT 1234
 

+ 1 - 1
apps/server/PIRSession.hpp

@@ -25,7 +25,7 @@
 #include <boost/shared_ptr.hpp>
 #include <boost/algorithm/string.hpp>
 
-#include "apps/server/DBHandler.hpp"
+#include "pir/dbhandlers/DBHandler.hpp"
 #include "pir/PIRParameters.hpp"
 #include "pir/replyGenerator/PIRReplyGeneratorFactory.hpp"
 #include "crypto/HomomorphicCryptoFactory_internal.hpp"

+ 1 - 1
apps/simplepir/CMakeLists.txt

@@ -9,7 +9,7 @@ add_custom_target(build-time-make-directory-simple-pir ALL COMMAND ${CMAKE_COMMA
 file(COPY "../tools/makedb.sh" DESTINATION ".")
 
 
-add_executable(simple_pir simplePIR.cpp ../../libpir.hpp ../server/DBGenerator.cpp ../server/DBDirectoryProcessor.cpp)
+add_executable(simple_pir simplePIR.cpp ../../libpir.hpp)
 target_link_libraries(simple_pir pir pthread ${MPFR_LIBRARIES} ${Boost_LIBRARIES} ${GMP_LIBRARIES} ${GMPXX_LIBRARIES})
 
 

+ 0 - 1
apps/simplepir/simplePIR.cpp

@@ -1,5 +1,4 @@
 #include "libpir.hpp"
-#include "apps/server/DBDirectoryProcessor.hpp"
 
 bool run(DBHandler *db, uint64_t chosen_element, PIRParameters params){
 

+ 2 - 0
libpir.hpp

@@ -9,6 +9,8 @@
 #include <crypto/NFLLWE.hpp>
 #include <crypto/HomomorphicCryptoFactory_internal.hpp>
 #include <crypto/HomomorphicCrypto.hpp>
+#include "pir/dbhandlers/DBGenerator.hpp"
+#include "pir/dbhandlers/DBDirectoryProcessor.hpp"
 #include <stdint.h>
 
 

+ 2 - 0
pir/CMakeLists.txt

@@ -11,6 +11,7 @@ include_directories("/opt/local/include" ${CMAKE_SOURCE_DIR}/crypto ${CMAKE_SOUR
 
 add_subdirectory("events")
 add_subdirectory("optim")
+add_subdirectory("dbhandlers")
 add_subdirectory("queryGen")
 add_subdirectory("replyExtraction")
 add_subdirectory("replyGenerator")
@@ -24,6 +25,7 @@ file(GLOB PIRLIB_SRCS
 	${CMAKE_SOURCE_DIR}/apps/server/DB*.cpp 
 	${CMAKE_SOURCE_DIR}/pir/events/*.cpp 
 	${CMAKE_SOURCE_DIR}/pir/optim/*.cpp 
+	${CMAKE_SOURCE_DIR}/pir/dbhandlers/*.cpp 
 	${CMAKE_SOURCE_DIR}/pir/queryGen/*.cpp 
 	${CMAKE_SOURCE_DIR}/pir/replyExtraction/*.cpp 
 	${CMAKE_SOURCE_DIR}/pir/replyGenerator/*.cpp )

+ 6 - 0
pir/dbhandlers/CMakeLists.txt

@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 2.6.0)
+
+include_directories(..)
+include_directories(../..)
+
+add_library(pir_dbhandlers STATIC DBDirectoryProcessor.cpp DBGenerator.cpp)

+ 0 - 0
apps/server/DBDirectoryProcessor.cpp → pir/dbhandlers/DBDirectoryProcessor.cpp


+ 0 - 0
apps/server/DBDirectoryProcessor.hpp → pir/dbhandlers/DBDirectoryProcessor.hpp


+ 0 - 0
apps/server/DBGenerator.cpp → pir/dbhandlers/DBGenerator.cpp


+ 0 - 0
apps/server/DBGenerator.hpp → pir/dbhandlers/DBGenerator.hpp


+ 0 - 0
apps/server/DBHandler.hpp → pir/dbhandlers/DBHandler.hpp


+ 1 - 1
pir/replyGenerator/GenericPIRReplyGenerator.hpp

@@ -26,7 +26,7 @@
 #include <boost/thread/recursive_mutex.hpp>
 
 #include "pir/PIRParameters.hpp"
-#include "apps/server/DBHandler.hpp"
+#include "pir/dbhandlers/DBHandler.hpp"
 #include "crypto/CryptographicSystem.hpp"
 #include "pir/shared_queue.hpp"
 #include "pir/GlobalConstant.hpp"

+ 0 - 1
pir/replyGenerator/PIRReplyGeneratorFactory.hpp

@@ -22,7 +22,6 @@
 #include <vector>
 
 #include "pir/PIRParameters.hpp"
-#include "apps/server/DBHandler.hpp"
 #include "pir/replyGenerator/PIRReplyGeneratorGMP.hpp"
 #include "pir/replyGenerator/PIRReplyGeneratorNFL_internal.hpp"
 #include "pir/replyGenerator/PIRReplyGeneratorTrivial.hpp"

+ 0 - 1
pir/replyGenerator/PIRReplyGeneratorGMP.hpp

@@ -26,7 +26,6 @@
 
 #include "pir/PIRParameters.hpp"
 #include "pir/replyGenerator/GenericPIRReplyGenerator.hpp"
-#include "apps/server/DBHandler.hpp"
 #include "crypto/PaillierAdapter.hpp"
 
 using namespace std;

+ 1 - 1
pir/replyGenerator/PIRReplyGeneratorNFL_internal.hpp

@@ -23,7 +23,7 @@
 #include "pir/replyGenerator/GenericPIRReplyGenerator.hpp"
 #include "crypto/HomomorphicCrypto.hpp"
 #include "crypto/NFLLWE.hpp"
-#include "apps/server/DBGenerator.hpp"
+#include "pir/dbhandlers/DBGenerator.hpp"
 
 class PIRReplyGeneratorNFL_internal : public GenericPIRReplyGenerator
 {

+ 0 - 1
pir/replyGenerator/PIRReplyGeneratorTrivial.hpp

@@ -21,7 +21,6 @@
 #include "pir/replyGenerator/GenericPIRReplyGenerator.hpp"
 #include "crypto/HomomorphicCrypto.hpp"
 #include "crypto/NoCryptography.hpp"
-#include "apps/server/DBHandler.hpp"
 
 class PIRReplyGeneratorTrivial : public GenericPIRReplyGenerator
 {