Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added DPFs and Foleage F4 OLE and triples #168

Merged
merged 49 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
ea29524
dpf v1
ladnir Nov 22, 2024
0d619a2
partia
ladnir Dec 4, 2024
6d1ade0
sparse dpf
ladnir Jan 23, 2025
23ef8f1
ported foliage and some optimizations
ladnir Jan 27, 2025
c834400
FoliageF4Ole
ladnir Jan 28, 2025
b81ff60
foleage fft attempted opt and started tri dpf
ladnir Feb 5, 2025
d1d92e5
partial
ladnir Feb 9, 2025
56b46da
tridpf partially working
ladnir Feb 11, 2025
c7bd266
triDpf Working
ladnir Feb 12, 2025
ba0b0b3
optimized triDpf
ladnir Feb 12, 2025
6b38a80
dpf refactor and bugfix
ladnir Feb 14, 2025
9690295
dpf refactor and keygen
ladnir Feb 14, 2025
1172936
dpf noninteractive eval fix
ladnir Feb 14, 2025
b158839
triDpf PCG working
ladnir Feb 15, 2025
58ca103
foliage 243 elem leaf
ladnir Feb 15, 2025
25af213
foleage dpf for leaf working
ladnir Feb 16, 2025
2f8b2bc
shared foleage position done and tensor coeff started
ladnir Feb 16, 2025
f732a6e
distributed foliage working
ladnir Feb 17, 2025
f7c1bb1
foleage cleanup
ladnir Feb 17, 2025
b4f0cda
optimizing
ladnir Feb 18, 2025
55f6313
merge master
ladnir Feb 19, 2025
062ffb4
cleanup
ladnir Feb 19, 2025
d6eddda
working version
ladnir Feb 25, 2025
871bbc2
foleage cleanup
ladnir Feb 26, 2025
4d5b0fa
fixed sparse dpf
ladnir Feb 26, 2025
b667196
foleage ci
ladnir Feb 26, 2025
6bc720b
foleage mac compile
ladnir Feb 26, 2025
f0b1a86
removing deprecated calls
ladnir Feb 26, 2025
ea8a068
removing deprecated calls
ladnir Feb 26, 2025
5ffb297
mac compile fixes
ladnir Feb 26, 2025
1568af3
mac compile fixes
ladnir Feb 26, 2025
1d72b98
mac ci debug
ladnir Feb 26, 2025
7ee0cda
mac ci debug
ladnir Feb 26, 2025
866d832
mac ci debug
ladnir Feb 26, 2025
5da5b1b
mac compile fixes
ladnir Feb 26, 2025
1bc509c
mac compile fixes
ladnir Feb 26, 2025
3225f82
mac compile fixes
ladnir Feb 26, 2025
f8939a9
mac compile fixes
ladnir Feb 26, 2025
8cabf66
mac ci debug
ladnir Feb 27, 2025
72401f9
mac ci debug
ladnir Feb 27, 2025
d1091db
mac ci debug
ladnir Feb 27, 2025
deb7860
mac ci debug
ladnir Feb 27, 2025
d5adf47
mac ci debug
ladnir Feb 27, 2025
28c7cb5
mac ci debug
ladnir Feb 27, 2025
54bcd80
mac ci debug
ladnir Feb 27, 2025
c5a0c62
ci working
ladnir Feb 27, 2025
3d46d15
dpf fix
ladnir Feb 27, 2025
b0b5750
added conditional compile options
ladnir Feb 27, 2025
af5aca1
readme
ladnir Feb 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ name: CI
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master, stage, components, cpp20 ]
branches: [ master, stage, foliage, cpp20 ]
pull_request:
branches: [ master, stage, components ]
branches: [ master, stage, foliage ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
run: python3 build.py -DENABLE_BOOST=OFF -DVERBOSE_FETCH=ON -DENABLE_SSE=OFF -DENABLE_MOCK_OT=true -D ENABLE_ALL_OT=ON

- name: unit tests
run: ./out/build/osx/frontend/frontend_libOTe -u
run: ./out/build/osx/frontend/frontend_libOTe -u


- name: find source tree
Expand Down Expand Up @@ -210,7 +210,7 @@ jobs:

# Runs a set of commands using the runners shell
- name: build libOTe
run: python3 build.py --par=1 -D ENABLE_ALL_OT=ON -DENABLE_MOCK_OT=true -G Ninja
run: python3 build.py -D ENABLE_ALL_OT=ON -DENABLE_MOCK_OT=true -G Ninja


- name: unit test
Expand Down
15 changes: 7 additions & 8 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"FETCH_AUTO": true,
"ENABLE_ALL_OT": true,
"ENABLE_SSE": true,
Expand Down Expand Up @@ -36,9 +36,8 @@
"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": {
"sourceDir": "$env{HOME}/.vs/$ms{projectDirName}",
"copySourcesOptions": {
"exclusionList": [ ".vs", "out/build", "out/install", "out/boost*", "out/relic/build", ".git" ]
},
"rsyncCommandArgs": [ "-t", "--delete", "--include=${sourceDir}/out/macoro/*", "--verbose" ]
"exclusionList": [ ".vs", "out", ".git" ]
}
}
}
},
Expand All @@ -64,15 +63,15 @@
"ENABLE_MR": "ON",
"ENABLE_SIMPLESTOT": "ON",
"ENABLE_GMP": false,
"ENABLE_RELIC": true,
"ENABLE_SODIUM": false,
"ENABLE_RELIC": false,
"ENABLE_SODIUM": true,
"ENABLE_BOOST": true,
"ENABLE_BITPOLYMUL": true,
"FETCH_AUTO": "ON",
"ENABLE_CIRCUITS": true,
"VERBOSE_FETCH": true,
"ENABLE_SSE": true,
"ENABLE_AVX": true,
"ENABLE_SSE": false,
"ENABLE_AVX": false,
"ENABLE_ASAN": true,
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
"CMAKE_PREFIX_PATH": "${sourceDir}/../out/install/${presetName}"
Expand Down
63 changes: 54 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,35 @@ Malicious OT extension:

Vole:
* Generic subfield noisy VOLE (semi-honest) [[BCGIKRS19]](https://eprint.iacr.org/2019/1159.pdf)
* Generic subfield silent VOLE (malicious/semi-honest) [[BCGIKRS19]](https://eprint.iacr.org/2019/1159.pdf),[[RRT23]](https://eprint.iacr.org/2023/882).
* Generic subfield silent VOLE (malicious/semi-honest) [[BCGIKRS19]](https://eprint.iacr.org/2019/1159.pdf),[[RRT23]](https://eprint.iacr.org/2023/882).

OLE and Beaver Triples:
* Foleage Binary Beaver Triples and F4 OLE (semi-honest) [[BBCCDS2024]](https://eprint.iacr.org/2024/429.pdf).

Distributed Point Functions:
* Distributed Point Function (DPF)[[BGI18]](https://eprint.iacr.org/2018/707.pdf) with [Distributed] Key Generation (DKG) [[Ds17]](https://eprint.iacr.org/2017/827.pdf).
* Ternary Distributed Point Function (DPF)[[BBCCDS2024]](https://eprint.iacr.org/2024/429.pdf) with Distributed Key Generation (DKG).
* Sparse Distributed Point Function (DPF) with Distributed Key Generation (DKG).

## Introduction

This library provides several different classes of OT protocols. First is the
This library provides several different classes of OT, VOLE and Beaver Triple generation protocols. First is the
base OT protocol of [CO15, MR19, MRR21]. These protocol bootstraps all the other
OT extension protocols. Within the OT extension protocols, we have 1-out-of-2,
1-out-of-N, and VOLE both in the semi-honest and malicious settings. See The `frontend` or `libOTe_Tests` folder for examples.
protocols. Within the OT extension protocols, we have 1-out-of-2,
1-out-of-N, and VOLE both in the semi-honest and malicious settings. Binary beaver triples can be
generating using the Foleage protocol. The library also includes a distributed point function (DPF)
protocol with distributed key generation (DKG) for secure computation. See The `frontend` or `libOTe_Tests`
folder for examples.

All implementations are highly optimized using fast SSE instructions and vectorization
to obtain optimal performance both in the single and multi-threaded setting.

Networking can be performed using both the sockets provided by the library and
external socket classes. The simplest integration can be achieved via the [message passing interface](https://github.com/osu-crypto/libOTe/blob/master/frontend/ExampleMessagePassing.h) where the user is given the protocol messages that need to be sent/received. Users can also integrate their own socket type for maximum performance. See the [coproto](https://github.com/Visa-Research/coproto/blob/main/frontend/SocketTutorial.cpp) tutorial for examples.
external socket classes. The simplest integration can be achieved via the
[message passing interface](https://github.com/osu-crypto/libOTe/blob/master/frontend/ExampleMessagePassing.h)
where the user is given the protocol messages that need to be sent/received.
Users can also integrate their own socket type for maximum performance.
See the [coproto](https://github.com/Visa-Research/coproto/blob/main/frontend/SocketTutorial.cpp) tutorial for examples.


## Build
Expand All @@ -47,7 +62,8 @@ There is one mandatory dependency on [coproto](https://github.com/Visa-Research/
and three **optional dependencies** on [libsodium](https://doc.libsodium.org/),
[Relic](https://github.com/relic-toolkit/relic), or
[SimplestOT](https://github.com/osu-crypto/libOTe/tree/master/SimplestOT) (Unix only)
for Base OTs. [Boost Asio](https://www.boost.org/doc/libs/1_84_0/doc/html/boost_asio.html) tcp networking and [OpenSSL](https://www.openssl.org/) support can optionally be enabled.
for Base OTs. [Boost Asio](https://www.boost.org/doc/libs/1_84_0/doc/html/boost_asio.html)
tcp networking and [OpenSSL](https://www.openssl.org/) support can optionally be enabled.
CMake 3.15+ is required and the build script assumes python 3.

The library can be built with libsodium, all OT protocols enabled and boost asio TCP networking as
Expand All @@ -60,10 +76,14 @@ The main executable with examples is
```
./out/build/<platform>/frontend/frontend_libOTe
```
where `<platform>` is the build directory, eg `linux`, `x64-Release`, `osx`, etc. **Unit Tests** and **example code** can be run with this excutable. Run the program with no options for a list of available options.
where `<platform>` is the build directory, eg `linux`, `x64-Release`, `osx`, etc.
**Unit Tests** and **example code** can be run with this excutable.
Run the program with no options for a list of available options.

### Build Options
LibOTe can be built with various only the selected protocols enabled. `-D ENABLE_ALL_OT=ON` will enable all available protocols depending on platform/dependencies. The `ON`/`OFF` options include
LibOTe can be built with various only the selected protocols enabled.
`-D ENABLE_ALL_OT=ON` will enable all available protocols depending
on platform/dependencies. The `ON`/`OFF` options include

**Malicious base OT:**
* `ENABLE_SIMPLESTOT` the SimplestOT [[CO15]](https://eprint.iacr.org/2015/267.pdf) protocol (relic or sodium).
Expand All @@ -81,9 +101,22 @@ LibOTe can be built with various only the selected protocols enabled. `-D ENABLE
* `ENABLE_SOFTSPOKEN_OT` the Roy [Roy22](https://eprint.iacr.org/2022/192) semi-honest/malicious protocol.
* `ENABLE_SILENTOT` the [[BCGIKRS19]](https://eprint.iacr.org/2019/1159.pdf),[[RRT23]](https://eprint.iacr.org/2023/882) semi-honest/malicious protocol.

**1-out-of-N OT Extension:**
* `ENABLE_KKRT` the Kolesnikov et al [[KKRT16]](https://eprint.iacr.org/2016/799) semi-honest protocol.
* `ENABLE_OOS` the Orrù et al [[OOS16]](http://eprint.iacr.org/2016/933) semi-honest/malicious protocol.

**Vole:**
* `ENABLE_SILENT_VOLE` the [[BCGIKRS19]](https://eprint.iacr.org/2019/1159.pdf),[[RRT23]](https://eprint.iacr.org/2023/882) semi-honest/malicious protocol.

** DPF:**
* `ENABLE_REGULAR_DPF` the Boyle et al [[BGI18]](https://eprint.iacr.org/2018/707.pdf) semi-honest protocol.
* `ENABLE_TERNARY_DPF` the Bombar et al [[BBCCDS2024]](https://eprint.iacr.org/2024/429.pdf) semi-honest protocol.
* `ENABLE_SPARSE_DPF` protocol allowing a sparse set of DPF leaf values.

**Beaver Triples:**
* `ENABLE_FOLEAGE` the Bombar et al [[BBCCDS2024]](https://eprint.iacr.org/2024/429.pdf) semi-honest protocol.


Addition options can be set for cryptoTools. See the cmake output.

### Dependencies
Expand Down Expand Up @@ -188,12 +221,18 @@ find_package(libOTe REQUIRED
silent_vole
oos
kkrt

foleage

regular_dpf
ternary_dpf
sparse_dpf
)
```

## Help

Contact Peter Rindal peterrindal@gmail.com for any assistance on building
Create a github issue or contact Peter Rindal peterrindal@gmail.com for any assistance on building
or running the library.

## Citing
Expand Down Expand Up @@ -226,8 +265,14 @@ or running the library.

[ALSZ15] - Gilad Asharov and Yehuda Lindell and Thomas Schneider and Michael Zohner, _More Efficient Oblivious Transfer Extensions with Security for Malicious Adversaries_. [eprint/2015/061](https://eprint.iacr.org/2015/061)

[BGI18] - Elette Boyle, Niv Gilboa, Yuval Ishai, _Function Secret Sharing: Improvements and Extensions_ [eprint/2018/707](https://eprint.iacr.org/2018/707.pdf)

[Ds17] - Jack Doerner, abhi shelat, _Scaling ORAM for Secure Computation_ [eprint/2017/827](https://eprint.iacr.org/2017/827.pdf)

[CRR21] - Geoffroy Couteau ,Srinivasan Raghuraman and Peter Rindal, _Silver: Silent VOLE and Oblivious Transfer from Hardness of Decoding Structured LDPC Codes_.

[Roy22] - Lawrence Roy, SoftSpokenOT: Communication--Computation Tradeoffs in OT Extension. [eprint/2022/192](https://eprint.iacr.org/2022/192)

[RRT23] - Srinivasan Raghuraman, Peter Rindal and Titouan Tanguy, _Expand-Convolute Codes for Pseudorandom Correlation Generators from LPN_. [eeprint/2023/882](https://eprint.iacr.org/2023/882)

[BBCCDS2024] - Maxime Bombar, Dung Bui, Geoffroy Couteau, Alain Couvreur, Clément Ducros, and Sacha Servan-Schreiber, _FOLEAGE: F4 OLE-Based Multi-Party Computation for Boolean Circuits_. [eprint/2024/429](https://eprint.iacr.org/2024/429.pdf)
57 changes: 34 additions & 23 deletions cmake/buildOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,6 @@ if(DEFINED ENABLE_ALL_OT)
set(ENABLE_SIMPLESTOT_ASM ${oc_BB} CACHE BOOL "" FORCE)
set(ENABLE_MR_KYBER ${oc_BB} CACHE BOOL "" FORCE)

# requires sse
if(ENABLE_SSE)
set(oc_BB ${ENABLE_ALL_OT})
else()
set(oc_BB OFF)
endif()
set(ENABLE_SILENTOT ${oc_BB} CACHE BOOL "" FORCE)


# general
set(ENABLE_KOS ${ENABLE_ALL_OT} CACHE BOOL "" FORCE)
set(ENABLE_IKNP ${ENABLE_ALL_OT} CACHE BOOL "" FORCE)
Expand All @@ -77,17 +68,18 @@ if(DEFINED ENABLE_ALL_OT)
set(ENABLE_OOS ${ENABLE_ALL_OT} CACHE BOOL "" FORCE)
set(ENABLE_KKRT ${ENABLE_ALL_OT} CACHE BOOL "" FORCE)
set(ENABLE_SILENTOT ${ENABLE_ALL_OT} CACHE BOOL "" FORCE)
set(ENABLE_SILENT_VOLE ${ENABLE_ALL_OT} CACHE BOOL "" FORCE)
set(ENABLE_SILENT_VOLE ${ENABLE_ALL_OT} CACHE BOOL "" FORCE)
set(ENABLE_FOLEAGE ${ENABLE_ALL_OT} CACHE BOOL "" FORCE)
set(ENABLE_REGULAR_DPF ${ENABLE_ALL_OT} CACHE BOOL "" FORCE)
set(ENABLE_TERNARY_DPF ${ENABLE_ALL_OT} CACHE BOOL "" FORCE)
set(ENABLE_SPARSE_DPF ${ENABLE_ALL_OT} CACHE BOOL "" FORCE)

unset(ENABLE_ALL_OT CACHE)

endif()


if(APPLE)
option(ENABLE_BITPOLYMUL "Build with bit poly mul inegration" FALSE)
else()
option(ENABLE_BITPOLYMUL "Build with bit poly mul inegration" TRUE)
endif()
option(ENABLE_BITPOLYMUL "Build with bit poly mul inegration" FALSE)

option(ENABLE_MOCK_OT "Build the insecure mock base OT" OFF)

Expand All @@ -111,11 +103,13 @@ option(ENABLE_KKRT "Build the KKRT 1-oo-N OT-Ext protocol." OFF)
option(ENABLE_PPRF "Build the PPRF protocol." OFF)
option(ENABLE_SILENT_VOLE "Build the Silent Vole protocol." OFF)

option(ENABLE_INSECURE_SILVER "Build with silver codes." OFF)
option(ENABLE_LDPC "Build with ldpc functions." OFF)
if(ENABLE_INSECURE_SILVER)
set(ENABLE_LDPC ON)
endif()
option(ENABLE_FOLEAGE "Build the Foleage OLE protocol." OFF)


option(ENABLE_REGULAR_DPF "Build the Regular DPF protocol." OFF)
option(ENABLE_TERNARY_DPF "Build the Ternary DPF protocol." OFF)
option(ENABLE_SPARSE_DPF "Build the Sparse DPF protocol." OFF)

option(NO_KOS_WARNING "Build with no kos security warning." OFF)


Expand All @@ -133,6 +127,14 @@ if(ENABLE_IKNP)
set(ENABLE_KOS true)
endif()

if(ENABLE_FOLEAGE)
set(ENABLE_TERNARY_DPF true)
endif()

if(ENABLE_SPARSE_DPF)
set(ENABLE_REGULAR_DPF true)
endif()

message(STATUS "General Options\n=======================================================")

message(STATUS "Option: VERBOSE_FETCH = ${VERBOSE_FETCH}")
Expand Down Expand Up @@ -160,16 +162,25 @@ message(STATUS "1-out-of-2 Delta-OT Extension protocols\n=======================
message(STATUS "Option: ENABLE_DELTA_KOS = ${ENABLE_DELTA_KOS}\n\n")

message(STATUS "Vole protocols\n=======================================================")
message(STATUS "Option: ENABLE_SILENT_VOLE = ${ENABLE_SILENT_VOLE}\n\n")
message(STATUS "Option: ENABLE_SILENT_VOLE = ${ENABLE_SILENT_VOLE}\n\n")


message(STATUS "DPF protocols\n=======================================================")
message(STATUS "Option: ENABLE_REGULAR_DPF = ${ENABLE_REGULAR_DPF}")
message(STATUS "Option: ENABLE_SPARSE_DPF = ${ENABLE_SPARSE_DPF}")
message(STATUS "Option: ENABLE_TERNARY_DPF = ${ENABLE_TERNARY_DPF}")
message(STATUS "Option: ENABLE_PPRF = ${ENABLE_PPRF}\n\n")

message(STATUS "OLE and Triple protocols\n=======================================================")
message(STATUS "Option: ENABLE_FOLEAGE = ${ENABLE_FOLEAGE}\n\n")

message(STATUS "1-out-of-N OT Extension protocols\n=======================================================")
message(STATUS "Option: ENABLE_OOS = ${ENABLE_OOS}")
message(STATUS "Option: ENABLE_KKRT = ${ENABLE_KKRT}\n\n")


message(STATUS "other \n=======================================================")
message(STATUS "Option: NO_KOS_WARNING = ${NO_KOS_WARNING}")
message(STATUS "Option: ENABLE_PPRF = ${ENABLE_PPRF}\n\n")
message(STATUS "Option: NO_KOS_WARNING = ${NO_KOS_WARNING}\n\n")

#############################################
# Config Checks #
Expand Down
11 changes: 10 additions & 1 deletion cmake/buildOptions.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ set(ENABLE_DELTA_KOS @ENABLE_DELTA_KOS@)
set(ENABLE_OOS @ENABLE_OOS@)
set(ENABLE_KKRT @ENABLE_KKRT@)
set(ENABLE_SILENT_VOLE @ENABLE_SILENT_VOLE@)
set(NO_SILVER_WARNING @NO_SILVER_WARNING@)

set(ENABLE_FOLEAGE @ENABLE_FOLEAGE@)

set(ENABLE_REGULAR_DPF @ENABLE_REGULAR_DPF@)
set(ENABLE_SPARSE_DPF @ENABLE_SPARSE_DPF@)
set(ENABLE_TERNARY_DPF @ENABLE_TERNARY_DPF@)

set(ENABLE_PPRF @ENABLE_PPRF@)

Expand Down Expand Up @@ -127,5 +132,9 @@ set(libOTe_delta_kos_FOUND ${ENABLE_DELTA_KOS})
set(libOTe_silent_vole_FOUND ${ENABLE_SILENT_VOLE})
set(libOTe_oos_FOUND ${ENABLE_OOS})
set(libOTe_kkrt_FOUND ${ENABLE_KKRT})
set(libOTe_foleage_FOUND ${ENABLE_FOLEAGE})
set(libOTe_regular_dpf_FOUND ${ENABLE_REGULAR_DPF})
set(libOTe_ternary_dpf_FOUND ${ENABLE_TERNARY_DPF})
set(libOTe_sparse_dpf_FOUND ${ENABLE_SPARSE_DPF})


3 changes: 3 additions & 0 deletions frontend/ExampleBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ namespace osuCrypto

std::cout << tag << (role == Role::Receiver ? " (receiver)" : " (sender)")
<< " n=" << totalOTs << " " << milli << " ms" << std::endl;

#else
std::cout << "This example requires coproto to enable boost support. Please build libOTe with `-DCOPROTO_ENABLE_BOOST=ON`. \n" << LOCATION << std::endl;
#endif
}

Expand Down
Loading
Loading