#include #include #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(alpha ^ x0); auto root = []() { return dpf::uniform_sample(); }; struct pad { simde__m128i block() { return dpf::uniform_sample(); } std::uint8_t bit() { return static_cast(dpf::uniform_sample() & 1u); } }; dpf::ds_randomness 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; }