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
43
examples/grotto/lut_union.cpp
Normal file
43
examples/grotto/lut_union.cpp
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#include <cstdint>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#include "grotto.hpp"
|
||||
|
||||
/// Two piecewise LUTs, one comparison, one prefix walk of the union.
|
||||
int main()
|
||||
{
|
||||
//! [lut-union]
|
||||
grotto::piecewise_lut<std::uint8_t> low{{0, 10}, {{1, 0}, {0, 2}}};
|
||||
grotto::piecewise_lut<std::uint8_t> high{{0, 4, 12}, {{3, 0}, {1, 1}, {9, 4}}};
|
||||
const std::uint8_t center = 12;
|
||||
const std::uint8_t eta = 3;
|
||||
|
||||
auto plan = grotto::make_lut_union_plan({low, high}, eta);
|
||||
auto mat = grotto::make_offset_poly_keys<std::uint8_t>(center, plan.degree);
|
||||
auto s0 = grotto::lut_union_eval<0>(mat, plan);
|
||||
auto s1 = grotto::lut_union_eval<1>(mat, plan);
|
||||
|
||||
dpf::protocol::composer composer(0);
|
||||
grotto::schedule_lut_union(composer, plan);
|
||||
//! [lut-union]
|
||||
|
||||
if (plan.comparisons != 1 || plan.prefix_walks != 1)
|
||||
{
|
||||
std::cerr << "plan shape\n";
|
||||
return 1;
|
||||
}
|
||||
if (composer.default_plan().rounds() != plan.depth)
|
||||
{
|
||||
std::cerr << "geneval rounds\n";
|
||||
return 1;
|
||||
}
|
||||
const std::uint64_t opened[2] = {s0[0] + s1[0], s0[1] + s1[1]};
|
||||
if (opened[0] != grotto::offset_poly_clear<std::uint8_t>(center, low.knots, low.coeff, eta)
|
||||
|| opened[1] != grotto::offset_poly_clear<std::uint8_t>(center, high.knots, high.coeff, eta))
|
||||
{
|
||||
std::cerr << "opened value\n";
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue