Implementations of post-quantum oblivious transfers under emp-ot framework, including:
- Our new Naor-Pinkas-like 1-out-of-2 OT protocol based on SABER;
- A Simplest-like 1-out-of-2 OT protocol based on SABER;
- Masny-Rindal 1-out-of-2 OT protocol based on SABER;
- Masny-Rindal 1-out-of-2 OT protocol based on CRYSTALs-Kyber.
The first two protocols are our new protocols inspired by Naor-Pinkas OT and Simplest OT. In our paper, we mainly focus on the first Naor-Pinkas-like construction. The other two are following the Masny-Rindal construction from uniform key agreement, as baselines.
Our implementation uses emp-tool. Here is how to install it, more details can be found in their README.
wget https://raw.githubusercontent.com/emp-toolkit/emp-readme/master/scripts/install.pypython install.py --deps --tool- You can use
--ot=[release]to install a particular branch or release - By default it will build for Release.
-DCMAKE_BUILD_TYPE=[Release|Debug]option is also available. - No sudo? Change
CMAKE_INSTALL_PREFIX.
- You can use
After installing the dependencies, you can build Saber-based project with the following commands
cmake -DENABLE_SABER=ON -DENABLE_KYBER=OFF .
make
./run ./bin/test_saberwhere test_saber is our test program for the SABER-based OTs, including NPOTs, Simplest OTs, and MR OTs. Additionally, it also inlcudes some CDH-based classical OTs as contrast. The output should be like:
connected
connected
128 COOTs (average over 1000 runs): 13.921 ms
128 COOTs (average over 1000 runs): 13.91 ms
128 NPOTs (average over 1000 runs): 14.667 ms
128 NPOTs (average over 1000 runs): 14.678 ms
128 NP Saber OTs (average over 1000 runs): 8.221 ms
128 NP Saber OTs (average over 1000 runs): 8.235 ms
128 Simplest Saber OTs (average over 1000 runs): 6.349 ms
128 Simplest Saber OTs (average over 1000 runs): 6.36 ms
128 MRSaber OTs (average over 1000 runs): 18.568 ms
128 MRSaber OTs (average over 1000 runs): 18.587 msSimilarly, you can build Kyber-based project with the following commands:
cmake -DENABLE_SABER=OFF -DENABLE_KYBER=ON .
make
./run ./bin/test_mr_kyberwhere test_mr_kyber is the test program running our Kyber-based MR OTs, still with some classic CDH ones for contrast. The output should be like:
connected
connected
128 COOTs (average over 1000 runs): 12.921 ms
128 COOTs (average over 1000 runs): 12.928 ms
128 NPOTs (average over 1000 runs): 14.866 ms
128 NPOTs (average over 1000 runs): 14.898 ms
128 MRKyber OTs (average over 1000 runs): 17.684 ms
128 MRKyber OTs (average over 1000 runs): 17.681 msBecause there are too many collsions in the implementations of Saber and Kyber, you can only enable one of them at a time.
The tests above are running on the same machine's loopback network. Credited to emp-ot for their complete implementation, one can also test these OTs on two different machines in a real network setting, more details to use their features can be found in their README.