Skip to content

Commit

Permalink
adding flags
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrieu committed Aug 14, 2017
1 parent 9c76e74 commit 27d81db
Show file tree
Hide file tree
Showing 39 changed files with 1,866 additions and 3,582 deletions.
13 changes: 0 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,13 @@ include_directories(cryptoTools)
add_subdirectory(libOTe)
include_directories(libOTe)

#############################################
# Build libPSI #
#############################################
add_subdirectory(libPSI)
include_directories(libPSI)

#############################################
# Build libOPRF #
#############################################
add_subdirectory(libOPRF)
include_directories(libOPRF)


#############################################
# Build libPSI Tests #
#############################################
add_subdirectory(libPSI_Tests)
include_directories(libPSI_Tests)


#############################################
# Build Frontend #
#############################################
Expand Down
14 changes: 14 additions & 0 deletions ExternalDependancies.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<libOTeDir>$(SolutionDir)../libOTe</libOTeDir>
</PropertyGroup>
<PropertyGroup />
<ItemDefinitionGroup />
<ItemGroup>
<BuildMacro Include="libOTeDir">
<Value>$(libOTeDir)</Value>
</BuildMacro>
</ItemGroup>
</Project>
46 changes: 30 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ For PSI, we implement 2-party PSI (2PSI) and multi-party PSI (nPSI) in augmented
## Installations

### Required libraries
C++ compiler with C++14 support. There are several library dependencies including [`Boost`](https://sourceforge.net/projects/boost/), [`Crypto++`](http://www.cryptopp.com/), [`Miracl`](https://github.com/miracl/MIRACL), [`Mpir`](http://mpir.org/), [`NTL`](http://www.shoup.net/ntl/) , and [`libOTe`](https://github.com/osu-crypto/libOTe). For [`libOTe`], it requires CPU supporting `PCLMUL`, `AES-NI`, and `SSE4.1`. Optional: `nasm` for improved SHA1 performance. Our code has been tested on both Windows (Microsoft Visual Studio) and Linux. To install the required libraries:
C++ compiler with C++14 support. There are several library dependencies including [`Boost`](https://sourceforge.net/projects/boost/), [`Miracl`](https://github.com/miracl/MIRACL), [`NTL`](http://www.shoup.net/ntl/) , and [`libOTe`](https://github.com/osu-crypto/libOTe). For `libOTe`, it requires CPU supporting `PCLMUL`, `AES-NI`, and `SSE4.1`. Optional: `nasm` for improved SHA1 performance. Our code has been tested on both Windows (Microsoft Visual Studio) and Linux. To install the required libraries:
* windows: open PowerShell, `cd ./thirdparty`, and `.\all_win.ps1`
* linux: `cd ./thirdparty`, and `bash .\all_linux.get`.



NOTE: If you meet problem with `all_win.ps1` or `all_linux.get` which builds boost, miracl and libOTe, please follow the more manual instructions at [`libOTe`](https://github.com/osu-crypto/libOTe)

### Building the Project
After cloning project from git,
##### Windows:
Expand All @@ -28,37 +29,50 @@ After cloning project from git,
##### Linux:
1. make (requirements: `CMake`, `Make`, `g++` or similar)
2. for test:
./Release/bOPRFmain.exe -u
./bin/frontend.exe -u


## Running the code
The database is generated randomly. The outputs include the average online/offline/total runtime that displayed on the screen and output.txt.
#### Flags:
-u unit test which computes PSI of 5 paries, each contains a set of size 2^8 in semihonest setting
-u unit test which computes PSI of 5 paries, 2 dishonestly colluding, each with set size 2^12 in semihonest setting
-n number of parties
-t number of corrupted parties
-p party ID
-m set size
-t number of corrupted parties (in semihonest setting)
-a run in augmented semihonest model. Table-based OPPRF is by default.
-o indicates which OPPRF protocol chosen. Requires -a be set. Table-based OPPRF is by default.
0: Table-based; 1: POLY-seperated; 2-POLY-combined; 3-BloomFilter
-r optimized 3PSI when r = 1
#### Examples:
##### 1. Unit test:
./bOPRFmain.exe -u
./bin/frontend.exe -u

##### 2. two-party PSI:
Compute PSI of 2 parties, each holds 2^8 items
Compute PSI of 2 parties, each holds 2^2 items

./bOPRFmain.exe -n 2 -m 8
./bin/frontend.exe -n 2 -m 12 -p 0 & ./bin/frontend.exe -n 2 -m 12 -p 1

##### 3. nPSI:
Compute PSI of 5 parties, 2 dishonestly colluding, each with set size 2^8 in semihonest setting
##### 3. three-party PSI:
Compute optimized PSI of 3 parties, each holds 2^2 items

./bOPRFmain.exe -n 5 -t 2 -n 8

Compute PSI of 5 parties, 2 dishonestly colluding, each with set size 2^8 in augmented semihonest setting with Bloom filter based OPPRF
./bin/frontend.exe -n 3 -r 1 -m 12 -p 0 & ./bin/frontend.exe -n 3 -r 1 -m 12 -p 1 & ./bin/frontend.exe -n 3 -r 1 -m 12 -p 2

./bOPRFmain.exe -n 5 -t 2 -n 8 -a 1 -o 3
##### 4. nPSI:
Compute PSI of 5 parties, 2 dishonestly colluding, each with set size 2^12 in semihonest setting

./bin/frontend.exe -n 5 -t 2 -m 12 -p 0
& ./bin/frontend.exe -n 5 -t 2 -m 12 -p 1
& ./bin/frontend.exe -n 5 -t 2 -m 12 -p 2
& ./bin/frontend.exe -n 5 -t 2 -m 12 -p 3
& ./bin/frontend.exe -n 5 -t 2 -m 12 -p 4

Compute PSI of 5 parties, 2 dishonestly colluding, each with set size 2^12 in augmented semihonest setting with Bloom filter based OPPRF

./bin/frontend.exe -n 5 -a 3 -m 12 -p 0
& ./bin/frontend.exe -n 5 -a 3 -m 12 -p 1
& ./bin/frontend.exe -n 5 -a 3 -m 12 -p 2
& ./bin/frontend.exe -n 5 -a 3 -m 12 -p 3
& ./bin/frontend.exe -n 5 -a 3 -m 12 -p 4

## Help
For any questions on building or running the library, please contact [`Ni Trieu`](http://people.oregonstate.edu/~trieun/) at trieun at oregonstate dot edu
2 changes: 1 addition & 1 deletion copySourceToLinux.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ $RemoteUserName='trieun'
$RemoteHostName='eve.eecs.oregonstate.edu'
$PrivateKey='D:\EvePrivatekey.ppk'
$SolutionDir=$PWD
$RemoteWorkingDir='/scratch/nini/npsi'
$RemoteWorkingDir='/scratch/nini/osu_github/npsi'

# only files with these exptenstions will be copied
$FileMasks='**.cpp;**.c;**.h;*CMakeLists.txt;*.bin;*.S;thirdparty/linux/**.get'
Expand Down
6 changes: 3 additions & 3 deletions cryptoTools/cryptoTools.vcxproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
Expand All @@ -19,13 +19,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
Expand Down
195 changes: 0 additions & 195 deletions frontend/CLP.cpp

This file was deleted.

43 changes: 0 additions & 43 deletions frontend/CLP.h

This file was deleted.

Loading

0 comments on commit 27d81db

Please sign in to comment.