Browse Source

fixing test bug and patching readme. Also deleting files

Sebastian Angel 2 years ago
parent
commit
c7916baa05
6 changed files with 23 additions and 394 deletions
  1. 0 8
      CTestTestfile.cmake
  2. 21 8
      README.md
  3. 0 298
      src/Makefile
  4. 0 39
      src/cmake_install.cmake
  5. 0 39
      test/cmake_install.cmake
  6. 2 2
      test/coefficient_conversion_test.cpp

+ 0 - 8
CTestTestfile.cmake

@@ -1,8 +0,0 @@
-# CMake generated Testfile for 
-# Source directory: /home/andrew/Documents/Research/AC-PIR/SealPIR
-# Build directory: /home/andrew/Documents/Research/AC-PIR/SealPIR
-# 
-# This file includes the relevant testing commands required for 
-# testing this directory and lists subdirectories to be tested as well.
-subdirs("src")
-subdirs("test")

+ 21 - 8
README.md

@@ -9,25 +9,38 @@ a copy of the paper [here](https://eprint.iacr.org/2017/1142.pdf).
 This is a newer version of SealPIR that uses the latest version of SEAL
 and provides better serialization/deserialization of queries and responses,
 and a more streamlined code base. A drawback of this version is that ciphertexts 
-are slightly larger (due to specifics with SEAL). If you wish to use the 
-original version of SealPIR which uses an older version of SEAL and has smaller
-ciphertexts, check out the [original](https://github.com/microsoft/SealPIR/tree/original) 
-branch in this repository.
+are slightly larger (due to specifics with SEAL).
+
+If you wish to use the **original** version of SealPIR which uses an older version 
+of SEAL and **has smaller ciphertexts**, check out the 
+[original](https://github.com/microsoft/SealPIR/tree/ccf86c50fd3291) branch in this 
+repository.
 
 # Compiling SEAL
 
-SealPIR depends on [Microsoft SEAL version 3.6.5](https://github.com/microsoft/SEAL/tree/3.6.5).
+SealPIR depends on [Microsoft SEAL version 3.6.6](https://github.com/microsoft/SEAL/tree/3.6.6).
 Install SEAL before compiling SealPIR.
 
 # Compiling SealPIR
 
-Once Microsoft SEAL 3.6.5 is installed, to build SealPIR simply run:
+Once Microsoft SEAL 3.6.6 is installed, to build SealPIR simply run:
 
-	cmake .
-	make
+```
+cmake .
+make
+```
 	
 This should produce a binary file ``bin/main``.
 
+# Testing SealPIR
+
+Once you have compiled SealPIR, you can test that everything is working
+correctly by running:
+
+```
+ctest
+```
+
 # Using SealPIR
 
 Take a look at the example in `src/main.cpp` for how to use SealPIR. 

+ 0 - 298
src/Makefile

@@ -1,298 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 3.16
-
-# Default target executed when no arguments are given to make.
-default_target: all
-
-.PHONY : default_target
-
-# Allow only one "make -f Makefile2" at a time, but pass parallelism.
-.NOTPARALLEL:
-
-
-#=============================================================================
-# Special targets provided by cmake.
-
-# Disable implicit rules so canonical targets will work.
-.SUFFIXES:
-
-
-# Remove some rules from gmake that .SUFFIXES does not remove.
-SUFFIXES =
-
-.SUFFIXES: .hpux_make_needs_suffix_list
-
-
-# Suppress display of executed commands.
-$(VERBOSE).SILENT:
-
-
-# A target that is always out of date.
-cmake_force:
-
-.PHONY : cmake_force
-
-#=============================================================================
-# Set environment variables for the build.
-
-# The shell in which to execute make rules.
-SHELL = /bin/sh
-
-# The CMake executable.
-CMAKE_COMMAND = /usr/bin/cmake
-
-# The command to remove a file.
-RM = /usr/bin/cmake -E remove -f
-
-# Escaping for special characters.
-EQUALS = =
-
-# The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /home/andrew/Documents/Research/AC-PIR/SealPIR
-
-# The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /home/andrew/Documents/Research/AC-PIR/SealPIR
-
-#=============================================================================
-# Targets provided globally by CMake.
-
-# Special rule for the target rebuild_cache
-rebuild_cache:
-	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
-	/usr/bin/cmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
-.PHONY : rebuild_cache
-
-# Special rule for the target rebuild_cache
-rebuild_cache/fast: rebuild_cache
-
-.PHONY : rebuild_cache/fast
-
-# Special rule for the target edit_cache
-edit_cache:
-	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..."
-	/usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
-.PHONY : edit_cache
-
-# Special rule for the target edit_cache
-edit_cache/fast: edit_cache
-
-.PHONY : edit_cache/fast
-
-# Special rule for the target test
-test:
-	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests..."
-	/usr/bin/ctest --force-new-ctest-process $(ARGS)
-.PHONY : test
-
-# Special rule for the target test
-test/fast: test
-
-.PHONY : test/fast
-
-# The main all target
-all: cmake_check_build_system
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(CMAKE_COMMAND) -E cmake_progress_start /home/andrew/Documents/Research/AC-PIR/SealPIR/CMakeFiles /home/andrew/Documents/Research/AC-PIR/SealPIR/src/CMakeFiles/progress.marks
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(MAKE) -f CMakeFiles/Makefile2 src/all
-	$(CMAKE_COMMAND) -E cmake_progress_start /home/andrew/Documents/Research/AC-PIR/SealPIR/CMakeFiles 0
-.PHONY : all
-
-# The main clean target
-clean:
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(MAKE) -f CMakeFiles/Makefile2 src/clean
-.PHONY : clean
-
-# The main clean target
-clean/fast: clean
-
-.PHONY : clean/fast
-
-# Prepare targets for installation.
-preinstall: all
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(MAKE) -f CMakeFiles/Makefile2 src/preinstall
-.PHONY : preinstall
-
-# Prepare targets for installation.
-preinstall/fast:
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(MAKE) -f CMakeFiles/Makefile2 src/preinstall
-.PHONY : preinstall/fast
-
-# clear depends
-depend:
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
-.PHONY : depend
-
-# Convenience name for target.
-src/CMakeFiles/main.dir/rule:
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(MAKE) -f CMakeFiles/Makefile2 src/CMakeFiles/main.dir/rule
-.PHONY : src/CMakeFiles/main.dir/rule
-
-# Convenience name for target.
-main: src/CMakeFiles/main.dir/rule
-
-.PHONY : main
-
-# fast build rule for target.
-main/fast:
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(MAKE) -f src/CMakeFiles/main.dir/build.make src/CMakeFiles/main.dir/build
-.PHONY : main/fast
-
-# Convenience name for target.
-src/CMakeFiles/sealpir.dir/rule:
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(MAKE) -f CMakeFiles/Makefile2 src/CMakeFiles/sealpir.dir/rule
-.PHONY : src/CMakeFiles/sealpir.dir/rule
-
-# Convenience name for target.
-sealpir: src/CMakeFiles/sealpir.dir/rule
-
-.PHONY : sealpir
-
-# fast build rule for target.
-sealpir/fast:
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(MAKE) -f src/CMakeFiles/sealpir.dir/build.make src/CMakeFiles/sealpir.dir/build
-.PHONY : sealpir/fast
-
-main.o: main.cpp.o
-
-.PHONY : main.o
-
-# target to build an object file
-main.cpp.o:
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(MAKE) -f src/CMakeFiles/main.dir/build.make src/CMakeFiles/main.dir/main.cpp.o
-.PHONY : main.cpp.o
-
-main.i: main.cpp.i
-
-.PHONY : main.i
-
-# target to preprocess a source file
-main.cpp.i:
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(MAKE) -f src/CMakeFiles/main.dir/build.make src/CMakeFiles/main.dir/main.cpp.i
-.PHONY : main.cpp.i
-
-main.s: main.cpp.s
-
-.PHONY : main.s
-
-# target to generate assembly for a file
-main.cpp.s:
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(MAKE) -f src/CMakeFiles/main.dir/build.make src/CMakeFiles/main.dir/main.cpp.s
-.PHONY : main.cpp.s
-
-pir.o: pir.cpp.o
-
-.PHONY : pir.o
-
-# target to build an object file
-pir.cpp.o:
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(MAKE) -f src/CMakeFiles/sealpir.dir/build.make src/CMakeFiles/sealpir.dir/pir.cpp.o
-.PHONY : pir.cpp.o
-
-pir.i: pir.cpp.i
-
-.PHONY : pir.i
-
-# target to preprocess a source file
-pir.cpp.i:
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(MAKE) -f src/CMakeFiles/sealpir.dir/build.make src/CMakeFiles/sealpir.dir/pir.cpp.i
-.PHONY : pir.cpp.i
-
-pir.s: pir.cpp.s
-
-.PHONY : pir.s
-
-# target to generate assembly for a file
-pir.cpp.s:
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(MAKE) -f src/CMakeFiles/sealpir.dir/build.make src/CMakeFiles/sealpir.dir/pir.cpp.s
-.PHONY : pir.cpp.s
-
-pir_client.o: pir_client.cpp.o
-
-.PHONY : pir_client.o
-
-# target to build an object file
-pir_client.cpp.o:
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(MAKE) -f src/CMakeFiles/sealpir.dir/build.make src/CMakeFiles/sealpir.dir/pir_client.cpp.o
-.PHONY : pir_client.cpp.o
-
-pir_client.i: pir_client.cpp.i
-
-.PHONY : pir_client.i
-
-# target to preprocess a source file
-pir_client.cpp.i:
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(MAKE) -f src/CMakeFiles/sealpir.dir/build.make src/CMakeFiles/sealpir.dir/pir_client.cpp.i
-.PHONY : pir_client.cpp.i
-
-pir_client.s: pir_client.cpp.s
-
-.PHONY : pir_client.s
-
-# target to generate assembly for a file
-pir_client.cpp.s:
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(MAKE) -f src/CMakeFiles/sealpir.dir/build.make src/CMakeFiles/sealpir.dir/pir_client.cpp.s
-.PHONY : pir_client.cpp.s
-
-pir_server.o: pir_server.cpp.o
-
-.PHONY : pir_server.o
-
-# target to build an object file
-pir_server.cpp.o:
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(MAKE) -f src/CMakeFiles/sealpir.dir/build.make src/CMakeFiles/sealpir.dir/pir_server.cpp.o
-.PHONY : pir_server.cpp.o
-
-pir_server.i: pir_server.cpp.i
-
-.PHONY : pir_server.i
-
-# target to preprocess a source file
-pir_server.cpp.i:
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(MAKE) -f src/CMakeFiles/sealpir.dir/build.make src/CMakeFiles/sealpir.dir/pir_server.cpp.i
-.PHONY : pir_server.cpp.i
-
-pir_server.s: pir_server.cpp.s
-
-.PHONY : pir_server.s
-
-# target to generate assembly for a file
-pir_server.cpp.s:
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(MAKE) -f src/CMakeFiles/sealpir.dir/build.make src/CMakeFiles/sealpir.dir/pir_server.cpp.s
-.PHONY : pir_server.cpp.s
-
-# Help Target
-help:
-	@echo "The following are some of the valid targets for this Makefile:"
-	@echo "... all (the default if no target is provided)"
-	@echo "... clean"
-	@echo "... depend"
-	@echo "... rebuild_cache"
-	@echo "... edit_cache"
-	@echo "... test"
-	@echo "... main"
-	@echo "... sealpir"
-	@echo "... main.o"
-	@echo "... main.i"
-	@echo "... main.s"
-	@echo "... pir.o"
-	@echo "... pir.i"
-	@echo "... pir.s"
-	@echo "... pir_client.o"
-	@echo "... pir_client.i"
-	@echo "... pir_client.s"
-	@echo "... pir_server.o"
-	@echo "... pir_server.i"
-	@echo "... pir_server.s"
-.PHONY : help
-
-
-
-#=============================================================================
-# Special targets to cleanup operation of make.
-
-# Special rule to run CMake to check the build system integrity.
-# No rule that depends on this can have commands that come from listfiles
-# because they might be regenerated.
-cmake_check_build_system:
-	cd /home/andrew/Documents/Research/AC-PIR/SealPIR && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
-.PHONY : cmake_check_build_system
-

+ 0 - 39
src/cmake_install.cmake

@@ -1,39 +0,0 @@
-# Install script for directory: /home/andrew/Documents/Research/AC-PIR/SealPIR/src
-
-# Set the install prefix
-if(NOT DEFINED CMAKE_INSTALL_PREFIX)
-  set(CMAKE_INSTALL_PREFIX "/usr/local")
-endif()
-string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
-
-# Set the install configuration name.
-if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
-  if(BUILD_TYPE)
-    string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
-           CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
-  else()
-    set(CMAKE_INSTALL_CONFIG_NAME "")
-  endif()
-  message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
-endif()
-
-# Set the component getting installed.
-if(NOT CMAKE_INSTALL_COMPONENT)
-  if(COMPONENT)
-    message(STATUS "Install component: \"${COMPONENT}\"")
-    set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
-  else()
-    set(CMAKE_INSTALL_COMPONENT)
-  endif()
-endif()
-
-# Install shared libraries without execute permission?
-if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
-  set(CMAKE_INSTALL_SO_NO_EXE "1")
-endif()
-
-# Is this installation the result of a crosscompile?
-if(NOT DEFINED CMAKE_CROSSCOMPILING)
-  set(CMAKE_CROSSCOMPILING "FALSE")
-endif()
-

+ 0 - 39
test/cmake_install.cmake

@@ -1,39 +0,0 @@
-# Install script for directory: /home/andrew/Documents/Research/AC-PIR/SealPIR/test
-
-# Set the install prefix
-if(NOT DEFINED CMAKE_INSTALL_PREFIX)
-  set(CMAKE_INSTALL_PREFIX "/usr/local")
-endif()
-string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
-
-# Set the install configuration name.
-if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
-  if(BUILD_TYPE)
-    string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
-           CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
-  else()
-    set(CMAKE_INSTALL_CONFIG_NAME "")
-  endif()
-  message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
-endif()
-
-# Set the component getting installed.
-if(NOT CMAKE_INSTALL_COMPONENT)
-  if(COMPONENT)
-    message(STATUS "Install component: \"${COMPONENT}\"")
-    set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
-  else()
-    set(CMAKE_INSTALL_COMPONENT)
-  endif()
-endif()
-
-# Install shared libraries without execute permission?
-if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
-  set(CMAKE_INSTALL_SO_NO_EXE "1")
-endif()
-
-# Is this installation the result of a crosscompile?
-if(NOT DEFINED CMAKE_CROSSCOMPILING)
-  set(CMAKE_CROSSCOMPILING "FALSE")
-endif()
-

+ 2 - 2
test/coefficient_conversion_test.cpp

@@ -16,8 +16,8 @@ using namespace seal;
 int main(int argc, char *argv[]) {
 
     const uint32_t logt = 16; 
-    uint32_t ele_size = 3;
-    uint32_t num_ele = 3;
+    const uint32_t ele_size = 3;
+    const uint32_t num_ele = 3;
     uint8_t bytes[ele_size * num_ele] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
 
     vector<uint64_t> coeffs;