libdpf/doc/pages/comparisons.md
Ryan Henry 0d22946a0e Checkpoint the party/runtime stack before share-program and malicious-mode work.
Ship the TLS mesh, composer, Beaver/Yao/leaf MPC, prep/online paths, apps, and docs so the tree is pushable before elevating share_expr, security_mode, and prep resume.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-28 05:59:19 -06:00

1.4 KiB

Comparisons & ranges

\htmlonly

ELI5. The predicate is part of the key, not a test you run after expanding a point key. Greater-than, less-than, and equality each return one payload on the true side and another on the false side. Interval containment is one key for both endpoints. Shares of a comparison add.
\endhtmlonly

A distributed comparison function returns a payload when a predicate holds on the secret point. Shares are additive: reconstruct adds them.

Call When it is hot
dpf::lt / leq / gt / geq The public query is on that side of the secret point
dpf::eq The public query equals the secret point
dpf::ic The secret point lies in a public interval
dpf::idcf / cmp_prefix<L> A correction at every depth, or only the first L bits
dpf::block_width<B> Ring words only at checkpoints B levels apart
auto [k0, k1] = dpf::make_dpf(std::uint8_t{40}, dpf::gt(std::uint64_t{1}));
auto opened = dpf::reconstruct(
    dpf::eval_point(dpf::cmp, k0, std::uint8_t{50}),
    dpf::eval_point(dpf::cmp, k1, std::uint8_t{50}));
// opened == 1

A wildcard comparison payload is filled later with assign_cmp. Eval before that throws.

Go deeper: [dcf.hpp](@ref dpf/dcf.hpp), [interval.hpp](@ref dpf/interval.hpp), [blocked_dcf.hpp](@ref dpf/blocked_dcf.hpp), [F_DCF](@ref dcf.hpp).