Skip to content

Commit

Permalink
feat: version 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PETAce committed Jun 27, 2024
1 parent 89a68a8 commit f4f47bf
Show file tree
Hide file tree
Showing 23 changed files with 35 additions and 771 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,9 @@ paket-files/
__pycache__/
*.pyc

# pycharm
.idea

# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@
### Features

- Added KKRT-PSI
- Added Circuit-PSI
- Added Circuit-PSI

## Version 0.3.0

### Feature

- Migrated Python API to PETAce repository.
31 changes: 7 additions & 24 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if(NOT CMAKE_BUILD_TYPE)
endif()
message(STATUS "Build type (CMAKE_BUILD_TYPE): ${CMAKE_BUILD_TYPE}")

project(SETOPS VERSION 0.2.0 LANGUAGES CXX C)
project(SETOPS VERSION 0.3.0 LANGUAGES CXX C)

########################
# Global configuration #
Expand Down Expand Up @@ -203,7 +203,7 @@ if(NOT TARGET OpenMP::OpenMP_CXX)
endif()

# PETAce-Network::network
find_package(PETAce-Network 0.2 QUIET CONFIG)
find_package(PETAce-Network 0.3 QUIET CONFIG)
if(PETAce-Network_FOUND)
message(STATUS "PETAce-Network: found")
if(PETAce-Network_STATIC_FOUND)
Expand All @@ -227,7 +227,7 @@ else()
endif()

# PETAce-Solo::solo
find_package(PETAce-Solo 0.2 QUIET CONFIG)
find_package(PETAce-Solo 0.3 QUIET CONFIG)
if(PETAce-Solo_FOUND)
message(STATUS "PETAce-Solo: found")
if(PETAce-Solo_STATIC_FOUND)
Expand All @@ -251,7 +251,7 @@ else()
endif()

# PETAce-Verse::verse
find_package(PETAce-Verse 0.2 QUIET CONFIG)
find_package(PETAce-Verse 0.3 QUIET CONFIG)
if(PETAce-Verse_FOUND)
message(STATUS "PETAce-Verse: found")
if(PETAce-Verse_STATIC_FOUND)
Expand All @@ -275,7 +275,7 @@ else()
endif()

# PETAce-Duet::duet
find_package(PETAce-Duet 0.2 QUIET CONFIG)
find_package(PETAce-Duet 0.3 QUIET CONFIG)
if(PETAce-Duet_FOUND)
message(STATUS "PETAce-Duet: found")
if(PETAce-Duet_STATIC_FOUND)
Expand Down Expand Up @@ -369,12 +369,9 @@ if(NOT SETOPS_BUILD_SHARED_LIBS)
target_include_directories(setops PUBLIC
$<BUILD_INTERFACE:$<TARGET_PROPERTY:${network},INTERFACE_INCLUDE_DIRECTORIES>>
$<INSTALL_INTERFACE:${SETOPS_INCLUDES_INSTALL_DIR}>)
setops_combine_archives(setops ${network})
set(SETOPS_CARRY_NETWORK TRUE)
else()
target_link_libraries(setops PUBLIC ${network})
set(SETOPS_CARRY_NETWORK FALSE)
endif()
target_link_libraries(setops PUBLIC ${network})
set(SETOPS_CARRY_NETWORK FALSE)

if(SETOPS_BUILD_SOLO)
add_dependencies(setops ${solo})
Expand Down Expand Up @@ -575,17 +572,3 @@ if(SETOPS_BUILD_TEST)
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
endif()
endif()

##################
# SETOPS python #
##################

# [OPTION] SETOPS_BUILD_PYTHON (DEFAULT: OFF)
# Build a shared library if set to ON.
set(SETOPS_BUILD_PYTHON_STR "Build python shared library")
option(SETOPS_BUILD_PYTHON ${SETOPS_BUILD_PYTHON_STR} OFF)
message(STATUS "SETOPS_BUILD_PYTHON: ${SETOPS_BUILD_PYTHON}")

if(SETOPS_BUILD_PYTHON)
add_subdirectory(python)
endif()
35 changes: 8 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ Currently, PETAce-SetOps implements the ECDH-PSI protocol based on Elliptic-Curv

| Required dependency | Tested version | Use |
|--------------------------------------------------------------------------------|----------------|--------------------------------------|
| [PETAce-Solo](https://github.com/tiktok-privacy-innovation/PETAce-Solo) | 0.2.0 | Cryptography primitives |
| [PETAce-Verse](https://github.com/tiktok-privacy-innovation/PETAce-Verse) | 0.2.0 | Primitive cryptographic protocols |
| [PETAce-Duet](https://github.com/tiktok-privacy-innovation/PETAce-Duet) | 0.2.0 | Two-party secure computing protocols |
| [PETAce-Network](https://github.com/tiktok-privacy-innovation/PETAce-Network) | 0.2.0 | Network communication protocols |
| [PETAce-Solo](https://github.com/tiktok-privacy-innovation/PETAce-Solo) | 0.3.0 | Cryptography primitives |
| [PETAce-Verse](https://github.com/tiktok-privacy-innovation/PETAce-Verse) | 0.3.0 | Primitive cryptographic protocols |
| [PETAce-Duet](https://github.com/tiktok-privacy-innovation/PETAce-Duet) | 0.3.0 | Two-party secure computing protocols |
| [PETAce-Network](https://github.com/tiktok-privacy-innovation/PETAce-Network) | 0.3.0 | Network communication protocols |
| [Google Logging](https://github.com/google/glog) | 0.4.0 | Logging |
| [JSON for Modern C++(JSON)](https://github.com/nlohmann/json) | 3.10.1 | PSI parameter configuration |

Expand Down Expand Up @@ -57,18 +57,6 @@ Output binaries can be found in `build/lib/` and `build/bin/` directories.
| `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. |

### Building python
To build PETAce-Setops python package:

```bash
cmake -S . -B build -DDUET_BUILD_PYTHON=ON -Dnlohmann_json_DIR=${JSON}/build
cmake --build build
cd build
make wheel
cd python/wheel
pip3 install petace_setops-0.2.0-py3-none-any.whl
```

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

To run as Party A (a sender):
Expand All @@ -83,13 +71,6 @@ To run as Party B (a receiver):
bash build/example/scripts/ecdh_psi_receiver_example.sh
```

To run python examples, execute the following in commands in separate terminal sessions.

```bash
python3 ./example/setops_example.py -p 0
python3 ./example/setops_example.py -p 1
```

## Contribution

Please check [Contributing](CONTRIBUTING.md) for more details.
Expand All @@ -106,14 +87,14 @@ This project is licensed under the [Apache-2.0 License](LICENSE).

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

### Version 0.2.0
### Version 0.3.0

```tex
@misc{petace,
title = {PETAce (release 0.2.0)},
title = {PETAce (release 0.3.0)},
howpublished = {\url{https://github.com/tiktok-privacy-innovation/PETAce}},
month = Oct,
year = 2023,
month = Jun,
year = 2024,
note = {TikTok Pte. Ltd.},
key = {PETAce}
}
Expand Down
2 changes: 1 addition & 1 deletion cmake/PETAce-Duet.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
FetchContent_Declare(
duet
GIT_REPOSITORY https://github.com/tiktok-privacy-innovation/PETAce-Duet.git
GIT_TAG be580aded7b037491d481cb6d03f52cc91d6554d # 0.2.0
GIT_TAG 35a121196c6702632d1659402d01290be813220c # 0.3.0
)
FetchContent_GetProperties(duet)

Expand Down
2 changes: 1 addition & 1 deletion cmake/PETAce-Network.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
FetchContent_Declare(
network
GIT_REPOSITORY https://github.com/tiktok-privacy-innovation/PETAce-Network.git
GIT_TAG 92d1a6f079cd11e01bc8e610cb92126ede2964b1 # 0.2.0
GIT_TAG 1952a0e0b061c5b43a7fbe5b8d71365abc5382a4 # 0.3.0
)
FetchContent_GetProperties(network)

Expand Down
4 changes: 2 additions & 2 deletions cmake/PETAce-Solo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
FetchContent_Declare(
solo
GIT_REPOSITORY https://github.com/tiktok-privacy-innovation/PETAce-Solo.git
GIT_TAG ead22f615120a0cd9926cfc5d5787fe4bcda379c # 0.2.0
GIT_TAG 60c6301802040f622d30c148ab49ad42f5b0e3d2 # 0.3.0
)
FetchContent_GetProperties(solo)

Expand All @@ -26,7 +26,7 @@ if(NOT solo_POPULATED)
set(SOLO_BUILD_TEST OFF CACHE BOOL "" FORCE)
set(SOLO_BUILD_BENCH OFF CACHE BOOL "" FORCE)
set(SOLO_BUILD_EXAMPLE OFF CACHE BOOL "" FORCE)
set(SOLO_USE_IPCL ON CACHE BOOL "" FORCE)
set(SOLO_USE_IPCL OFF CACHE BOOL "" FORCE)

mark_as_advanced(FETCHCONTENT_SOURCE_DIR_SOLO)
mark_as_advanced(FETCHCONTENT_UPDATES_DISCONNECTED_SOLO)
Expand Down
3 changes: 2 additions & 1 deletion cmake/PETAce-Verse.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
FetchContent_Declare(
verse
GIT_REPOSITORY https://github.com/tiktok-privacy-innovation/PETAce-Verse.git
GIT_TAG f79ede7af704293de32aa44be8c967e1d0eaa3dc # 0.2.0
GIT_TAG 34ffb78e122805f5358cb77ae0ce2bb6f6241060 # 0.3.0
)
FetchContent_GetProperties(verse)

Expand All @@ -25,6 +25,7 @@ if(NOT verse_POPULATED)
set(VERSE_BUILD_SHARED_LIBS ${SETOPS_BUILD_SHARED_LIBS} CACHE BOOL "" FORCE)
set(VERSE_BUILD_TEST OFF CACHE BOOL "" FORCE)
set(VERSE_BUILD_EXAMPLE OFF CACHE BOOL "" FORCE)
set(VERSE_BUILD_BENCH OFF CACHE BOOL "" FORCE)

mark_as_advanced(FETCHCONTENT_SOURCE_DIR_VERSE)
mark_as_advanced(FETCHCONTENT_UPDATES_DISCONNECTED_VERSE)
Expand Down
4 changes: 2 additions & 2 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@

cmake_minimum_required(VERSION 3.14)

project(SETOPSExamples VERSION 0.2.0 LANGUAGES CXX)
project(SETOPSExamples VERSION 0.3.0 LANGUAGES CXX)

# If not called from root CMakeLists.txt
if(NOT DEFINED SETOPS_BUILD_EXAMPLE)
set(SETOPS_BUILD_EXAMPLE ON)

# Import PETAce SETOPS
find_package(PETAce-SetOps 0.2.0 EXACT REQUIRED)
find_package(PETAce-SetOps 0.3.0 EXACT REQUIRED)

add_compile_options(-msse4.2 -Wno-ignored-attributes -mavx)

Expand Down
57 changes: 0 additions & 57 deletions example/setops_example.py

This file was deleted.

100 changes: 0 additions & 100 deletions python/CMakeLists.txt

This file was deleted.

Loading

0 comments on commit f4f47bf

Please sign in to comment.