************************* Prerequisite: The latest OpenSSL needs to be installed. The version I use is 1.0.1e. Lower versions might not work. You can download the source from: http://www.openssl.org/source/openssl-1.0.1e.tar.gz Then install it on your computer. For example, I did the following on my Macs: sudo ./configure --prefix=/usr/ darwin64-x86_64-cc shared sudo make sudo make test sudo make install If you want to build the PSI programs in Xcode, you might need more steps because the version of the default OpenSSL in the SDK is 0.9.8. I did the following: 1 Locate the directory of the SDK. For example, on my computer it in "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk". 2 Go to the "usr/lib" directory under the SDK directory. 3 Change the symbolic link libssl.dylib to make it point to the new library. On my computer, I point it to "/usr/lib/libssl.1.0.0.dylib". 4 In the same directory, change the symbolic link libcrypto.dylib to make it point to the new library. On my computer, I point it to "/usr/lib/libcrypto.1.0.0.dylib". 5 Go to the "usr/include" directory under the SDK directory. 6 Rename the "openssl" directory. 7 Create a symbolic link named "openssl" that points to the new header directory. For example, on my computer, it points to "/usr/include/openssl". ************************* Compile the source: The source can compile on Mac OSX 10.7/10.8. We haven't tried other operating systems. Minor changes might be needed to compile the source on *nix systems. There are two ways to compile the source: (1) A simple makefile is provided. Open a terminal window, change directory, then make. (2) Compile it in Xcode. The source is organized as an Xcode project. You can find the .xcodeproj file in the directory. Click to launch Xcode. Then you can build the targets psiClient and psiServer in Xcode. ************************* How to Use: You can run the server using a command like: ./psiServer -n 1000000 -k 80 -t 1 -v 0 -d 10 Then run the client using a command like: ./psiClient -a 127.0.0.1 -n 1000000 -k 80 -t 1 -v 0 -d 10 The server's and the client's arguments need to match (except -a). The meaning of the arguments: -a Specify the server's IP address. This is mandatory when invoking the client. Not a valid option for the server program. -n The number of elements in the set. The program generates a random int set of size n and run the protocol. -k The security parameter. The value can be 80, 128, 192, 256. The option can be omitted, if so, 80 will be used as the default security parameter. -t Threading mode. The following value can be 1 or 0. If the value is 1, then the program runs in the parallel mode and all cores on the computer will be used. If the value is 0, then the program runs in the pipelined mode and uses 1 thread for computation and 1 thread for communication. -v Verification. The following value can be 1 or 0. If the value is 1, the server sends its set to the client and the output of the protocol will be verified against the original sets. If the value is 0, the verification step is skipped. The option can be omitted, if so, the verification step is skipped. -d Multipart OT. Split the OT into multiple parts. The value supplied can be an integer > 1. If used, the memory usage can be lowered because the bit matrix used in the OT is smaller. However the protocol also runs longer. Run the program without this option if you have enough RAM. If you want to run the programs with sets supplied by you, you have to modify the source code to let the server and client do so. Another place you need to modify is the "param.h" file in "headers" directory. You need to change "defaultDatalen" to the byte size of your data elements. The TCP port can also be changed here.