libdpf/doc/pages/api.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

107 lines
7.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Call index {#api_reference}
This is the map of calls. Each row is one sentence and a header.
A complete program for the first rows is the [first program](@ref basics).
The same calls, one line each, continue below.
The two namespaces are [dpf](@ref dpf) and [grotto](@ref grotto).
In the sidebar this page sits under **API reference** next to the
namespace, class, and file indexes. Start here when you know the call
you want.
## Build a key
| Call | What it returns |
| --- | --- |
| [dpf::make_dpf](@ref dpf/incremental.hpp) | Two party keys. A dealer knows the index and the payload. |
| [dpf::make_dpf_doerner_shelat](@ref dpf/doerner_shelat.hpp) | The same key when the parties already share the index. |
| [dpf::geneval_point](@ref dpf/geneval.hpp) | Answer shares for one query. No reusable key. |
| [dpf::geneval_cmp](@ref dpf/geneval.hpp) | Answer shares for a comparison. No reusable key. |
| [dpf::make_dpf3](@ref dpf/dpf3.hpp) | Three keys. Any two open the value. |
| [dpf::make_multipoint](@ref dpf/multipoint.hpp) | One key for many secret points. |
| [dpf::ppvc](@ref ppvc_manual) | A point-programmable vector commitment. The hidden coordinate is set when the commitment is opened. |
## Evaluate
| Call | What you pass |
| --- | --- |
| [dpf::eval_point](@ref dpf/eval_point.hpp) | One public input. `*result` is that party's leaf share. |
| [dpf::eval_point](@ref dpf/eval_unified.hpp) `(dpf::cmp, ...)` | One public input on a comparison key. The share is additive. |
| [dpf::eval_interval](@ref dpf/eval_interval.hpp) | An inclusive range, one share per input. |
| [dpf::eval_sequence](@ref dpf/eval_sequence.hpp) | A sorted list of inputs. |
| [dpf::eval_full](@ref dpf/eval_full.hpp) | Every input in the domain. |
| [dpf::reconstruct](@ref dpf/secret_share.hpp) | Both shares. Leaf shares subtract. Comparison shares add. Shamir shares use Lagrange. |
| [dpf::shamir::deal](@ref dpf/shamir.hpp) / `make_shamir_shares` | (K,N) Shamir shares over `fp61` or `gf2n`. For `gf2n`, `N < 2^k`. `(2,3)` is `make_shamir_shares(secret, slope)`. |
| [dpf::shamir::share_secret](@ref dpf/random.hpp) | The same split with uniform higher coefficients. |
| [dpf::shamir::reconstruct](@ref dpf/shamir.hpp) | Any K shares. Further shares are a consistency check, not a correction. |
| [dpf::eval_point](@ref dpf/interval.hpp) `(dpf::ic, ...)` | One public input on an interval key. |
## Comparisons and tags
| Call | Meaning |
| --- | --- |
| [dpf::lt](@ref dpf/dcf.hpp), [leq](@ref dpf/dcf.hpp), [gt](@ref dpf/dcf.hpp), [geq](@ref dpf/dcf.hpp) | The comparison channel. One per key. |
| [dpf::eq](@ref dpf/dcf.hpp) | A point payload, not that channel. |
| [dpf::ic](@ref dpf/interval.hpp) | Public interval on a secret mask. |
| [dpf::at](@ref dpf/placement.hpp) | A value on a prefix, and a value at the leaf. |
| [dpf::verifiable](@ref dpf/verifiable.hpp) | The key carries a proof token. |
| [dpf::vec](@ref dpf/vec.hpp) | Several lanes at one leaf. No carry between lanes. |
| [dpf::wildcard_value](@ref dpf/wildcard.hpp) | Payload filled in after the key exists. Eval throws until then. |
## Domains and leaves
The catalogs, with the types that are inputs and the types that are outputs:
- [Input types](@ref input_types): integers, `modint`, `xint`, `bitstring`, `keyword`, `keyword2`, fixed-point.
- [Output types](@ref output_types): `bit`, `twobit`, `nyble`, `gf2` through `gf264`, prime fields, curve points, shares, `vec`.
`bit`, `twobit`, `nyble`, and `gf2` / `gf22` / `gf24` are packed output lanes. `keyword2` is a domain, not a leaf.
## After the offset is public
[Grotto](@ref guided_tour) evaluates a function of x once the public offset is open.
Several piecewise LUTs share one comparison via [make_lut_union_plan](@ref grotto/lut_union.hpp).
The pages are [offset Horner, jets, and ring switch](@ref jet_and_ring) and
[representation shift and twisted jets](@ref repr_and_twist).
Haar and bior(5,3) tables are [make_haar_dwt_lut](@ref grotto/dwt_lut.hpp)
and [make_bior53_dwt_lut](@ref grotto/dwt_lut.hpp).
## Multiplication and sessions
| Call | What it does |
| --- | --- |
| [dpf::beavers::session](@ref dpf/beaver.hpp) | ABY2.0 blinds, products, dots, and polynomial schedules. |
| [dpf::yao::b2y](@ref dpf/yao_share.hpp) / `a2y` / `fss2y` / `rss2y` | A leaf share to LSB-first XOR bits. Point leaves use `b2y`. Comparisons use `a2y`. |
| [dpf::yao::y2b](@ref dpf/yao_share.hpp) / `y2a` / `y2fss` / `y2rss` | Those bits back to the leaf's share type. |
| [dpf::yao::netlist](@ref dpf/yao.hpp) / `session::eval` | The boolean circuit on those bits. Party 0 garbles. |
| [dpf::arith_garble::circuit](@ref dpf/arith_garble.hpp) | Free add, public scale, projection. Ball–Malkin–Rosulek. |
| [dpf::flute::eval_pair](@ref dpf/flute.hpp) / `eval_trio` | Public LUT on masked bits. Two or three online bits per output. A DPF point stays a key. |
| [dpf::yao::eval_if](@ref dpf/yao_stack.hpp) / `eval_one_hot` | Stacked branch and k-way switch. Rows follow the heaviest branch. |
| [dpf::yao::aes128](@ref dpf/yao_aes.hpp) / `aes_mmo` | Packaged AES-128 and the zero-key MMO block on that session. |
| [dpf::beavers::schedule_objective](@ref dpf/beaver.hpp) | `prep` peels for Appendix E; `rounds` keeps one online round. |
| [dpf::protocol::composer](@ref dpf/compose.hpp) | Domain-tagged FSS / ABY / RSS strands on one RoundSink plan. |
| [dpf::shuffle::shuffle_hidden_pass](@ref dpf/shuffle.hpp) | Hidden reorder of an RSS column. A secret index stays a DPF. |
| [dpf::protocol::composer::shuffle_hidden](@ref dpf/compose.hpp) | Three `shuffle_send` waves for that reorder. |
| [dpf::protocol::composer::client_servers](@ref dpf/compose.hpp) | PIR: one upload round, one answer round, no server-server open. |
| [dpf::protocol::plan_to_schedule](@ref dpf/compose.hpp) / `drive_via_schedule` | Lower a plan onto `schedule_session` (edge, receive rule, branch/next). |
| [dpf::protocol::schedule_session](@ref dpf/protocol.hpp) | Ready instance runs on this thread; flush sends the largest prefix per edge. |
| [dpf::net::edge_mesh](@ref dpf/net/edge_mesh.hpp) / `make_memory_star` | N duplex RoundSinks (star / clique / dealer). |
| [dpf::protocol::session_host](@ref dpf/session_host.hpp) | Queue micro-plans on a durable mesh. |
| [dpf::protocol::iknp_setup_graph](@ref dpf/iknp_graphs.hpp) / `du_atallah_mul_graph` | IKNP / Du-Atallah / star upload-answer as schedule rounds. |
| [dpf::protocol::pirsona_bitmore_fetch](@ref dpf/mesh_apps.hpp) / `hushmap_add_schedule` | PIRsona BitMore fetch and hushmap ADD skeletons. |
| [dpf::protocol::drive_star](@ref dpf/app_plans.hpp) / named `*_plan` helpers | Star drive + application micro-plans (PIR, mailbox, SUBLEQ, Pika, …). |
| [dpf::app::run](@ref dpf/app_flow.hpp) / `run_plan` | Drive both parties and print `rounds` and `bytes`. |
| [dpf::log](@ref dpf/log.hpp) / [app::start_logging](@ref dpf/run_log.hpp) | Leveled run log and provenance banner. |
| [dpf::experiment](@ref dpf/experiment.hpp) / [Logging & statistics](@ref experiment_costs) | Replayable master seed; CSV cost breakdown. |
| [dpf::app::measure_plan](@ref dpf/app_flow.hpp) / `run_measured` | Drive a plan under an experiment; optional `DPF_EXPERIMENT_DIR` CSV dump. |
| [dpf::app::run_fleet](@ref dpf/app_flow.hpp) | Many instances. Parked receives yield to the side that is behind. |
## Where to read next
- [Which DPF?](@ref which_dpf) if you are still choosing the object.
- [Evaluating DPFs](@ref evaluation) for point, interval, sequence, and full-domain cost.
- [Network, parties, and MPC](@ref network_and_mpc) for the runtime around the keys.
- [Logging, statistics, and experiments](@ref experiment_costs) for the run log and cost CSVs.
- [Protocol composition](@ref protocol_compose) for fused walks, early-stop, and RSS refresh.
- [Bibliography](@ref bibliography) for the papers behind the keys.
- [Application mockups](@ref applications) for the DPF step inside a larger protocol.