International Association for Cryptologic Research

International Association
for Cryptologic Research

Advances in Cryptology – ASIACRYPT 2025

Pseudorandom Correlation Generators for Multiparty Beaver Triples over F2


README

Overview

This repository implements the programmable pseudorandom correlation generator (PCG) for oblivious linear evaluations
(OLE) over the binary field from ia.cr/2025/1182. It includes both the interactive seed exchange protocol and seed expansion.

Running Evaluations

This project has been containerized with Docker so it suffices to pull the pre-build image and run it directly — i.e.,

docker pull ghcr.io/mtrom/f2-ole-pcg:latest

and

docker run --rm --network host ghcr.io/mtrom/f2-ole-pcg:latest [ARGS]

[!NOTE]
The --network host flag is necessary if you will be running the protocol between multiple hosts.

Running Benchmarks

If you want to run both parties in one process, use --both. Otherwise, use --send and --recv along with
--host, using the latter to provide the address for the other party.

There is a mismatch between the parameter names in the paper and the implementation. The translation is laid out below
but the include/util/params.hpp also provides an explanation.

Paper Implementation Command Line Argument
N/A size --logCorrelations
$N$ N --logN
$n$ k --logk
$t_1$ tp / t1 --logtp
$k$ k * c --c
$t_2$ td / t2 --td
$z$ l --l

Note that the implementation allows for partial expansion which is controlled by setting --logCorrelations.
Confusingly, $k$ (from the paper) is not set directly in the implementation, but is set using c which is typically 4 or
8.

As an example, the first row in Table 1 can be run using the following parameters:

--logN 28 --logk 18 --logtp 17 --c 4 --td 47 --l 5

[!TIP]
By default, --logCorrelations is set to be --logN so all possible correlations are expanded. The expansion runtime
will be on the order of hours, so I would suggest using a smaller --logCorrelations (e.g., 20) and extrapolating.

[!WARNING]
The protocol requires a large amount of memory. Start by running a small instance --- e.g.,

docker run --rm --network host ghcr.io/mtrom/f2-ole-pcg:latest --both --logN 20 --logk 10 --logtp 10 --l 5 --c 4

Interpreting the Output

An example output can be seen below

[  info  ] using thread count 16
[ primal ] N = 1048576, n = 1024, t1 = 1024, l = 5
[  dual  ] k = 4096, t2 = 32, c = 4.0

[protocol] prepare      : 0.160 s
[protocol] online       : 1.212 s
     upload       : 0.507 MB
     download     : 0.474 MB
     total        : 0.980 MB
[protocol] finalize     : 0.162 s
[ expand ] expand       : 1.524 s

The protocol section describes the seed expansion phase, thus the total seed expansion runtime is derived by adding up
the prepare, online, and finalize runtimes. In Table 1, this is the "Runtime Protocol" column. The expansion
phase is given as one runtime and corresponds to the "Runtime Expand" column. If you've used --logCorrelations,
then this runtime should be properly scaled (e.g., if you use --logN 28 and --logCorrelations 20, then multiply the
number of seconds by 256). The expansion phase should be linear in the number of correlations as any initial setup
is done in the finalize phase. Finally, the "Communication Total" is simply total.

There will be some asymmetry between the sender and receiver. In particular, the sender will have longer prepare and
shorter finalize and the receiver will have the opposite.

Building the Project

In order to make development easier, there is a dev docker target that does not automatically compile the project.
Run the following from the base directory:

docker build -t f2-ole-pcg:dev --target dev -f Dockerfile .

This will create a Docker image. Now create a container from that image and mount the base directory:

docker run -it --name pcg-container -v "$(pwd):/home/pcg-user" --network host f2-ole-pcg:dev

At this point you will be connected to the container and can build the project. Start with the libOTe dependency

(cd thirdparty/libOTe; python3 build.py --all --boost --sodium --relic)

and then the project

mkdir build && (cd build; cmake ..) && (cd build; make -j$(nproc))

This will compile two binaries: build/unit_tests and build/protocol. Use --help for the protocol arguments.