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>
This commit is contained in:
parent
695f8e84f7
commit
0d22946a0e
1835 changed files with 170291 additions and 2849 deletions
36
examples/mwe/shared_index.cpp
Normal file
36
examples/mwe/shared_index.cpp
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#include <cstdint>
|
||||
#include <iostream>
|
||||
|
||||
#include "dpf.hpp"
|
||||
|
||||
// Complete program. The parties already hold XOR shares of alpha.
|
||||
// The pad stream is local here; a real protocol would draw it from a dealer
|
||||
// who never sees alpha.
|
||||
//
|
||||
// c++ -std=c++17 -march=native -I include -I thirdparty examples/mwe/shared_index.cpp
|
||||
int main()
|
||||
{
|
||||
const std::uint8_t alpha = 42;
|
||||
const std::uint64_t beta = 7;
|
||||
const std::uint8_t x0 = 7;
|
||||
const std::uint8_t x1 = static_cast<std::uint8_t>(alpha ^ x0);
|
||||
|
||||
auto root = []() { return dpf::uniform_sample<simde__m128i>(); };
|
||||
struct pad
|
||||
{
|
||||
simde__m128i block() { return dpf::uniform_sample<simde__m128i>(); }
|
||||
std::uint8_t bit()
|
||||
{
|
||||
return static_cast<std::uint8_t>(dpf::uniform_sample<unsigned>() & 1u);
|
||||
}
|
||||
};
|
||||
dpf::ds_randomness<decltype(root), pad> rng{root, {}};
|
||||
|
||||
auto keys = dpf::make_dpf_doerner_shelat(x0, x1, rng, beta);
|
||||
const std::uint64_t opened = dpf::reconstruct(
|
||||
*dpf::eval_point(keys.first, alpha),
|
||||
*dpf::eval_point(keys.second, alpha));
|
||||
|
||||
std::cout << opened << "\n";
|
||||
return opened == beta ? 0 : 1;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue