emp-ot

Which version do I want?
- Existing projects pinned to a published release: stay on
0.3.0 —
tag 0.3.0
or branch v0.3.x.
Bug fixes and security patches will be backported to v0.3.x.
- New projects, or willing to migrate: use
v1.0.0-alpha.2 —
tag v1.0.0-alpha.2,
the second alpha of the 1.0 line. It pairs with, and requires, emp-tool
v1.0.0-alpha.2. Do not use v1.0.0-alpha.1: its Ferret LPN parameter
sets reach only 111–121 bits against sparse WXL (see the CHANGELOG). The
API may change between alpha tags and before the final 1.0.0, so pin to
a tag (the CMake package floor is 1.0; see the Security section below for
scope and limitations).
State-of-the-art OT implementations on top of emp-tool:
four ordinary base OTs (CO, PVW, CSW, BMM), IKNP and
SoftSpoken OT extensions (semi-honest + malicious), the Ferret and
SilentFerret silent COT extensions, and the F2kVOLE / FpVOLE
subfield-VOLE generators built on top of Ferret. The chosen-input
COT/ROT/OT conversion wrappers hash with
MITCCRH
for optimal concrete security, and every correlated GGM tree hashes under
its own public AES key, derived from the session id, so no permutation is
shared across trees or sessions; base OTs derive keys from a random oracle
(RO), BMM additionally uses SHAKE in its ML-KEM and FrodoPKE cores (and
AES-128 to expand FrodoPKE’s matrix), and the Fiat-Shamir transcript
defaults to SHA-256.
Requirements
- CMake ≥ 3.25 (emp-tool’s floor; emp-ot alone configures with ≥ 3.21)
- A C++20 compiler (GCC ≥ 11, Clang ≥ 14, AppleClang 14+)
- emp-tool ≥ 1.0
- OpenSSL ≥ 3.0
- pthreads
emp-ot builds a small static library (emp-ot::emp-ot) that compiles
the IKNP, SoftSpoken, Ferret, and SilentFerret bodies plus the
BMM lattice base-OT bodies (on the vendored
mlkem-native and
FrodoKEM);
the header-only base OTs (CO, PVW, CSW) and the sVOLE layer are
consumed inline.
Build and install
emp-ot consumes emp-tool through its installed CMake package. Install
emp-tool first, then build emp-ot the same way:
# emp-tool
git clone https://github.com/emp-toolkit/emp-tool.git
cmake -S emp-tool -B emp-tool/build -DCMAKE_BUILD_TYPE=Release
cmake --build emp-tool/build -j
cmake --install emp-tool/build # respects CMAKE_INSTALL_PREFIX
# emp-ot
git clone https://github.com/emp-toolkit/emp-ot.git
cmake -S emp-ot -B emp-ot/build -DCMAKE_BUILD_TYPE=Release
cmake --build emp-ot/build -j
cmake --install emp-ot/build
If you don’t want to install emp-tool, point emp-ot directly at its build
tree:
cmake -S emp-ot -B emp-ot/build \
-DCMAKE_BUILD_TYPE=Release \
-Demp-tool_DIR=/abs/path/to/emp-tool/build
Omitting -DCMAKE_BUILD_TYPE defaults to Release.
Release builds self-tune: the first top-level Release build in a build
directory runs a one-time sweep of machine-local scheduling knobs (AES
tile widths, LPN batching — never anything protocol- or
security-relevant) and compiles with the winners; every later build
reuses the recorded result and is deterministic. The result lives in the
build directory (<build>/tuning-include/emp-ot/tuning_local.h,
provenance-stamped); install ships the file the library was compiled
with. Tuning changes neither outputs nor wire bytes (enforced by
test_tuning_invariance and the trace_hash_baseline CI gate below), so
differently-tuned parties interoperate freely. -DEMP_OT_AUTO_TUNE=OFF
disables the automatic sweep; the tune target sweeps explicitly and
tune-clean restores the shipped defaults, per build directory. Design
and methodology:
docs/performance-tuning.md.
CMake options
| Option |
Default |
Effect |
EMP_OT_BUILD_TESTS |
ON when top-level |
Build the test suite under test/. |
EMP_OT_INSTALL |
ON when top-level |
Generate install + export rules. |
EMP_OT_AUTO_TUNE |
ON for top-level native Release |
One-time per-build-directory tuning sweep before the first build (see above). |
Consuming from another CMake project
find_package(emp-ot CONFIG REQUIRED)
target_link_libraries(my-app PRIVATE emp-ot::emp-ot)
emp-ot::emp-ot is a static library target that pulls in
emp-tool::emp-tool transitively, so consumers don’t need to find
emp-tool separately.
Tests
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j
ctest --test-dir build --output-on-failure
The two-party benches (bench_base_ot, bench_iknp,
bench_softspoken, bench_ferret, bench_silentferret,
bench_silentferret_sink, bench_ot_extension, bench_f2k_vole,
bench_fp_vole) launch ALICE/BOB on localhost via the run script.
bench_lpn and bench_cggm are single-process benchmarks of internal
kernels.
Wire-trace hashes
test/trace_hash.cpp runs the covered protocols under a sibling
channel off one anchor NetIO with Fiat-Shamir enabled and prints one
SHA-256 digest per direction per protocol. Each protocol is measured
from a reset deterministic seed state and under one pinned session id,
kTraceSid, which every row sets before its objects’ first use, so the
digests are order-independent: adding or reordering a protocol
changes only its own row (a new row must pin kTraceSid too).
Refactors that leave the wire bytes untouched leave the hashes
untouched; refactors that do change the wire are visible as a
single-line diff. The digests are deterministic only in a
deterministic-mode build: a Release tree configured against an emp-tool
built with -DEMP_DETERMINISTIC_MODE=ON. Such a tree registers the trace_hash_baseline
ctest, which diffs the checked-in test/trace_hash.baseline, and CI runs
one, so a wire-format change fails CI. See
docs/wire-trace-hashes.md for the full
workflow.
$ ./run ./build-det/trace_hash | grep 'send=' # build-det: deterministic-mode Release tree
Profiling the SoftSpoken pipeline (off by default)
The SoftSpoken chunk pipeline has optional per-phase wall-clock timers
(butterfly / io / derand / transpose / combine; per role — derand
exists only on the OT-sender side, so the receiver line reports it as
zero). They are disabled by default — a normal build compiles them
to nothing and carries no timing code. To enable, build into a separate
tree with the flag and run any SoftSpoken driver; a ns/OT breakdown
prints to stderr at every session end:
cmake -S . -B build-phases -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS=-DEMP_BENCH_PHASES
cmake --build build-phases -j
./run ./build-phases/bench_softspoken 24
# stderr: [phases send] ots=... butterfly=... io=... derand=... transpose=... combine=... (ns/OT; sum=...)
The instrumented build is wire-identical to the default build (pinned
by the trace-hash baseline above); only stderr output differs. See
emp-ot/ot_extension/softspoken/ss_bench_phases.h.
Current baseline (ALICE’s view; first 16 hex of each direction’s
SHA-256). A change to any of these hashes means the corresponding
protocol’s wire format changed — fine if intentional, but flag it
clearly in the commit message and update this table. (The fingerprints
are Fiat–Shamir transcript digests under the build’s FS hash; this
table assumes the default sha256 — a stack built with emp-tool’s
EMP_FS_HASH=blake3 produces a different, internally consistent set.)
Ferret(b9) and SilentFerret(b9) are run over a whole number of
SilentFerret rounds, where the two are wire-identical by design
(SilentFerret only changes when the correction traffic is sent, not
the bytes). Their rows must stay equal in both modes; a divergence
means a refactor broke the equivalence, not just one protocol’s format.
An sVOLE round’s LPN output first reaches the wire when the next round’s
trees consume it. The F2kVOLE(b9) and FpVOLE(b9) rows run two whole
rounds, so they cover it; the F2kVOLE and FpVOLE rows run part of one
round at the default set.
The IKNP chosen rows run chosen-message OT through COT::send / recv,
which every extension shares, so they cover its MITCCRH pads. The other
extension rows run rcot, which does not hash with MITCCRH.
CO send=f93284d0ca2c4727 recv=c2ca81aa28808a2a
CSW send=3a9faf14a98d9925 recv=961af240bbd3bd73
PVW send=11d9fc8aa5684dd4 recv=42c08811aae41e60
BMM send=449bbc3660995d19 recv=98cf14739616ef9a
BMM768 send=f4db57820aa2d2b9 recv=e78454a9f4093821
BMM1024 send=c9c54a8df0bac3d3 recv=a805fdf242443556
BMMFrodo640 send=adfbab3965f02ed8 recv=78a210ef15cb81e2
BMMFrodo976 send=ad1f1f8b452c3f85 recv=6e2d5ed8f0b2f091
BMMFrodo1344 send=fcdfb4f1ac60a510 recv=fe37b19fff865880
IKNP semi send=287955448d755465 recv=cd04c7cd34a67cbf
IKNP chosen semi send=84966b1094a7e10a recv=cbb1d60ff71c018b
SoftSpoken<2> semi send=13ed15521151897e recv=7a79dccb6607f2bc
SoftSpoken<8> semi send=13ed15521151897e recv=f48fae6bb792f728
Ferret(b9) semi send=3fc07e946f555717 recv=066073053c6992d4
SilentFerret(b9) semi send=3fc07e946f555717 recv=066073053c6992d4
Ferret(b9) seeded semi send=b527bfe86d83e95e recv=9e3b8ccedfc40c3c
SilentFerret(b9) seeded semi send=b527bfe86d83e95e recv=9e3b8ccedfc40c3c
Ferret(b11) seeded semi send=644d60fb94567b3f recv=04fbd436fa2e496f
F2kVOLE semi send=b9db3af8d32cc93e recv=b3407775a1577c60
FpVOLE semi send=493c031b8b958f99 recv=3fdc63f9a651b615
F2kVOLE(b9) semi send=64741d02cc2e05d5 recv=f084ce3eaa5ddca6
FpVOLE(b9) semi send=b4fd45c864929675 recv=3fdc63f9a651b615
IKNP mali send=287955448d755465 recv=a40120973b3b3c45
IKNP chosen mali send=84966b1094a7e10a recv=c543b6b213e6aedd
SoftSpoken<2> mali send=13ed15521151897e recv=4a367a76f7926235
SoftSpoken<8> mali send=13ed15521151897e recv=dac3f1a077e99bdf
Ferret(b9) mali send=334ddb5fcd455ea7 recv=e751eba923b51545
SilentFerret(b9) mali send=334ddb5fcd455ea7 recv=e751eba923b51545
Ferret(b9) seeded mali send=6d1a90865ca9e838 recv=fe8ff7b1edb216e6
SilentFerret(b9) seeded mali send=6d1a90865ca9e838 recv=fe8ff7b1edb216e6
Ferret(b11) seeded mali send=c4ede73850311f44 recv=2ebf30f4042bcc3f
F2kVOLE mali send=9b841da2e39f7535 recv=a0815b32610a4fae
FpVOLE mali send=b3cc32b26341a415 recv=383a76e7f4d37a7a
F2kVOLE(b9) mali send=b0948dafcdb499ed recv=d009db845a9581cd
FpVOLE(b9) mali send=71b4bfa92a34b911 recv=63f4d27ebbb8d646
Usage
#include <emp-tool/emp-tool.h> // NetIO etc.
#include <emp-ot/emp-ot.h> // OTs
using namespace emp;
int party = parse_party(argv); // argv[1]; port/IP come from $EMP_PORT / $EMP_PEER_IP
auto io = (party == ALICE) ? NetIO::listen(peer_port())
: NetIO::connect(peer_ip(), peer_port());
Interfaces
All OTs in emp-ot derive from a four-layer hierarchy in
emp-ot/ot.h and
emp-ot/ot_extension/ot_extension.h.
Each layer adds methods on top of the previous one; you can always
call a lower-level method on a higher-level object. See
docs/class-organization.md for the
full class layout.
| Interface |
New methods |
Semantics added |
OT |
send(m0, m1, n) / recv(mc, c, n) |
chosen-input 1-out-of-2: sender supplies both messages, receiver picks one |
COT : OT |
send_cot(m0, n) / recv_cot(mc, c, n); free send_rot/recv_rot |
chosen-correlation: sender’s two messages always differ by a public Delta |
RandomCOT : COT |
rcot(data, n) (role implicit in instance party) |
random correlation: no choice-bit input; receiver’s choice ends up in getLSB(data[i]), and Delta’s LSB is forced to 1 so the correlation survives that one bit |
OTExtension : RandomCOT |
set_delta(const bool* delta_bool) (sender-only Δ override), chunk_size(), begin([n_ots])/next/check/end, next_n(data, n), run(data, num) |
streaming RCOT (one fixed-size chunk per next); counted begin bounds total demand and lets SoftSpoken shorten its terminal unit; check certifies a mid-session prefix without dropping the buffered tail; base-OT bootstrap fires lazily on the first begin |
Concrete classes attach as follows:
- Base OTs (
OT only): CO, PVW, CSW, BMM (and BMM768,
BMM1024, BMMFrodo640, BMMFrodo976, BMMFrodo1344).
- OT extensions (
OTExtension, so all of the above): IKNP,
SoftSpoken<k>, and Ferret.
The chosen-input / chosen-correlation / random conversions are
implemented once in the base classes (one MITCCRH pass per OT for the
chosen-message wrapper, one bit per OT for the random → chosen
correction), so picking a backend never forces you to also pick a
flavor.
Base OTs
The four ordinary base OTs (CO, PVW, CSW, BMM) implement
only the OT interface — chosen-input 1-out-of-2.
block m0[length], m1[length]; // sender's two messages
block mc[length]; // receiver's chosen message
bool c [length]; // receiver's choice bits
PVW ot(io.get());
if (party == ALICE) ot.send(m0, m1, length);
else ot.recv(mc, c, length); // mc[i] = m_{c[i]}
All four implement the same OT interface. CO is semi-honest;
CSW, PVW, BMM are malicious-secure. BMM is the post-quantum one, at
any of FIPS 203’s three ML-KEM parameter sets: BMM (= BMM_T<512>, NIST
category 1), BMM768 (category 3) and BMM1024 (category 5). The same OT
also runs over FrodoPKE, the unstructured-LWE encryption inside FrodoKEM
(ISO/IEC 18033-2:2006/Amd 2:2026), at FrodoKEM’s three parameter sets:
BMMFrodo640 (= BMMFrodo_T<640>, category 1), BMMFrodo976 (category 3)
and BMMFrodo1344 (category 5). Its messages are about 12 times as large as
over ML-KEM: 9,680 and 19,440 bytes per OT at category 1. The level sets the
lattice parameters; at every level the coins come from a PRG with a 128-bit
seed, and the OT messages are 128-bit.
OT extensions
IKNP, SoftSpoken<k>, and Ferret all derive from
RandomCOT, take the same constructor shape, and the same object
exposes all four flavors:
IKNP ote(party, io.get());
// SoftSpoken<2> ote(party, io.get()); Ferret ote(party, io.get()); ... all the same below.
block buf[length];
// rcot() is single-method and role-implicit — the instance's party
// determines whether it acts as sender or receiver internally.
// Each side fills its own `buf`; sender's buf[i] ^ receiver's buf[i] = c[i] · Δ.
ote.rcot(buf, length);
// COT / ROT / OT flavors are role-explicit (different signatures by side):
if (party == ALICE) {
ote.send_cot(m0, length); // COT: fills m0; m1[i] = m0[i]^Δ
ote.send_rot(m0, m1, length); // ROT: fills m0, m1 (random)
ote.send(m0, m1, length); // OT: sends caller-chosen m0, m1
} else {
ote.recv_cot(mc, c, length); // COT: mc[i] = m0[i] ^ c[i]*Δ
ote.recv_rot(mc, c, length); // ROT: mc[i] = c[i] ? m1[i] : m0[i]
ote.recv(mc, c, length); // OT: mc[i] = c[i] ? m1[i] : m0[i]
}
The constructor allocates per-instance state and (on the sender side)
samples a random Δ with LSB(Δ) = 1 pinned. No network I/O runs in
the ctor. The base-OT bootstrap runs on the first begin() (or the
first rcot() one-shot call, which delegates to run() → begin()
internally).
Δ is readable as ote.Delta immediately after construction. The
receiver has no Δ. To override the ctor-sampled Δ (e.g. when an
outer protocol supplies its own correlation), call set_delta before
the first rcot() call:
IKNP ote(party, io.get());
if (party == ALICE) {
bool delta_bool[128]; /* fill from outer protocol; delta_bool[0] = true */
ote.set_delta(delta_bool);
}
// ote.rcot(buf, length); // bootstrap fires here, on first streaming begin
set_delta must fire before the first rcot/begin/run call (rejected
otherwise, in every build flavor).
Each extension can be parameterized to bootstrap from a non-default
base OT (default is CSW); pair an extension’s malicious mode with
a malicious-secure base — IKNP / SoftSpoken / Ferret check
this at construction time and abort otherwise.
IKNP ote1(party, io.get(), /*malicious=*/true,
std::make_unique<CSW>(io.get()));
SoftSpoken<4> ote2(party, io.get(), /*malicious=*/true,
std::make_unique<CSW>(io.get())); // k=4
Ferret ote3(party, io.get(), /*malicious=*/true,
std::make_unique<CSW>(io.get()),
tuning::ferret_b12);
Ferret’s final LPN parameter is optional and defaults to
tuning::ferret_b12 (the sets and their security are documented in the
LPN security section). By default its public LPN matrix is derived from its
session id. Every OT, OT extension and sVOLE has one: unless set_sid() set it
before the object’s first use, that first use takes the channel’s next session
id (emp-tool’s IOChannel::next_session_id()), so the top-level objects of a
protocol are session-separated with no setup, and nested objects get children
of their parent’s id. On a channel without a session root (NetIO’s
SessionRoot::none, or a NetIO adopted from a socket) an object needs
set_sid(): its first use without one is an error, as is a zero id.
An id given to set_sid() must belong to one object, as the channel’s ids
do: two objects given the same id derive the same child ids.
A receiver that needs one set of choice bits under several senders’ Δs, as
one party of a multi-party protocol does, can seed them. Ferret and
SilentFerret instances whose receivers hold one choice seed, and that share
an LPN seed and a parameter set, give the same choice bit at each position of
their output streams, provided they are drawn alike (the same begin() /
begin(n_ots) / end() sequence):
Ferret ote(party, io.get()); // one per peer
if (party == BOB) ote.set_choice_seed(&choice_seed, lpn_seed); // secret, one per receiving party
else ote.set_choice_seed(nullptr, lpn_seed); // public, the same at both ends
Only the choice bits are shared. Each instance’s bootstrap SoftSpoken runs
on its own randomness and delivers the base through cot, with the seeded bits
as the receiver’s choices: one correction bit per base COT, once, at the bottom
of the bootstrap: M − 128 bits for a set that bootstraps directly (87,136 for
ferret_b9,
159,072 for ferret_b10), and ferret_b9’s 87,136 for the sets that nest
through it. The refill trees carry the choices from round to round. In
malicious mode every consistency check is masked by 128 COTs that the same
SoftSpoken extends just before the check, never by base COTs, which the
instances share, so that SoftSpoken lives as long as the instance. Both
additions travel in a flow the receiver sends anyway, so neither adds a round
trip. Without set_choice_seed nothing changes on the wire.
Streaming RCOT
The OTExtension base also exposes a streaming API for callers that
want to overlap RCOT production with downstream work (one fixed
chunk_size()-sized batch per next() call, no internal buffering):
const int64_t chunk = ote.chunk_size();
BlockVec buf(chunk);
ote.begin();
for (int i = 0; i < n_chunks; ++i) {
ote.next(buf.data());
consume_chunk(buf.data(), chunk); // role implicit in party
}
ote.end();
In malicious mode, ordinary streaming output is provisional until
check() or end() completes the covering consistency checks. Do not expose it or
make irreversible decisions from it before one of those calls succeeds; the one-shot
rcot() path performs that check before returning, and SilentFerret
front-loads its checks into begin(n_ots).
For a long-lived session that must reveal or commit intermediate results, use
check() as the certification boundary:
ote.begin();
ote.next_n(batch.data(), batch.size());
ote.check(); // session stays open; buffered tail stays available
reveal_or_commit(batch);
ote.next_n(more.data(), more.size());
ote.check();
reveal_or_commit(more);
ote.end(); // no empty check exchange if nothing new was generated
The whole backend chunk underlying a partial next_n() draw is included in
the check, so its unused suffix is already certified. It is drained after the
boundary before the extension generates another chunk. Calling check() after
consuming only that suffix is wire-free. The first check also completes CSW’s
deferred base-OT extraction check. SilentFerret inherits the API, but its
consume-time call is intentionally a no-op because begin() already certified
the complete prepared range.
The one-shot rcot(data, num) is implemented in terms of this
streaming API plus a small leftover buffer for tails that aren’t a
multiple of chunk_size().
For callers that consume the stream incrementally — even one COT at
a time — draw from a single long-lived session with next_n(dst, n)
instead of calling rcot repeatedly:
ote.begin(); // open one session (e.g. in your ctor)
ote.next_n(&one, 1); // draw any count; refills a chunk internally
ote.next_n(batch.data(), k); // …amortizes the per-round end-work
ote.end(); // close it (e.g. in your dtor)
This matters because rcot(data, num) opens and closes a session per
call, so the per-round end-work (refill trees + the malicious chi-fold
check) is paid every chunk_size() COTs. next_n keeps one session
open, amortizing that over the whole stream. In a malicious Ferret
benchmark at the default set (the two-box setup of the Performance
section), 1,048,576 one-COT draws, one per AND gate as in an interactive
ZK proof, ran 72× faster (slower-party median of 5) and used 92× less
wire through next_n than through rcot(_, 1) in a loop.
next_n is mutually exclusive with run()/rcot() on the same
instance (both touch the same leftover buffer); a run() after the
session’s end() first returns the tail the session left, which that
end() certified. Within one session use next() or next_n(), not
both: next() does not see the tail next_n() buffers, so mixing them
skips outputs.
The malicious-mode checks hash the channel’s transcript, so at every
emp-ot call each party must have read everything the other sent before
its matching call. emp-ot’s own protocols do; an application sharing the
channel must read each of its messages at the point matching where the
other party sent it, or use a sibling channel.
See docs/streaming-api.md for the full
lifecycle contract.
SilentFerret
SilentFerret is a drop-in Ferret subclass that can front-load all of
its wire traffic. Where Ferret interleaves the MPCOT/LPN correction
messages (and, in malicious mode, the chi-fold check) with production,
SilentFerret::begin(n_ots) concentrates every byte — and every malicious
check — into the initial call, leaving next() / next_n() completely
wire-free for both roles. The cGGM correction stream is identical to
Ferret’s. The no-argument path prepays one round at a time and, over whole
rounds, remains byte-identical overall, as pinned by the trace_hash
baseline above. For a multi-round malicious begin(n_ots), SilentFerret
folds the per-round consistency checks into one batch check, so its total
transcript is slightly smaller even though the corrections are unchanged.
Prepay a known number of COTs up front, then draw them with no communication
during the online phase:
SilentFerret ote(party, io.get(), /*malicious=*/true); // default param; n_threads = 1
ote.begin(n_ots); // ALL correction traffic + checks happen here
BlockVec buf(ote.chunk_size());
for (int i = 0; i < n_chunks; ++i)
ote.next(buf.data()); // wire-free: no bytes either way
ote.end();
The no-arg begin() prepays a single round (K = 1); rollover past it is
live. The constructor’s last argument n_threads sizes the begin()-time
expansion pool (<= 1 runs serially), parallelizing the bursty setup. The
trade is a heavier, bursty begin() for a silent online phase — useful when
the interactive section of a protocol should move no OT bytes.
Consumers that need only the XOR of a current-round tree range can avoid a
full output buffer. Both variants use one chunk_size() scratch buffer and
leave the stream cursor unchanged; concurrent ranges require one scratch
buffer per caller:
BlockVec scratch(ote.chunk_size());
block sum = ote.produce_range_fused_xor(scratch.data(), tree_begin, n_trees);
produce_range_scratch_xor() materializes and folds one tree at a time;
produce_range_fused_xor() sends each finalized LPN value directly to the
XOR accumulator and skips the final store. Both reproduce the XOR of the
corresponding produce_range() output and remain wire-free after begin().
sVOLE
F2kVOLE (VOLE over GF(2¹²⁸)) and FpVOLE (over F_p, p = 2⁶¹ − 1) stream
authenticated values. The party without Δ gets (val, mac); the Δ-holder gets
the key in mac, with val = 0; and mac = key + val·Δ. The Δ-holder is BOB
for F2kVOLE and ALICE for FpVOLE; it reads Δ with delta(), or sets it
with set_delta() before the first use.
FpVOLE<> vole(party, io); // malicious by default, ferret_b12
std::vector<AuthValueFp> out(n);
vole.run(out.data(), n); // one session per call
// or: vole.begin(); vole.next_n(out.data(), k); ...; vole.end();
The streaming rules above apply, with one difference: an sVOLE has no
check(), so a session’s outputs stay provisional until end() runs the
round’s check. That window can be a whole round, chunk_aligned_buf_sz()
outputs: 1,141,248 at ferret_b9, 16,625,664 at the default ferret_b12.
Two AWS m8a.large (AMD EPYC 9R45, Zen 5; 2 vCPU) in a cluster placement
group, us-east-1, Ubuntu 22.04 (Linux 6.8, transparent huge pages in the
default madvise mode), GCC 11.4, OpenSSL 3.0.2, -march=native. The two
parties run on separate instances over the AWS private network, each pinned
to one core (taskset) with the NIC’s interrupts on the other core; the link
measured 9.49 Gbps single-flow before and after the runs, with a
0.11–0.12 ms minimum RTT. Release build with one auto-tuner result frozen
across both hosts; bench output buffers are pre-faulted. The numbers are
single-core: the same code on an m8a.xlarge pair measured within 3% of
them, most rows within 1%.
Base OTs
One batch of 128 base OTs (slower party’s wall-clock, median of 3 runs;
send/recv bytes are deterministic).
| Protocol |
Time |
Send B |
Recv B |
Security |
CO |
41 ms |
4,197 |
12,928 |
semi-honest |
CSW |
40 ms |
6,261 |
12,960 |
malicious-secure (CDH + RO) |
PVW |
157 ms |
55,808 |
25,856 |
malicious-secure (DDH messy mode) |
BMM |
2.0 ms |
196,608 |
106,496 |
malicious-secure, post-quantum (over ML-KEM-512 internals) |
BMM768 |
3.2 ms |
278,528 |
155,648 |
malicious-secure, post-quantum (over ML-KEM-768 internals) |
BMM1024 |
4.6 ms |
401,408 |
204,800 |
malicious-secure, post-quantum (over ML-KEM-1024 internals) |
BMMFrodo640 |
66 ms |
2,488,320 |
1,239,040 |
malicious-secure, post-quantum (over FrodoPKE-640) |
BMMFrodo976 |
116 ms |
4,030,464 |
2,009,088 |
malicious-secure, post-quantum (over FrodoPKE-976) |
BMMFrodo1344 |
194 ms |
5,537,792 |
2,762,752 |
malicious-secure, post-quantum (over FrodoPKE-1344) |
The CO, CSW and PVW times are measured with OpenSSL 4.1.1 built with
enable-ec_nistp_64_gcc_128, which has dedicated P-384 code. An older
OpenSSL may be slower: with Ubuntu 22.04’s OpenSSL 3.0.2, which runs P-384
on its generic prime-field code, the three take 117 ms, 116 ms and 591 ms.
The other rows are measured with OpenSSL 3.0.2.
OT extensions (RCOT throughput)
Length 33,251,328 OTs (exactly two ferret_b12 rounds; ~33M; SoftSpoken<8>
rounds down to whole chunks, 33,243,136; the ferret_b13 rows run two
ferret_b13 rounds, 71,499,776), single-threaded (one thread per
party, pinned to one core; SilentFerret’s begin() expansion pool disabled). MOT/s is the
median of 9 runs, the slower of the two parties per run; bits/RCOT (total
wire bytes, both directions — deterministic) includes the one-time base-OT
bootstrap amortised over the length. Observed: the IKNP rows and
semi-honest SoftSpoken<2> and SoftSpoken<4> ran at 95–99% of the
measured link rate; the remaining rows, malicious SoftSpoken<2> just
below that rate, were CPU-bound. Analysis of what binds each configuration is in
docs/performance-tuning.md.
| Protocol |
Mode |
bits/RCOT |
MOT/s |
IKNP |
semi |
127 |
74 |
IKNP |
malicious |
127 |
74 |
SoftSpoken<2> |
semi |
63 |
148 |
SoftSpoken<2> |
malicious |
63 |
143 |
SoftSpoken<4> |
semi |
31 |
292 |
SoftSpoken<4> |
malicious |
31 |
196 |
SoftSpoken<8> |
semi |
15 |
78 |
SoftSpoken<8> |
malicious |
15 |
71 |
Ferret |
semi |
0.48 |
138 |
Ferret |
malicious |
0.48 |
121 |
SilentFerret |
semi |
0.48 |
126 |
SilentFerret |
malicious |
0.48 |
112 |
Ferret (ferret_b13) |
semi |
0.27 |
144 |
Ferret (ferret_b13) |
malicious |
0.27 |
126 |
SilentFerret (ferret_b13) |
semi |
0.27 |
128 |
SilentFerret (ferret_b13) |
malicious |
0.27 |
114 |
IKNP and SoftSpoken<k> traffic is one-direction (127 and
128/k − 1 bits/RCOT). The Ferret and SilentFerret rows use the
default ferret_b12 parameter set, and the ferret_b13 rows the next
larger set; each is measured over two complete rounds of its set. The
steady-state correction traffic is 0.388 bits/RCOT at ferret_b12 and
0.209 at ferret_b13; the rest is the amortised bootstrap. Ferret’s and
SilentFerret’s correction traffic is identical, and their semi-honest
total traffic matches exactly. Malicious SilentFerret batches the two
per-round checks into one, saving 48 bytes total (about 0.000012
bits/RCOT), so both still round to 0.48 bits/RCOT (0.27 at ferret_b13).
The no-argument, one-round-at-a-time wire equivalence is pinned by
the trace table above. The measured
SilentFerret rows’ next() calls are wire-free (all traffic is in
begin(n_ots)).
COT, ROT, OT flavors layer one MITCCRH pass (and, for
chosen-input OT, one block per OT on the wire) on top of RCOT.
sVOLE running time
Malicious mode, default ferret_b12 set, one core per party. A round is
chunk_aligned_buf_sz() = 16,625,664 outputs. The per-round time is the median
of rounds 2–8 of a one-shot run, the slower party per round; setup is the first
begin(), which runs the bootstrap. Both are medians of 3 runs.
| Protocol |
Setup |
Per round |
M outputs/s |
FpVOLE |
82 ms |
200 ms |
83 |
F2kVOLE |
135 ms |
443 ms |
37 |
LPN security
Ferret, SilentFerret, F2kVOLE and FpVOLE rest on primal LPN with regular noise
over a 10-local code. Each round’s samples u = x·A + e are assumed indistinguishable
from uniform, where the secret x ∈ F^k is uniform, each column of the public matrix A
sums d = 10 pseudorandom rows (Alekhnovich, FOCS 2003), and the noise e has exactly
one nonzero entry per block of 2^tree_depth. The field is F₂ for Ferret and
SilentFerret and F_p with p = 2⁶¹ − 1 for FpVOLE; F2kVOLE works over GF(2¹²⁸) and
scales each of a column’s rows by its own pseudorandom field element. Malicious mode adds the static
leakage of Ferret (CCS 2020, eprint 2020/924), one selective-failure query per round.
PrimalLPNParameter(t, logk, tree_depth) fixes the instance: dimension k = 2^logk
(the LPN table, 16·k bytes) and t noise blocks of 2^tree_depth samples each. The
shipped sets are tuning::ferret_b9 … tuning::ferret_b13 in
emp-ot/tuning.h. Select one with the param constructor argument;
both parties must use the same set, because it shapes the transcript.
| Set |
(t, logk, tree_depth) |
table |
bits/COT |
lowest attack cost (bits) |
ferret_b9 |
(2400, 16, 9) |
1 MiB |
2.42 |
144.2 |
ferret_b10 |
(2800, 17, 10) |
2 MiB |
1.32 |
141.3 |
ferret_b11 |
(3800, 18, 11) |
4 MiB |
0.716 |
142.8 |
ferret_b12 (default) |
(4200, 19, 12) |
8 MiB |
0.388 |
141.2 |
ferret_b13 |
(4500, 20, 13) |
16 MiB |
0.209 |
141.4 |
Security level: 128 bits. Every set keeps every attack we count at 141 bits or more, in
F₂ and in the large field, a 10% margin; bits/COT is the steady-state correction traffic.
The binding attack on every set is a sparse-row variant of WXL from this project, which is
not peer-reviewed. These are time-only estimates against known attacks, not guarantees;
the large-field figures cover FpVOLE and F2kVOLE. docs/lpn-security.md
has the details: the counted attacks, the papers used and not used, the full cost tables,
what the estimates do not cover, and how to reproduce them and evaluate a custom set with
tools/lpn_security.py and the estimator.
Security
- Research software. This line has been reviewed by its maintainer and
by automated tooling (ASan/UBSan CI legs, CodeQL, always-on
expecting
contract checks, the trace_hash_baseline wire-format gate, and the
test suite); it has not had an independent security audit.
FpVOLE malicious mode does not provide 128-bit soundness. The
field is p = 2⁶¹ − 1, so single-field consistency checks are bounded
near 2⁻⁶¹ and the bootstrap’s polynomial check near 2⁻⁴⁵ at the
shipped size; the 61-bit Δ caps key-guessing near 2⁻⁶¹: the
round-final check commits before it reveals anything that depends on
Δ, and the base sVOLE lets a cheater learn k bits of Δ only with
probability 2⁻ᵏ, aborting otherwise. F2kVOLE works over GF(2¹²⁸),
with Δ’s lowest bit fixed to 1, so 127 bits of Δ are secret.
- LPN parameters.
Ferret, SilentFerret, F2kVOLE and FpVOLE rest on
primal LPN with regular noise. The shipped sets put every counted attack at
141 bits or more, a 10% margin over the 128-bit target, for the binary
instance and for the large-field instances of FpVOLE and F2kVOLE (LPN
security section). The binding attack is a sparse-row variant of WXL from this
project, which is not peer-reviewed.
- The malicious-mode OT extensions and sVOLEs realize
selective-abort-style functionalities: an adversary may make
selective guesses that the consistency checks catch with overwhelming
probability, and streaming outputs are provisional until
check()
or end() completes the covering checks (see the Streaming RCOT
section); an sVOLE round’s check runs in end(). Discard the outputs
of a session that aborts. An abort can also tell the adversary which of
its guesses failed, so do not rerun with a Δ that an aborted session
used (set_delta): let each new session sample its own.
BMM is a custom OT construction on ML-KEM’s IND-CPA core
(FIPS 203’s K-PKE at the chosen parameter set, from the vendored
mlkem-native); it does not use the
ML-KEM KEM as a black box, and “post-quantum” refers to the Module-LWE
hardness of that construction, not an end-to-end PQ composition claim.
BMMFrodo is the same construction on FrodoPKE, FrodoKEM’s IND-CPA core
(from the vendored FrodoKEM).
- No systematic constant-time guarantee: base-OT elliptic-curve ops call
OpenSSL and the symmetric kernels are written for throughput;
secret-dependent timing has not been audited across the tree.
- Report vulnerabilities to [email protected].
License
Licensed under the Apache License, Version 2.0 — see LICENSE.
Vendored third-party code (mlkem-native, FrodoKEM) is noted in
THIRD_PARTY_NOTICES.md.
评论