OT reference qualification
The requested OT construction passes native and standalone Wasm32-WASI behavior checks. Integration into the Rust Wasm64 IC algorithm remains blocked. This directory contains benchmark fixtures and a reproducible reference build; it supplies no Rust OT adapter, public application or canister endpoint.
The crypto profile records the
exact backend/dependency commits, parameter choices, primitives and source
function map. The backend is maintained
libOTe
with explicit SimplestOT base objects and SoftSpokenMalOtSender /
SoftSpokenMalOtReceiver. It retains their AES, BLAKE2b, PRG, field arithmetic,
base-role reversal, malicious checks, padding and upstream chosen-message
conversion. There is no semi-honest fallback or direct-selection OT.
Malicious OT does not establish malicious garbling security. The surrounding garbling experiment assumes honest garbling.
Scope and remaining blockers
- The portable C++ reference executes all cryptographic work inside Wasm. Its imports are WASI process/I/O/clock plumbing; there are no native crypto or random-generator callbacks. This is separate from the IC system API.
- The downloaded official SDK provides Wasm32 sysroots. The actual Wasm64
--target=wasm64-unknown-unknownprobe fails at the first standard C++ header:'exception' file not found. An IC port still needs a qualified memory64 C++ standard library/runtime, exception and allocator ABI, an IC-compatible transport bridge and a checked Rust function boundary. A Wasm32 WASI module cannot be linked directly into the existing Wasm64 Rust canister. - Exact revised-paper review remains open. Primary ePrint metadata identifies
Chou–Orlandi at
2018-05-29T13:54:02Zand SoftSpokenOT at2025-11-18T19:57:30Z. The corresponding immutable archive PDFs return HTTP 403. The Chou author mirror is a 2015 PDF and the accessible CRYPTO SoftSpoken publication is from 2022; neither substitutes for the required revision. - Upstream portable AES uses secret-indexed S-box tables. Portable constant-time secret execution and a full cryptographic audit are unqualified. The 128-bit block/security parameter is distinct from the backend's 40-bit statistical check and its 160-bit uniform-base seed-commitment digest.
- The pinned macoro repository has file-level MIT notices on cppcoro-derived code but no repository-level license file. Complete redistribution coverage must be established before vendoring or distributing the backend.
The profile therefore keeps the overall OT lane blocked. No IC OT instruction, cycle or page-fee measurement is claimed.
Parameters and checks
The primary fixture uses malicious defaults: k=2, random OT, one thread,
uniform base OT, 128 actual base OTs, a 40-bit final subspace consistency check
and 64 sacrificed random choices. It asks the backend for its base count.
The extension sender receives base OTs; the extension receiver sends them.
| Logical chosen OTs | Internal padded OTs | Non-output OTs, including sacrifice | Chosen-message mask payload |
|---|---|---|---|
| 8 | 128 | 120 | 256 bytes |
| 80 | 256 | 176 | 2,560 bytes |
| 800 | 896 | 96 | 25,600 bytes |
| 8,000 | 8,064 | 64 | 256,000 bytes |
Internal work is 128 * ceil((N+64)/128). sendChosen and receiveChosen
execute the original random-OT-to-chosen-message conversion, transmitting both
16-byte XOR masks per logical OT. Every returned chosen message is checked
against its original input pair after both protocol tasks successfully finish.
Each measured chosen-count process generates a fresh set of actual base OTs.
The selected unmodified upstream tests are Bot_Simplest_Test,
Vole_SoftSpokenSmall_Audit_Test, OtExt_SoftSpoken_AesState_Audit_Test and
OtExt_SoftSpoken_BufferState_Audit_Test. Their coverage includes the order-two
cofactor regression, small-order sender and malformed receiver rejection,
uninitialized/moved state, invalid dimensions, and deferred malicious
consistency failure followed by state clearing and retry rejection. The native
fixture adds an actual wrong uniform-seed decommitment and an address-size
overflow rejection. The upstream audit tests use synthetic lower-level states
for some rejection cases; the primary chosen-message rows run real base OT.
General fixture inputs use BLAKE3 derive-key/XOF with context
p2p-gc-bench/v1/private-rng and material
seed[32] || session[32] || LE64(query_index) || purpose[1].
The public test seed is bytes 01..20, the session is bytes a0..bf, and each
chosen case uses its count as the query index. Purposes 30/31 (hex) seed the
two backend RNGs through their public 16-byte seed interface; 32/33 generate
input pairs and choices directly with BLAKE3. Purposes 34 and 36..38 belong
to the rejection/base controls. These deterministic public fixtures are not
production randomness. Backend RNG algorithms and consumption are unchanged.
Faithful portability patch
The original portable library builds natively. Its initial Wasm32 build exposes missing standard C++ includes and a forbidden narrowing conversion. The patches contain the exact changes:
- Add
<type_traits>to cryptoToolsblock.hand<exception>to cryptoToolsAES.cpp, coprotoerror_code.hand macorocoro_frame.h. - In
SubspaceVoleReceiver::recv, retain the original 64-bit addition guard; reject(blocks + padding) > SIZE_MAX / sizeof(block)before clearing or allocation, then cast the checked count tosize_tfor storage andspan.
The added check prevents truncation and byte-size overflow on Wasm32. It is tested on both pointer widths. No primitive, protocol transcript, malicious check, security parameter or output conversion changes. No compiler diagnostic is suppressed to bypass the narrowing error. The include changes only supply declarations already required by the source.
The stock complete frontend_libOTe test target also fails in an unrelated
disabled Waterfall test because macoro is undeclared there. The fixture builds
and runs the original three selected OT test translation units directly; it
does not claim that the complete upstream test suite passes.
Reproduce
Use a fresh, caller-owned build directory. The helper downloads exact source commits and applies only the checked-in portability patches. It records each command, exit status and complete output under that directory. It uses no Cargo target, SDK runtime change or application state.
python3 benches/crypto/garbled-circuit/ot-reference/build_reference.py \
--target native --work /dev/shm/gc-ot-native-fresh --jobs 4
/dev/shm/gc-ot-native-fresh/probe-build/gc_ot_probe
The qualified compiler is official
wasi-sdk-34,
artifact wasi-sdk-34.0-x86_64-linux.tar.gz, SHA-256
b761e3a0721dbae9c09a0059e5fdb2bf917d1b4a8a7b430fb3b5aafb0984b2c4.
Its Clang/LLVM commit is 895aa2c896ada719451be2e3673c83da8ddf1141;
wasi-libc is 2e6fb9d8ee0cdf9e431fbcabe8af3115de000a13.
It uses the documented
Wasm exception flags,
a 2 MiB stack and a 128 MiB linear-memory maximum.
python3 benches/crypto/garbled-circuit/ot-reference/build_reference.py \
--target wasi --wasi-sdk /absolute/wasi-sdk-34.0-x86_64-linux \
--work /dev/shm/gc-ot-wasi-fresh --jobs 4
python3 -m pip install --target /dev/shm/gc-ot-runtime 'wasmtime==50.0.1'
PYTHONPATH=/dev/shm/gc-ot-runtime \
python3 benches/crypto/garbled-circuit/ot-reference/run_wasmtime.py \
/dev/shm/gc-ot-wasi-fresh/probe-build/gc_ot_probe \
--out /dev/shm/gc-ot-full-fresh
For isolated complete processes, pass --count 8, 80, 800 or 8000 to the
Wasmtime runner, or --control noop / --control base128, with a fresh --out
directory each time. The native executable accepts the corresponding single
argument directly. The no-op and real 128-base-OT rows are separate controls;
they are never subtracted from reported chosen-message results.
Wasmtime is pinned to the 50.0.1 manylinux x86-64 wheel, SHA-256
cc14c3a17654e0394e0225b11813532ef0cd7bd1e222a0c5494cdedaabeddac4;
engine commit c307ec81de02852d815e9849f7c89d955c03c30d.
wasmtime_fuel_consumed is the runtime's fuel unit for the whole standalone
process, including setup, output checking, serialization and cleanup. It is
never described as IC instructions. Final linear-memory pages report capacity
for stack, static data and heap together; they are not live heap or IC fees.
The retained results identify the final source, patched dependencies, module, selected rows, runtime policy, memory and failure receipts. The license directory preserves the applicable notices alongside the unresolved macoro coverage note above.
Regenerate the flat machine rows from the retained raw samples with:
python3 benches/crypto/garbled-circuit/ot-reference/summarize_receipts.py \
--evidence crypto/research/experiments/2026-10-31-garbled-circuit/ot-reference \
--source-manifest crypto/research/experiments/2026-10-31-garbled-circuit/ot-reference/toolchain-and-fixture.json \
--out /dev/shm/gc-ot-isolated-rows.jsonl
The dated evidence was moved byte-for-byte from its original benchmark
evidence/ directory into the research archive after qualification. Frozen
receipts and report links retain their original capture paths and link base;
use the current paths above for navigation and reproduction.