{"id":13629805,"url":"https://github.com/osu-crypto/libOTe","last_synced_at":"2025-04-17T09:36:44.046Z","repository":{"id":37663479,"uuid":"73007955","full_name":"osu-crypto/libOTe","owner":"osu-crypto","description":"A fast, portable, and easy to use Oblivious Transfer Library","archived":false,"fork":false,"pushed_at":"2024-08-23T23:29:40.000Z","size":4133,"stargazers_count":428,"open_issues_count":2,"forks_count":107,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-08-24T17:02:37.664Z","etag":null,"topics":["delta-ot","oblivious-transfer","oblivious-transfer-extension","ot-extension","ot-protocols","secure-computation"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/osu-crypto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-06T17:45:24.000Z","updated_at":"2024-08-23T23:29:44.000Z","dependencies_parsed_at":"2024-04-27T18:24:25.236Z","dependency_job_id":"dc2d3194-5961-4e18-baa0-fdc3722109e3","html_url":"https://github.com/osu-crypto/libOTe","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osu-crypto%2FlibOTe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osu-crypto%2FlibOTe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osu-crypto%2FlibOTe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osu-crypto%2FlibOTe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osu-crypto","download_url":"https://codeload.github.com/osu-crypto/libOTe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223751563,"owners_count":17196663,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["delta-ot","oblivious-transfer","oblivious-transfer-extension","ot-extension","ot-protocols","secure-computation"],"created_at":"2024-08-01T22:01:20.250Z","updated_at":"2025-04-17T09:36:44.038Z","avatar_url":"https://github.com/osu-crypto.png","language":"C++","funding_links":[],"categories":["C++","Uncategorized","Software"],"sub_categories":["Uncategorized","Primitives"],"readme":"\n![](./titleOSU.PNG)\n=====\n\n![Build Status](https://github.com/osu-crypto/libOTe/actions/workflows/build-test.yml/badge.svg)\n\nA fast and portable C++20 library for Oblivious Transfer extension (OTe). The \nprimary design goal of this library to obtain *high performance* while being \n*easy to use*. Checkout [version 1.6](https://github.com/osu-crypto/libOTe/releases/tag/v1.6.0) for the previous version.\n \n**Semi-honest OT extension:**\n* 1-out-of-2 Silent OT [[BCGIKRS19]](https://eprint.iacr.org/2019/1159.pdf),[[RRT23]](https://eprint.iacr.org/2023/882).\n* 1-out-of-2 OT [[IKNP03]](https://www.iacr.org/archive/crypto2003/27290145/27290145.pdf).\n* 1-out-of-2 Correlated-OT [[IKNP03]](https://www.iacr.org/archive/crypto2003/27290145/27290145.pdf),[[BLNNOOSS15]](https://eprint.iacr.org/2015/472.pdf).\n* 1-out-of-2 OT [[Roy22]](https://eprint.iacr.org/2022/192).\n* 1-out-of-N OT [[KKRT16]](https://eprint.iacr.org/2016/799). \n\n**Malicious OT extension:**\n* 1-out-of-2 Silent OT [[BCGIKRS19]](https://eprint.iacr.org/2019/1159.pdf),[[RRT23]](https://eprint.iacr.org/2023/882).\n* 1-out-of-2 OT [[KOS15]](https://eprint.iacr.org/2015/546).\n* 1-out-of-2 Correlated-OT [[KOS15]](https://eprint.iacr.org/2015/546).\n* 1-out-of-2 OT [[Roy22]](https://eprint.iacr.org/2022/192).\n* 1-out-of-2 base OT, several protocols. \n\n**Vole:**\n* Generic subfield noisy VOLE (semi-honest) [[BCGIKRS19]](https://eprint.iacr.org/2019/1159.pdf)\n* Generic subfield silent VOLE (malicious/semi-honest) [[BCGIKRS19]](https://eprint.iacr.org/2019/1159.pdf),[[RRT23]](https://eprint.iacr.org/2023/882).\n \n**OLE and Beaver Triples:**\n* Foleage Binary Beaver Triples and F4 OLE (semi-honest) [[BBCCDS2024]](https://eprint.iacr.org/2024/429.pdf).\n* Binary Beaver Triples and OLE from the Silent OT[[BCGIKRS19]](https://eprint.iacr.org/2019/1159.pdf),[[RRT23]](https://eprint.iacr.org/2023/882) semi-honest/malicious protocol. \n\n**Distributed Point Functions:**\n* 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).\n* Ternary Distributed Point Function (DPF)[[BBCCDS2024]](https://eprint.iacr.org/2024/429.pdf) with Distributed Key Generation (DKG).\n* Sparse Distributed Point Function (DPF) with Distributed Key Generation (DKG).\n\n## Introduction\n \nThis library provides several different classes of OT, VOLE and Beaver Triple generation protocols. First is the \nbase OT protocol of [CO15, MR19, MRR21]. These protocol bootstraps all the other\nprotocols.  Within the OT extension protocols, we have 1-out-of-2,\n1-out-of-N, and VOLE both in the semi-honest and malicious settings. Binary beaver triples can be\ngenerating using the Foleage protocol. The library also includes a distributed point function (DPF)\nprotocol with distributed key generation (DKG) for secure computation. See The `frontend` or `libOTe_Tests` \nfolder for examples.\n\nAll implementations are highly optimized using fast SSE instructions and vectorization\nto obtain optimal performance both in the single and multi-threaded setting. \n \nNetworking can be performed using both the sockets provided by the library and\nexternal socket classes. The simplest integration can be achieved via the \n[message passing interface](https://github.com/osu-crypto/libOTe/blob/master/frontend/ExampleMessagePassing.h) \nwhere the user is given the protocol messages that need to be sent/received. \nUsers can also integrate their own socket type for maximum performance. \nSee the [coproto](https://github.com/Visa-Research/coproto/blob/main/frontend/SocketTutorial.cpp) tutorial for examples.\n\n\n## Build\n \nThe library is *cross platform* and has been tested on Windows, Mac and Linux. \nThere is one mandatory dependency on [coproto](https://github.com/Visa-Research/coproto) (networking),\nand three **optional dependencies** on [libsodium](https://doc.libsodium.org/),\n[Relic](https://github.com/relic-toolkit/relic), or\n[SimplestOT](https://github.com/osu-crypto/libOTe/tree/master/SimplestOT) (Unix only)\nfor Base OTs. [Boost Asio](https://www.boost.org/doc/libs/1_84_0/doc/html/boost_asio.html) \ntcp networking and [OpenSSL](https://www.openssl.org/) support can optionally be enabled.\nCMake 3.15+ is required and the build script assumes python 3.\n \nThe library can be built with libsodium, all OT protocols enabled and boost asio TCP networking as\n```\ngit clone https://github.com/osu-crypto/libOTe.git\ncd libOTe\npython build.py --all --boost --sodium\n```\nThe main executable with examples is\n```\n./out/build/\u003cplatform\u003e/frontend/frontend_libOTe\n```\nwhere `\u003cplatform\u003e` is the build directory, eg `linux`, `x64-Release`, `osx`, etc.\n**Unit Tests** and **example code** can be run with this excutable. \nRun the program with no options for a list of available options.\n\n### Build Options\nLibOTe can be built with various only the selected protocols enabled. \n`-D ENABLE_ALL_OT=ON` will enable all available protocols depending \non platform/dependencies. The `ON`/`OFF` options include\n\n**Malicious base OT:**\n * `ENABLE_SIMPLESTOT` the SimplestOT [[CO15]](https://eprint.iacr.org/2015/267.pdf) protocol (relic or sodium).\n * `ENABLE_SIMPLESTOT_ASM` the SimplestOT base OT protocol [[CO15]](https://eprint.iacr.org/2015/267.pdf) protocol (linux assembly).\n * `ENABLE_MRR` the McQuoid Rosulek Roy [[MRR20]](https://eprint.iacr.org/2020/1043) protocol (relic or sodium).\n * `ENABLE_MRR_TWIST` the McQuoid Rosulek Roy [[MRR21]](https://eprint.iacr.org/2021/682) protocol  (sodium fork).\n * `ENABLE_MR` the Masny Rindal [[MR19]](https://eprint.iacr.org/2019/706.pdf) protocol (relic or sodium).\n * `ENABLE_MR_KYBER` the Masny Rindal [[MR19]](https://eprint.iacr.org/2019/706.pdf) protocol  (Kyber fork).\n * `ENABLE_NP` the Naor Pinkas [NP01] base OT (relic or sodium).\n\n**1-out-of-2 OT Extension:**\n * `ENABLE_IKNP` the Ishai et al [[IKNP03]](https://www.iacr.org/archive/crypto2003/27290145/27290145.pdf) semi-honest protocol.\n * `ENABLE_KOS` the Keller et al [[KOS15]](https://eprint.iacr.org/2015/546) malicious protocol.\n * `ENABLE_DELTA_KOS` the Burra et al [[BLNNOOSS15]](https://eprint.iacr.org/2015/472.pdf),[[KOS15]](https://eprint.iacr.org/2015/546) malicious Delta-OT protocol.\n * `ENABLE_SOFTSPOKEN_OT` the Roy [Roy22](https://eprint.iacr.org/2022/192) semi-honest/malicious protocol.\n * `ENABLE_SILENTOT` the [[BCGIKRS19]](https://eprint.iacr.org/2019/1159.pdf),[[RRT23]](https://eprint.iacr.org/2023/882) semi-honest/malicious protocol.\n\n **1-out-of-N OT Extension:**\n * `ENABLE_KKRT` the Kolesnikov et al [[KKRT16]](https://eprint.iacr.org/2016/799) semi-honest protocol.\n * `ENABLE_OOS` the Orrù et al [[OOS16]](http://eprint.iacr.org/2016/933) semi-honest/malicious protocol.\n\n **Vole:**\n * `ENABLE_SILENT_VOLE` the [[BCGIKRS19]](https://eprint.iacr.org/2019/1159.pdf),[[RRT23]](https://eprint.iacr.org/2023/882) semi-honest/malicious protocol.\n\n **DPF:**\n * `ENABLE_REGULAR_DPF` the Boyle et al [[BGI18]](https://eprint.iacr.org/2018/707.pdf) semi-honest protocol.\n * `ENABLE_TERNARY_DPF` the Bombar et al [[BBCCDS2024]](https://eprint.iacr.org/2024/429.pdf) semi-honest protocol.\n * `ENABLE_SPARSE_DPF` protocol allowing a sparse set of DPF leaf values.\n\n **Beaver Triples:**\n * `ENABLE_FOLEAGE` the Bombar et al [[BBCCDS2024]](https://eprint.iacr.org/2024/429.pdf) semi-honest protocol.\n * `ENABLE_SILENTOT` the [[BCGIKRS19]](https://eprint.iacr.org/2019/1159.pdf),[[RRT23]](https://eprint.iacr.org/2023/882) semi-honest/malicious protocol. \n\n\n Addition options can be set for cryptoTools. See the cmake output.\n\n### Dependencies\n\nDependencies can be managed by cmake/build.py or installed via an external tool. If an external tool is used install to system location or set  `-D CMAKE_PREFIX_PATH=path/to/install`. By default `build.py` calls cmake with the command line argument\n```\n-D FETCH_AUTO=true\n```\n. This tells cmake to first look for dependencies on *the system* and if not found then it will be downloaded and built automatically. If set to `false` then the build will fail if not found. Each dependency can downloaded and build for you by explicitly setting it's `FETCH_***` variable to `true`. See blow. The python `build.py` script by default sets `FETCH_AUTO=true` and can be set to `false` by calling it with `--noauto`.\n\n\n**Enabling/Disabling [Relic](https://github.com/relic-toolkit/relic) (for base OTs):**\n The library can be built with Relic as\n```\npython build.py --relic\n```\nRelic can be disabled by removing `--relic` from the setup and setting `-D ENABLE_RELIC=false`. This will always download and build relic. To only enable but not download relic, use `python build.py -D ENABLE_RELIC=true`.\n\n**Enabling/Disabling [libsodium](https://github.com/osu-crypto/libsodium) (for base OTs):**\n  The library can be built with libsodium as\n```\npython build.py --sodium\n```\nlibsodium can be disabled by removing `--sodium` from the setup and setting `-D ENABLE_SODIUM=false`.  This will always download and build sodium. To only enable but not download relic, use `python build.py -D ENABLE_SODIUM=true`.\n\nThe McQuoid Rosulek Roy 2021 Base OTs uses a twisted curve which additionally require the `noclamp` option for Montgomery curves and is currently only in a [fork](https://github.com/osu-crypto/libsodium) of libsodium. If you prefer the stable libsodium, then install it and add `-D SODIUM_MONTGOMERY=false` as a cmake argument to libOTe.\n\n\n**Enabling/Disabling [boost asio](https://www.boost.org/doc/libs/1_77_0/doc/html/boost_asio.html) (for TCP networking):**\n  The library can be built with boost as\n```\npython build.py --boost\n```\nboost can be disabled by removing `--boost` from the setup and setting `-D ENABLE_BOOST=false`.  This will always download and build boost. To only enable but not download relic, use `python build.py -D ENABLE_BOOST=true`.\n\n\n\n**Enabling/Disabling [OpenSSL](https://www.boost.org/doc/libs/1_77_0/doc/html/boost_asio.html) (for TLS networking):**\n  The library can be built with boost as\n```\npython build.py --openssl\n```\nOpenSSL can be disabled by removing `--openssl` from the setup and setting `-D ENABLE_OPENSSL=false`. OpenSSL is never downloaded for you and is always found using your system installs.\n\n## Install\n\nlibOTe can be installed and linked the same way as other cmake projects. To install the library and all downloaded dependencies, run the following\n```\npython build.py --install\n```\n\nSudo is not used. If installation requires sudo access, then install as root. See `python build.py --help` for full details.\n\n\n## Linking\nlibOTe can be linked via cmake as\n```\nfind_package(libOTe REQUIRED)\ntarget_link_libraries(myProject oc::libOTe)\n```\nOther exposed targets are `oc::cryptoTools, oc::tests_cryptoTools, oc::libOTe_Tests`. In addition, cmake variables `libOTe_LIB, libOTe_INC, ENABLE_XXX` will be defined, where `XXX` is one of the libOTe options.\n\nTo ensure that cmake can find libOTe, you can either install libOTe or build it locally and set `-D CMAKE_PREFIX_PATH=path/to/libOTe` or provide its location as a cmake `HINTS`, i.e. `find_package(libOTe HINTS path/to/libOTe)`.\n\nlibOTe can be found with the following components:\n```\nfind_package(libOTe REQUIRED \n    COMPONENTS\n        std_20\n        \n        Debug\n        Release\n        RelWithDebInfo\n\n        boost\n        relic\n        sodium\n        bitpolymul\n        openssl\n        circuits\n\n        sse\n        avx\n        asan\n        pic\n        no_sse\n        no_avx\n        no_asan\n        no_pic\n\n        simplestot\n        simplestot_asm\n        mrr\n        mrr_twist\n        mr\n        mr_kyber\n        kos\n        iknp\n        silentot\n        softspoken_ot\n        delta_kos\n        silent_vole\n        oos\n        kkrt\n\n        foleage\n\n        regular_dpf\n        ternary_dpf\n        sparse_dpf\n)\n```\n\n## Help\n \nCreate a github issue or contact Peter Rindal peterrindal@gmail.com for any assistance on building \nor running the library.\n\n## Citing\n\n Spread the word!\n\n```\n@misc{libOTe,\n    author = {Peter Rindal, Lance Roy},\n    title = {{libOTe: an efficient, portable, and easy to use Oblivious Transfer Library}},\n    howpublished = {\\url{https://github.com/osu-crypto/libOTe}},\n}\n```\n\n## Citation\n \n[NP01]   -    Moni Naor, Benny Pinkas, _Efficient Oblivious Transfer Protocols_. \n\n[IKNP03] - Yuval Ishai and Joe Kilian and Kobbi Nissim and Erez Petrank, _Extending Oblivious Transfers Efficiently_. \n \n[KOS15]  - Marcel Keller and Emmanuela Orsini and Peter Scholl, _Actively Secure OT Extension with Optimal Overhead_. [eprint/2015/546](https://eprint.iacr.org/2015/546)\n \n[OOS16]  - Michele Orrù and Emmanuela Orsini and Peter Scholl, _Actively Secure 1-out-of-N OT Extension with Application to Private Set Intersection_. [eprint/2016/933](http://eprint.iacr.org/2016/933)\n \n[KKRT16]  - Vladimir Kolesnikov and Ranjit Kumaresan and Mike Rosulek and Ni Trieu, _Efficient Batched Oblivious PRF with Applications to Private Set Intersection_. [eprint/2016/799](https://eprint.iacr.org/2016/799)\n \n[RR16]  - Peter Rindal and Mike Rosulek, _Improved Private Set Intersection against Malicious Adversaries_. [eprint/2016/746](https://eprint.iacr.org/2016/746)\n\n[BLNNOOSS15]  - Sai Sheshank Burra and Enrique Larraia and Jesper Buus Nielsen and Peter Sebastian Nordholt and Claudio Orlandi and Emmanuela Orsini and Peter Scholl and Nigel P. Smart, _High Performance Multi-Party Computation for Binary Circuits Based on Oblivious Transfer_. [eprint/2015/472](https://eprint.iacr.org/2015/472.pdf)\n\n[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)\n\n[BGI18] - Elette Boyle, Niv Gilboa, Yuval Ishai, _Function Secret Sharing: Improvements and Extensions_ [eprint/2018/707](https://eprint.iacr.org/2018/707.pdf)\n\n[Ds17] - Jack Doerner, abhi shelat, _Scaling ORAM for Secure Computation_ [eprint/2017/827](https://eprint.iacr.org/2017/827.pdf)\n\n[CRR21] - Geoffroy Couteau ,Srinivasan Raghuraman and Peter Rindal, _Silver: Silent VOLE and Oblivious Transfer from Hardness of Decoding Structured LDPC Codes_.\n\n[Roy22] - Lawrence Roy, SoftSpokenOT: Communication--Computation Tradeoffs in OT Extension. [eprint/2022/192](https://eprint.iacr.org/2022/192)\n\n[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)\n\n[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)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosu-crypto%2FlibOTe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosu-crypto%2FlibOTe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosu-crypto%2FlibOTe/lists"}