Skip to content

tiktok-privacy-innovation/PETAce-SetOps

Repository files navigation

PETAce-SetOps

Introduction

PETAce-SetOps is a collection of protocols that perform private set operations. It is one of the many components in the framework PETAce.

Private set operations generally include private set intersection (PSI), private join and compute (PJC), and private information retrieval (PIR) protocols. Currently, PETAce-SetOps implements the ECDH-PSI protocol based on Elliptic-Curve Diffie-Hellman, the KKRT-PSI protocol based on Oblivious Pseudorandom Functions (OPRF), and the PJC protocol based on Circuit-PSI.

Requirements

System Toolchain
Linux Clang++ (>= 5.0) or GNU G++ (>= 5.5), CMake (>= 3.15)
Required dependency Tested version Use
PETAce-Solo 0.3.0 Cryptography primitives
PETAce-Verse 0.3.0 Primitive cryptographic protocols
PETAce-Duet 0.3.0 Two-party secure computing protocols
PETAce-Network 0.3.0 Network communication protocols
Google Logging 0.4.0 Logging
JSON for Modern C++(JSON) 3.10.1 PSI parameter configuration
Optional dependency Tested version Use
GoogleTest 1.12.1 For running tests
gflags 2.2.2 For running benchmarks

Building PETAce-SetOps

We assume that all commands presented below are executed in the root directory of PETAce-SetOps.

First, build JSON for Modern C++ (JSON) using the following scripts. Assume that JSON is cloned into the directory ${JSON}.

cmake -B ${JSON}/build -S ${JSON}
cmake --build ${JSON}/build -j

Then, build PETAce-SetOps library (optionally with test and example):

cmake -S . -B build -Dnlohmann_json_DIR=${JSON}/build -DSETOPS_BUILD_TEST=ON -DSETOPS_BUILD_EXAMPLE=ON
cmake --build build

Output binaries can be found in build/lib/ and build/bin/ directories.

Compile Options Values Default Description
CMAKE_BUILD_TYPE Release/Debug Release Debug mode decreases run-time performance.
SETOPS_BUILD_SHARED_LIBS ON/OFF OFF Build a shared library if set to ON.
SETOPS_BUILD_EXAMPLE ON/OFF ON Build C++ example if set to ON.
SETOPS_BUILD_TEST ON/OFF ON Build C++ test if set to ON.
SETOPS_BUILD_DEPS ON/OFF ON Download and build unmet dependencies if set to ON.

Here we give a simple example to run protocols in PETAce-SetOps.

To run as Party A (a sender):

bash build/example/scripts/ecdh_psi_sender_example.sh

To run as Party B (a receiver):

bash build/example/scripts/ecdh_psi_receiver_example.sh

Contribution

Please check Contributing for more details.

Code of Conduct

Please check Code of Conduct for more details.

License

This project is licensed under the Apache-2.0 License.

Citing PETAce

To cite PETAce in academic papers, please use the following BibTeX entries.

Version 0.3.0

    @misc{petace,
        title = {PETAce (release 0.3.0)},
        howpublished = {\url{https://github.com/tiktok-privacy-innovation/PETAce}},
        month = Jun,
        year = 2024,
        note = {TikTok Pte. Ltd.},
        key = {PETAce}
    }